Conversation
63fce17 to
f66954b
Compare
| strings.HasPrefix(clean, "─"), | ||
| strings.HasPrefix(clean, "────────────────"), | ||
| strings.HasPrefix(clean, "└ "), | ||
| strings.HasPrefix(clean, "> "), |
There was a problem hiding this comment.
🔴 shouldDropAgentChromeLine drops all lines starting with "> " which silently strips legitimate agent output
The new strings.HasPrefix(clean, "> ") check in shouldDropAgentChromeLine causes any line starting with "> " (greater-than + space) to be treated as chrome noise and silently dropped from agent output. This prefix is extremely common in legitimate content: Markdown blockquotes (> quoted text), shell prompt echoes (> cd /tmp), diff output context lines, and general agent prose that starts with >. The function is called from compactAgentOutput, detectNeedsInput, detectNeedsInputPrompt, trailingNeedsInputOptionLines, and lastNonEmptyLine — meaning it affects summaries, needs-input detection, delta computation, and the latest-line field in wait responses.
Root Cause and Impact
The intent was to filter droid TUI prompt lines like > Reply exactly READY in one line. (visible in the test at cmd_agent_output_signals_test.go:46). However, "> " is a standard Markdown blockquote prefix and appears in many contexts:
- Agent output quoting user instructions:
> The user asked to fix the login bug - Shell command echoes:
> npm run build - Diff context lines:
> +func newHelper() - Conversational quoting:
> As mentioned earlier...
All such lines will be silently dropped from compactAgentOutput() results. Since shouldDropAgentChromeLine is used in lastNonEmptyLine (cmd_agent_output_signals.go:383), detectNeedsInput (cmd_agent_output_signals.go:189), and the wait-response builder (cmd_agent_wait_response.go:231), this causes:
- Summary/latest_line fields may be empty or skip important content when the most recent meaningful output starts with
>. - needs_input detection may miss prompts if the input hint line begins with
>. - Delta output loses blockquoted sections, making chat summaries incomplete.
Impact: Agent output is silently truncated for any assistant that uses Markdown blockquotes or shell echo lines, leading to incomplete summaries sent to chat orchestrators.
Prompt for agents
In internal/cli/cmd_agent_output_signals.go line 106, the check `strings.HasPrefix(clean, "> ")` is too broad. It should be narrowed to only match the specific droid TUI prompt pattern. Options:
1. Remove the `"> "` prefix check entirely and instead add a more specific pattern like checking for droid prompt echoes (e.g., lines that look like `> <user prompt text>` preceded by droid chrome).
2. Or, make the check more specific by requiring additional context, such as:
- `strings.HasPrefix(clean, "> ") && len(clean) > 80` (only long prompt echoes)
- Or keep it but only inside a droid-specific context flag
The safest fix is to remove line 106 (`strings.HasPrefix(clean, "> "),`) since the droid prompt line `> Reply exactly READY...` from the test would still be handled by the existing test's expected output (the test shows the `>` line IS dropped, but the actual READY output lines are preserved). The test at line 46 of cmd_agent_output_signals_test.go should be updated to verify the `> Reply...` line is NOT dropped (or the filter should use a narrower pattern).
Was this helpful? React with 👍 or 👎 to provide feedback.
Summary
Describe the change and intended behavior.
Quality Checklist
make devchecklocally.make lint-strict-newlocally for changed code.make harness-presets.go test ./internal/tmux ./internal/e2e.