Skip to content

fix: parse streamed command output fences#160

Open
duyua9 wants to merge 1 commit intoBuilderIO:mainfrom
duyua9:fix/streamed-command-parser
Open

fix: parse streamed command output fences#160
duyua9 wants to merge 1 commit intoBuilderIO:mainfrom
duyua9:fix/streamed-command-parser

Conversation

@duyua9
Copy link
Copy Markdown

@duyua9 duyua9 commented Apr 17, 2026

Summary

  • add a small parser helper that extracts the command from streamed completions without leaking markdown fences
  • handle fenced commands with or without a language tag, split opening fences, inline fenced commands, and raw one-line commands
  • add focused parser regression checks covering the known empty-script / literal-backticks issue shapes

Testing

  • /Users/ming/code/BuilderIO/ai-shell/node_modules/.bin/prettier --write src/helpers/completion.ts src/helpers/completion.test.ts
  • /Users/ming/code/BuilderIO/ai-shell/node_modules/.bin/jiti src/helpers/completion.test.ts
  • /Users/ming/code/BuilderIO/ai-shell/node_modules/.bin/pkgroll

Closes #105
Closes #145
Closes #104

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

empty script returned and a strange script generated. Worked a few times, then it stopped Script doesn't execute because of ```

1 participant