Repository navigation
fix(agent-status): hold a waiting reported mid-turn until the turn ends - #671
Merged
Merged
Conversation
`waiting` is how a turn ends: the agent stops and background work will wake it. An agent that reported it mid-turn (starting a background watch, then carrying on) turned its tab's dot to the hollow `○` at once, and it stayed there for the rest of the turn while the agent kept working. The status hooks already report each turn's start (`working`) and end (`done`, or Claude Code's `waiting`), so the tab now follows the turn (`waiting::turn_open_after`; a question or Claude's idle nudge moves neither way). The agent's own `waiting` sent while a turn is open is held (`waiting::held_for_turn_end`) and becomes the live report when the turn's end arrives, which then meets it through the unchanged precedence in `waiting::meet`, as if reported there. Any newer report from the agent, or Enter in the pane, drops a held wait; an agent leaving a shell tab, or a closed pane, forgets its turn. An agent whose hooks report no turn start never has one open, so its `waiting` applies at once as before. `:why-status` shows a held wait and its note, and the report reads `not applied: held until this turn ends`. Un-ignores #670's two red cases; adds give-way, turn-tracking and `forget_agent` tests. Two functions were extracted to stay inside the function-length ratchet, and `settle_agent_activity`'s pin drops 141 → 139. Co-Authored-By: Claude <noreply@anthropic.com>
DerekMarshall
added a commit
that referenced
this pull request
Oct 15, 2026
Sets the version to `2.2.0-rc.3`, made with `make release-prep VERSION=2.2.0-rc.3`. Only `Cargo.toml` and `Cargo.lock` change. As with the earlier rcs, an rc gets no CHANGELOG section, because the 2.2.0 section covers the whole cycle. ## Why another rc Five changes merged after the rc.2 release run (`v2.2.0-rc.2` was published 2026-10-14 07:40 UTC). Cutting 2.2.0 from `main` now would ship them without a soak: | PR | Change | Why it should soak | |---|---|---| | #670 / #671 | fix(agent-status): a `waiting` reported mid-turn is held until the turn ends | Changes how the activity dot ranks its sources against each other | | #672 | fix(codex): a visible async question earns the red attention dot | Matches what codex draws on screen, verified against codex 0.162.1's default UI | | #673 | feat(agent): the working dot breathes in 16 eased steps at 10 Hz | Visual. A working agent's dot now redraws at 10 Hz instead of 4 Hz. Idle is unchanged. | | #674 | feat(agent-hud): native strip for Antigravity (agy) tabs | A new reader over agy's transcript format | Every open bug issue predates July and none is a regression, so rc.3 is `main` as it stands. `main` stays at `2.2.0-rc.3` through the soak, which runs into next week. **After merge, on `main`:** 1. `make release-tag VERSION=2.2.0-rc.3` 2. Push the tag. `release.yml` verifies the archives reproduce, publishes a GitHub pre-release, and dispatches the Homebrew tap and apt. The crates job publishes `spyc 2.2.0-rc.3` and skips `spyc-vt-sys 0.1.0`, which is unchanged. **Checks:** `make check` passes (the pre-commit gate), and the binary reports `spyc 2.2.0-rc.3 (<sha>)`. Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude <noreply@anthropic.com>
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.
Fixes the bug #670's red cases pin: an agent that reports
waitingmid-turn showed the hollow○at once, and kept showing it while it carried on working.The bug
waitingis how a turn ends: the agent stops, and background work will wake it. I reported it when I started a background watch of the rc.2 release run, then kept working in the same turn. The dot went to○and stayed there for the rest of the turn.:why-statusshowedSELF-REPORT status=waitingwith fresh pane output.The fix
The tab follows the agent's turn. The status hooks already report each turn's start (
working:UserPromptSubmit, agy'sPreInvocation) and its end (done, or Claude Code'swaiting).waiting::turn_open_afteris the pure rule. A question (blocked) or Claude's idle nudge moves neither way.The agent's own
waitingsent while a turn is open is held (waiting::held_for_turn_end). The dot keeps showing the turn. When the turn's end arrives, the held report becomes the live one and meets that end through the unchangedwaiting::meet, as if it had been reported there:Stopwith pending work showswaiting, in the agent's words.Stopwith nothing pending showsdone.Stopcan't say, absorb thatdoneas before.A held wait gives way to anything newer:
forget_agent);Agents without turn hooks are unchanged. An agent whose hooks report no turn start never has an open turn, so its
waitingapplies at once, as before.Diagnostics:
:why-statusshows aheld: waiting … shown once this turn endsline with the note, and the last report readsnot applied: held until this turn ends. The agent'sreport_statusreply says the same.Tests
waitingas the turn ends, not just at the next settle.a_held_wait_gives_way_to_anything_newer, covering a turn end with nothing pending, the agent's newer report, and Enter.shell_agentsunit test thatforget_agentdrops the turn and any held wait.make check-ci:=== GATE: PASS ===, 3,182 library tests.Size ratchet:
apply_status_reporthit 101 lines, sorecord_hook_eventwas extracted.settle_agent_activitygrew past its pin, soforget_closed_agentwas extracted; it ends at 139, and the pin drops from 141 to 139.Docs:
docs/AGENT_ORCHESTRATION.md,FEATURES.md,AGENTS.md.Generated with Claude Code