Repository navigation
fix: ask Herdr again once a poll when it refuses a start as busy - #1521
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1520
Summary
On Windows, starting an agent could tie up Hide for minutes, and every other spawn on the machine was refused
spawn_busymeanwhile.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.timeoutand 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
pane_busy, for a spawn whose pane Herdr kept refusing. The alternative was the existingagent_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 becauseagent spawngains a refusal.Evidence
request_id="spawn-11") sent 5,613agent.startcalls about 8 ms apart, all refused. Each journey retry gotspawn_busyorrequest_timeoutfor the whole 150 s.available_pane_shell_from_snapshotrefuses a shell with any descendant, whileselect_pane_foreground_job_from_snapshot_with_runtime_inspectionreturns the shell unless a descendant identifies as an agent.a_pane_herdr_keeps_refusing_as_busy_is_asked_once_a_poll_until_the_deadlinefails without the pause and passes with it; 27agent_starttests, 467 hided lib tests, the hided contract tests, clippy, fmt and the agent-journey script tests pass.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.Verification record