Repository navigation
Grok: parse the composer so hcom term --json reports prompt_empty - #162
signet-bot-claude wants to merge 1 commit into
Conversation
Grok had no composer parser, so `hcom term --json` said prompt_empty=false and input_text=null at an empty prompt, and scripts that wait for an empty prompt before waking an agent never typed. hcom's own Grok delivery goes through the ACP prompt queue and never reads the composer, so only the terminal JSON (and the debug prompt glyph) change. Parse the boxed `❯` composer, anchored to the bottom of the screen so boxes in the transcript are never read as the composer. An empty composer is a bare `❯`; wrapped input adds `│ … │` rows; a menu or approval in its place is None (not empty). Tests: real captures of an idle and a busy Grok screen (transcript text anonymized, composer rows as drawn) read as empty and the idle one reports ready/prompt_empty/input_text in the dump; typed and wrapped drafts are extracted; a menu below an old composer-like box is not empty. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
[Medium impact] The PR appears safe to merge; no blocking issues were found. SummaryAdds Grok composer parsing so
No actionable issues were found. Tests were not run during this review. Reviews (1) · Last reviewed commit: "Grok: parse the composer so `hcom term -..." · Reviewed by Greptile |
`hcom term --json` reported `prompt_empty: false` for tools with no composer parser (Grok, OpenCode, Kilo, Pi, Omp, Hermes) and whenever a parser found no composer. Scripts read that as "the user has typed something" and never acted. `prompt_empty` now follows `input_text`: true/false when the composer was read, null when it was not. The delivery gate still treats an unread composer as unsafe. Refs #162
|
Grok reports null now instead of false it doesn't need a parser |
Problem
hcom term <grok-agent> --jsonreportsprompt_empty: falseandinput_text: nulleven when Grok's prompt is empty, because there is no Grok composer parser (get_input_box_textreturnsNonefor Grok). Scripts that wait for an empty prompt before typing into an agent therefore never act on Grok agents.hcom's own Grok delivery goes through the ACP prompt queue and never reads the composer, so delivery is not affected. Only the terminal JSON and the debug prompt glyph change.
How it was observed
hcom 0.7.30 on macOS (arm64), Grok Build (Grok 4.6) at 18x127. A listening Grok agent with unread mail sat at an empty
❯prompt, yethcom term --jsonsaidprompt_empty: false, so a wake script gated on it never typed.Fix
ScreenTracker::get_grok_input_textparses Grok's composer: a rounded box over a one-line footer, with the model and approval mode in the bottom border.╰must sit within the last four rows (counting up from the last non-blank row), and the top border╭within 12 rows above it. Boxes in the transcript are never read as the composer.❯. Grok shows no placeholder, idle or mid-turn.│ … │rows, which are joined with newlines.❯(a menu or approval in its place), the result isNone, which is not empty.debug_prompt_glyphgains the Grok glyph. Theintegration_speccomment for Grok is updated to say the composer is parsed forhcom term --json, though gates still do not read it.Tests
The fixtures are real
hcom term --jsoncaptures of an idle and a busy Grok screen (18x127). Transcript text is anonymized; the composer and footer rows are as Grok drew them.grok_idle_empty_composer_is_empty_and_ready: the idle capture parses to"",is_prompt_emptyandis_readyhold, and the screen dump reportsready,prompt_emptyandinput_text: "".grok_composer_stays_empty_mid_turn: spinner, subagent panel and transcript above an empty composer.grok_extracts_typed_and_wrapped_draftsgrok_without_a_composer_is_not_empty: an approval menu below an old composer-like box.Results
Local run on this branch (on
main669a067), macOS arm64, rustc 1.99.0 (the repo pins 1.97.1),cargo test --bin hcomwith the test names as filters.cargo fmt --checkis clean. Clippy and the full suite were not run on this branch.get_input_box_textback toNone,grok_idle_empty_composer_is_empty_and_readyandgrok_composer_stays_empty_mid_turnfail. The parser-level draft test and the not-empty test still pass, as expected.Related
I did not find a matching existing issue in the checked issues, pull requests and discussions. #110 is a merged Codex placeholder-parsing fix. #114 is historical Antigravity composer/banner context; the maintainer reported that newer Antigravity changed its TUI banner and tested successfully on 1.2.11. Neither establishes this PR's failure or fix.
🤖 Generated with Claude Code