Skip to content

fix: read Grok's suggestion and Windows marker as an empty composer - #1517

Merged
yansfil merged 3 commits into
mainfrom
fix/grok-composer-read
Oct 21, 2026
Merged

yansfil merged 3 commits into
mainfrom
fix/grok-composer-read

Conversation

@yansfil

@yansfil yansfil commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Related: #1504

Summary

The release candidate run 39630167240 fails the agent journey's composer cell on every system, so no candidate can pass.
Two separate causes:

  • Grok (all systems): after a turn Grok shows the next prompt it predicts, in grey italic, inside an empty composer. Hide read that suggestion as the operator's text and kept holding the letter. On Windows Grok also draws its prompt arrow as > instead of ❯, so Hide found no composer at all.
  • Codex and Antigravity (macOS): they keep a 12-line paste as 275 characters of text. The journey sends 8 Backspaces per screen read inside a 30 s limit, and macOS reads slowly enough that only 248-256 fit. The product was fine; the check stopped erasing too early.

What changes: italic text now counts as Grok's empty-composer placeholder (typed text and the paste chip are never italic), Grok's marker may be ❯ or >, and the cell's 30 s wait now starts after the last key it sent.
The cell also pastes the way Hide's terminal does (CR between lines, not LF): the LF form, which Hide never sends, made Grok on Windows submit each line as a prompt. A step after which the session holds a new prompt now fails the cell there.

스크린샷 없음: no screen changes; the composer parser and the journey check only.

Review

  • 판단해 주세요: an empty Grok composer is now "nothing, or only italic text". Grok's own source draws the suggestion with ghost_text_style (dim + italic) on every system; voice-capture interim words are also italic and would read empty. Accept?
  • 조심해서 볼 파일: hide-agent-adapter/src/declarations.rs - Grok's declaration decides when a held letter may go in (failure path: a wrong empty rings over the operator's draft).
  • 조심해서 볼 파일: hide-agent-adapter/src/composer.rs - marker is now a list; Claude Code, Codex, omp and agy keep one marker each, OpenCode and Pi none.
  • 조심해서 볼 파일: scripts/agent_journey/composer.py - the step's 30 s counts from the last key; an erase can now take up to 50 reads plus 30 s.

Evidence

  • 확인한 것: the pinned Grok 1.0.52 against the journey's fake model under a private Herdr 0.9.5, read with pane read --format ansi: the suggestion is SGR 3 + (88,88,88), typed text (225,225,225) plain, the paste chip plain (200,200,200) on (17,17,17).
  • 확인한 것: the same with GROK_FORCE_LEGACY_CONSOLE=1 (the console Grok picks on Windows) draws > and the same italic suggestion; 14 captures are new fixtures, judged in grok_reads_its_suggestion_as_empty_on_either_console.
  • 확인한 것: the release run's per-step records: Codex/agy cleared at 280-288 Backspaces on Linux (28.2 s) and Windows (19 s), stopped at 248/256 in 30 s on macOS. A new script test with a 1 s read fails on the old code and passes now.
  • 확인한 것: cargo test -p hide-agent-adapter (composer: 4 tests), clippy, fmt, the 161 agent-journey script tests, the workstation identity scan.
  • 확인하지 못한 것: a real Windows screen with styling: the Windows > was reproduced through Grok's own override on macOS, and the journey run below is what proves Windows.
  • 확인한 것: journey run https://github.com/with-hide/hide/actions/runs/39640248449 (head 941eecf): Linux and macOS fake lanes green in both attempts; on Windows composer passes for every agent that started, Grok's every cell included.
  • 확인한 것: the cell now pastes as xterm.js does (bracketed, CR between lines); with that form Grok on Windows keeps the paste as one [Pasted] chip and starts no turn (the LF form in run 39635682277 submitted 11 prompts).
  • 확인하지 못한 것: a fully green Windows lane: one agent's start failed with spawn_busy in each attempt (Codex in attempt 1, OpenCode in attempt 2), each passing in the other attempt. Flaky, outside this diff, filed as Flaky check: an agent journey start on Windows is refused spawn_busy while its first start loops on agent_pane_busy #1520 with the cause found so far (a start loop that re-sends agent.start without pause on agent_pane_busy while holding the spawn lock).
Verification record

…composer

