Skip to content

fix(agy): render structured print-mode progress - #1742

Open
timmikk wants to merge 5 commits into
slopus:mainfrom
timmikk:fix/agy-stream-json-progress
Open

fix(agy): render structured print-mode progress#1742
timmikk wants to merge 5 commits into
slopus:mainfrom
timmikk:fix/agy-stream-json-progress

Conversation

@timmikk

@timmikk timmikk commented Aug 31, 2026

Copy link
Copy Markdown

Agy print mode emits stream-json NDJSON, but Happy treated stdout as plain text. This change parses the structured stream and renders Agy activity using Happy's existing mobile protocol and native tool cards.

What changed:

  • Buffer fragmented agent_response deltas per response step, then emit each complete progress message before the following tool call.
  • Use the terminal aggregate only as a fallback, avoiding duplicated progress/final responses.
  • Pair tool lifecycle events with stable per-turn call IDs.
  • Translate common Agy tools to native Happy cards (Read, LS, Bash, Edit, Write, Grep, Glob, WebFetch, and WebSearch).
  • Render manage_task and call_mcp_tool as concise native command cards instead of raw JSON.
  • Surface selected command/task/MCP/search results through the existing phone-compatible progress-text path.

Safety:

  • Only allowlisted scalar input fields are forwarded; file contents, edit bodies, arbitrary nested arguments, and file/list outputs remain hidden.
  • Credential-bearing commands and selected outputs are redacted.
  • Tool names, arguments, outputs, record sizes, response buffering, and per-turn tool/response counts are bounded.
  • Raw stderr and malformed stream contents are not logged.

Validation:

  • pnpm --filter happy test passes (87 files, 829 tests).
  • Focused Agy/ACP/CLI-argument suite passes (53 tests).
  • Real Agy stream-json probes confirmed response-fragment and tool-output shapes.
  • Isolated ahjo-dev phone testing confirmed native file/task/MCP/search cards, visible command results, cancellation, one final response, and complete progress comments arriving before their commands without awkward fragment splits.

@timmikk
timmikk marked this pull request as ready for review August 31, 2026 19:07
@timmikk timmikk changed the title fix(agy): stream structured print-mode events fix(agy): render structured print-mode progress Sep 2, 2026
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