Repository navigation
fix: answer agent and workspace commands with what happened - #2322
Merged
Merged
Conversation
hide agent show took only an id, so a name, a pane or an id without its agent- prefix fell through to agent_unavailable with the generic advice to retry the same intent. It now takes a name or a pane as a letter names its recipient, answers the live registration or else the last that ended there as ended, and a key that names nothing says how agents are named instead of asking for a retry. hide agent list --live leaves out ended registrations; a plain list answers as before. Closes #2299 Closes #2303
Once Git reported the worktree removed, a readback of git worktree list that failed (as on a nearly full disk) was answered worktree_remove_stopped with a worktree said to remain, though the folder was gone. The folder on disk now decides when the list cannot be read. Closes #2296
A pane's program runs before its holder writes that it does, so a program that calls hide at once was refused pane_not_found. The pane caller's proof now waits for a start under way, at most PROOF_START_WAIT (500 ms, under the shortest hook budget), and answers a pane still starting pane_starting. Closes with-hide/hide-private#719
The test asked the node's holders directly, so it passed with the host's wait taken out. It now asks the host's answer to a pane's caller (the path Call::PaneInspect takes) over a held holder: a held start is answered pane_starting after PROOF_START_WAIT, and a start released once the node logged that the ask waits is proved by the program its record names. The node logs pane.proof.start_wait when a proof waits, and the test hold gives up after 30 s.
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 #2299
Closes #2303
Closes #2296
Closes with-hide/hide-private#719
Related: #2312 (carries the fix for #2297)
Summary
Four commands gave a wrong answer; each now says what actually happened.
hide agent showgiven an ended agent's name or pane saidagent_unavailablewith "retry the same intent". It now finds that agent and shows it ended. A key that matches no agent gets a message that says how to find one, and no longer suggests a retry.hide agent list --livelists only running agents. Plainhide agent liststill prints every agent, so existing callers keep working.hide workspace removesaidworktree_remove_stopped("worktree remains") when Git had removed the worktree but its list could not be read afterwards (a full disk). If the folder is gone, it now answers that the worktree was removed.hidecall, made before its holder had recorded that the program was running, was refusedpane_not_found. The call now waits for that start to finish.Real CLI on an isolated candidate hided, after its one registered agent
agent-1(journey-controller, paneh1:p1) ended:Review
hide agent listprints every agent that ever ran (758 KB here) #2303 is solved with an opt-in--liveswitch rather than by changing whatlistprints. Dropping ended agents from the default would silently change the output of scripts and agents that readlist --jsonto find an ended child's result; a switch adds the short form without breaking them.showpicks the running one. With two running agents, it answerstarget_ambiguous. With only ended ones, it picks the newest (coordination::shown_record, pinned byan_agent_that_ended_is_shown_ended_by_its_id_name_or_pane).hide_node_link::holders::PROOF_START_WAIT(500 ms), not the start's own 10 s limit, because every hook proves its pane through this path. 500 ms is under half the shortest hook budget (MEMORY_BUDGET, 1.25 s), and far longer than the gap between the holder starting the program and writing that it runs. A pane still starting after that answerspane_startingwith "run the same command again in a moment"; a pane whose program ended answerspane_not_running; neither sayspane_not_foundany more.hide agent spawnis sometimes refused withpane_request_refused, and the same command then works #2297 is not fixed here: its cause is the same as fix: share pane requests when waking after an update #2312's. A node renewal took its request number from the node's own counter, so the core's next creation reused a number and read "the pane request has already finished". In the operator's log, 3 renewals were followed by 3 refused creations, and the 4th creation passed. fix: share pane requests when waking after an update #2312 owns the fix and closeshide agent spawnis sometimes refused withpane_request_refused, and the same command then works #2297.hide-host/src/panes.rs- failure path and the hooks' path: every pane caller's proof runs here (bootstrap, stream open,Call::PaneInspect).hide-host/src/worktrees.rs- failure path. Only the case where Git said removed and its list then failed now trusts the folder. The case where Git said it failed still reads remains unless both list and folder say gone.hide-core/src/coordination/mod.rs-shown_recordreads the ledger under the runtime lock: one pass over the agents, no I/O.reserved/preparingadds three things: one diagnostic line (pane.proof.start_wait, pane id and wait only, written through the node's log sink), one condition-variable wait on the node's start table, and a second record read.runningcosts each hook call 500 ms, not 10 s.list --livefilters in the same single pass over the ledger.Evidence
hide agent showon an ended agent says to retry instead of saying it ended #2299,hide agent listprints every agent that ever ran (758 KB here) #2303:an_agent_that_ended_is_shown_ended_by_its_id_name_or_panechecks id, name and pane for one ended agent. It also checks a newer ended agent with the same name, a running agent beside them, and an unknown key.every_answer_reads_a_sleeping_agent_asleep_and_running_once_it_wakeschecks thatlist --livedrops ended agents. The CLI parse test anda_missing_agent_pane_names_where_to_run_the_commandpin the switch and the new message, andthe_committed_contract_is_the_exported_onepasses on the regenerated contract.hide agent showon an ended agent says to retry instead of saying it ended #2299,hide agent listprints every agent that ever ran (758 KB here) #2303 live: the block above came from the agent journey's own isolated runtime (private HOME, state in a new temp folder, the candidate's debughided/hide/hide-holder), with a stand-in agent registered in a real pane. Teardown confirmed no candidate process or folder left.hide workspace removesays the worktree remains, but it was removed #2296:a_removal_git_made_is_removed_when_its_readback_cannot_list_worktreesuses a stand-ingitwhoseworktree listfails withfatal: unable to write new index fileonce the folder is gone. Without the fix it fails withErr(Stopped { stop: StateUnreadable, .. "The worktree remains" }); with the fix it passes, and the folder is gone and unlisted.a_program_that_asks_before_its_record_says_running_is_proved_once_it_doesholds a real holder inpreparing(HIDE_HOLDER_TEST_HOLD_RUNNING) and asks the host's answer to a pane's caller,hide_host::panes::Panes::inspect. That is the functionCall::PaneInspectruns; it is not an end-to-end run of a hook's bootstrap.pane_startingafter at leastPROOF_START_WAITand well underSTART_LIMIT.holders.proof(pane_not_foundinstead ofpane_starting), and the node's wait taken out (the held ask returns at once). The final head passes the same filtered test.cargo clippy --all-targets -D warningson hide-core, hided, hide-host, hide-node, hide-node-link and hide-holder is clean, and rustfmt has been applied.hide workspace removesays the worktree remains, but it was removed #2296's full disk and private#719's race were reproduced only in tests (stand-in Git, a held holder), not on a live machine. TEMP: issue 707 processes left in the folder when the close wait ends, before the fix (do not merge) #719 on a connected device's node uses the same code but was not run on a device.hide agent spawnis sometimes refused withpane_request_refused, and the same command then works #2297 has no test here, since fix: share pane requests when waking after an update #2312 carries its fix.Verification record
f859661a0b79, head4bfb912e0499an_agent_that_ended_is_shown_ended_by_its_id_name_or_pane,every_answer_reads_a_sleeping_agent_asleep_and_running_once_it_wakes; hided: agent CLI parse test,a_missing_agent_pane_names_where_to_run_the_command,the_committed_contract_is_the_exported_one: passa_removal_git_made_is_removed_when_its_readback_cannot_list_worktreespass; fails on the unfixedworktrees.rsa_program_that_asks_before_its_record_says_running_is_proved_once_it_doesat the host boundary: defect (a), host back toholders.proof, fails withleft: Err("pane_not_found") right: Err("pane_starting"); defect (b), node wait removed, fails withthe held start was waited for 225.292µs; final head, clean tree: PASS-D warningson hide-holder and hide-node after the test change: clean;cargo hakaricheck: no operations;cargo fmt --all --check: clean--all-targets -D warningson the six changed crates: clean