Skip to content

feat(agent): live progress during hidden tool-call generation#139

Open
bararchy wants to merge 1 commit into
masterfrom
feat/agent-tool-progress
Open

feat(agent): live progress during hidden tool-call generation#139
bararchy wants to merge 1 commit into
masterfrom
feat/agent-tool-progress

Conversation

@bararchy

Copy link
Copy Markdown
Member

Problem

The streaming renderer has three modes: :normal (printed), :think (dim gray), and :tool (hidden). When the model writes a file, it streams the entire file inline inside <tool_call>…</tool_call> — all hidden — so the UI sat in dead silence for tens of seconds (≈3 KB file at ~15 tok/s) before the line appeared at once. Felt like a freeze / "BOOM text wall".

Fix

While in :tool mode, render a dim spinner + running char count (⠋ writing tool call… (N chars)) updated per token via \r, cleared when the tool call closes or generation ends. Visible progress instead of dead air. <think> already streams (gray); :normal answer text is unchanged.

Verified

  • Builds (CUDA no-codegen), crystal tool format clean, ameba 0.
  • Isolated renderer harness (feed a think + tool_call + normal sequence char-by-char): hidden file content is not emitted, the spinner shows, no raw <tool_call> tag leaks, and :think/:normal text + trailing text after the call all render.

The stream renderer hides <tool_call> tokens, so while the model writes a whole
file inline (tens of seconds at ~15 tok/s) the screen sat silent until the ⚒
line appeared all at once. Render a dim spinner + running char count while in
tool mode, cleared when the call closes, so there's visible progress instead of
dead air. Reasoning (<think>) already streams; normal answer text unchanged.
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.

1 participant