Skip to content

fix: ask Herdr again once a poll when it refuses a start as busy - #1521

Merged
yansfil merged 3 commits into
mainfrom
fix/start-pane-busy
Oct 21, 2026
Merged

yansfil merged 3 commits into
mainfrom
fix/start-pane-busy

Conversation

@yansfil

@yansfil yansfil commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

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 fix: read Grok's suggestion and Windows marker as an empty composer #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.
Verification record

Herdr refuses agent.start as agent_pane_busy while anything besides the
shell runs in the pane; on Windows that is any child process of the shell,
which pane.process_info does not name unless it is an agent. Hide's reading
kept saying ready, so the start re-sent agent.start with no pause until its
30 s wait ended: 5,613 refusals in one start on Windows CI, while the spawn
held the machine's spawn lock and every retry of the same intent answered
spawn_busy. The start now asks again once every 100 ms inside the same wait,
logs pane_busy.timeout when it ends, and a spawn so refused answers
pane_busy with nothing typed and a next action to retry the same intent.
A refused spawn's evidence now lists the processes below the pane's shell
by pid, parent and name, the one record of what made Herdr refuse the pane
as busy, since Herdr's process_info names no child that is not an agent.
@yansfil
yansfil merged commit 242aed3 into main Oct 21, 2026
57 checks passed
@yansfil
yansfil deleted the fix/start-pane-busy branch October 21, 2026 18:33
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.

Flaky check: an agent journey start on Windows is refused spawn_busy while its first start loops on agent_pane_busy

1 participant