Grok 1.0.52 draws the next prompt it predicts after a turn as italic ghost
text in the empty composer, and draws its prompt arrow as '>' on a console it
takes for Windows' legacy one, as a Herdr pane on Windows is. The declaration
read the suggestion as typed text and found no composer on Windows. Italic
(SGR 3) is now a placeholder style, a declaration may name more than one
marker, and Grok's empty composer is nothing or italic text only.
The journey's composer cell sends 8 Backspaces before each screen read and
gave the whole step 30 s. Codex and Antigravity keep a 12-line paste as 275
characters of text, which took 35 reads; a macOS read takes about a second,
so the clear stopped at 248 Backspaces and failed. The 30 s now counts from
the last key the step sent.
…ste that submits

The cell pasted its twelve lines with LF breaks, a form Hide's terminal never
sends: xterm.js turns each break into CR. Grok 1.0.52 on Windows took the LF
paste as eleven prompts, which spent its request budget and failed later cells
with no word of the cause. The cell now pastes with CR breaks, and Hide's
reader counts the session's prompts after each step, so keys that start a
turn fail the cell at that step.
@yansfil
yansfil merged commit e5d9756 into main Oct 21, 2026
78 of 80 checks passed
@yansfil
yansfil deleted the fix/grok-composer-read branch October 21, 2026 17:50
yansfil added a commit that referenced this pull request Oct 21, 2026
Closes #1520

## Summary

On Windows, starting an agent could tie up Hide for minutes, and every
other spawn on the machine was refused `spawn_busy` meanwhile.
Herdr refuses a start while anything besides the shell runs in the pane.
On Windows that means any child process of PowerShell, but Herdr's
process reading (which Hide checks first) only names children that are
agents. So Hide kept seeing "ready" and re-sent the start with no pause:
5,613 times in 30 s for one start on CI, while holding the machine's
spawn lock.

What changes: after Herdr refuses a start as busy, Hide asks again once
every 100 ms inside the same 30 s wait. When the wait ends, it logs
`agent_start` / `pane_busy.timeout` and the spawn answers a new refusal,
`pane_busy`, with nothing typed and a next action: let that program
finish or end it, then run the same command with the same intent, which
starts in the same pane.
A refused spawn in the agent journey now records the processes under the
pane's shell (pid, parent, name), the one record of what held the pane.

스크린샷 없음: no screen changes; the start path, a CLI refusal code and the
journey's evidence.

## Review

- **판단해 주세요**: a new CLI refusal code, `pane_busy`, for a spawn whose
pane Herdr kept refusing. The alternative was the existing
`agent_not_started`, but that one means a start was typed and ended, and
its next action asks for a new intent.
- **조심해서 볼 파일**: `herdr-core/src/agent_start.rs` - the start's wait
loop; the failure path and the spawn lock's hold time (bounded by the
same 30 s, now about 300 Herdr calls at most instead of thousands).
- **조심해서 볼 파일**: `contracts/hide-cli.json` - the contract digest changes
because `agent spawn` gains a refusal.
- **질문**: why PowerShell has a non-agent child for minutes in a
Hide-made pane on Windows is not known yet. The journey's new evidence
names it the next time a spawn is refused.

## Evidence

- **확인한 것**: Windows journey runs 39640248449 (two attempts, Codex then
OpenCode refused) and the Herdr log of attempt 1: one start
(`request_id="spawn-11"`) sent 5,613 `agent.start` calls about 8 ms
apart, all refused. Each journey retry got `spawn_busy` or
`request_timeout` for the whole 150 s.
- **확인한 것**: Herdr v0.9.5's Windows source:
`available_pane_shell_from_snapshot` refuses a shell with any
descendant, while
`select_pane_foreground_job_from_snapshot_with_runtime_inspection`
returns the shell unless a descendant identifies as an agent.
- **확인한 것**:
`a_pane_herdr_keeps_refusing_as_busy_is_asked_once_a_poll_until_the_deadline`
fails without the pause and passes with it; 27 `agent_start` tests, 467
hided lib tests, the hided contract tests, clippy, fmt and the
agent-journey script tests pass.
- **확인한 것**: fake-model journey run
https://github.com/with-hide/hide/actions/runs/39647927197 (head
b403134, with #1517): green on Linux, macOS and Windows; on Windows
all 7 agents pass every declared cell and every spawn answered on its
first try.
- **확인한 것**: in that Windows run Herdr refused no spawn's `agent.start`
(the 10 refused calls are paced wake retries waiting for a name), and
Herdr's log is 133 KB, where one spinning start had filled its 1 MiB
cut.
- **확인하지 못한 것**: this run never met the busy state, so it proves the
lane and no regression, not the paced wait under a held pane; that is
the unit test's claim. Which PowerShell child held the pane before is
still unknown; the new evidence names it if a spawn is refused again.

<details><summary>Verification record</summary>

</details>
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