Repository navigation
fix(agent-status): keep a finished turn done when the agent reports an approval at idle - #32015
Conversation
… ends; a missed turn's block takes the row at once
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ➖ Normal Merge Risk: ⚪ Minimal · up to
|
|
Thanks for fixing my issue! |
ELI5
When an Antigravity turn writes a file,
agyfinishes and goes back to its idle prompt, but then tells the terminal "approve plan" for its review footer. Orca believed it. The finished row showed "Needs approval", and two minutes later turned into "Waiting for input - Approve plan". Now a finished turn stays finished, and real approval prompts still show.What Changed
Before: after
agy's Stop hook marked the rowdone,agy's OSC 7501 reportblocked:kind=permission:msg=Approve planarrived about 200ms later.donewithwaiting"Approve plan", which turned the card, the dot and the tab orange.After: the row stays
donewith no attention, however long the session sits idle.Mechanism:
hook-precedence.ts):programStatusHookYieldEndsAtnow returns when an OSC 7501 projection stops yielding to the hook row, instead of a yes/no answer evaluated twice. After a hook-settleddone, hook silence is normal, so an approval or question from the program yields for good. It wins only once the program has reported new work since the Stop (a turn the hooks missed). In that case it takes the row at once.facet-store.ts,noteState): records when the program last enteredworking. It reads the lifecycle reports in byte order, not the chunk's net facet, so aworkingfollowed by a block in one chunk still counts. A record removal counts as a turn boundary.presentation.ts, shared by the sidebar, dashboard andorca worktree ps): an approval or question facet only raises attention on a running row. Sign-in and unnamed blocks still show on a finished row, as before. The dashboard's own blocked-row line now applies only toblockedrows.Why
The facts were combined in the wrong place. The hook-silence rule assumed silent hooks are stale, but after a Stop they are silent by design. The fix sits in the precedence rule every OSC 7501 agent goes through (Claude Code, Codex, Grok, pi, omp, agy), with no Antigravity string match.
I considered setting
AGY_CLI_OSC7501=offin Antigravity panes and decided against it. The protocol design keeps OSC 7501 alongside hooks on purpose, as a facet for sign-in, progress and messages, and as the fallback when hooks are off or missing on an SSH host. Turning it off for one agent would lose that, and the next OSC 7501 agent with a post-turn block would hit the same bug.Linked Issue
Fixes #31548
Fixes #31547
Linear: STA-11569
Visual Proof
Hidden dev builds of
mainand this branch, side by side. In a terminal pane, a script replaysagy's wire using the pane's own hook env: PreInvocation hook, OSC 7501working, Stop hook, then 200ms later the exact OSC 7501 bytes from the issue. Each build is captured right after the sequence and again about 2m10s later.Testing
agywire as above;agyitself isn't installed here)Regression tests in
server-program-status-hook-yield.test.tsgo through the realAgentHookServer. Each one fails without its part of the fix:donewith no attention.workingand an approval in one chunk take the row at once.The precedence unit suite moved to the new return value. A dashboard test pins that a done row shows no approval line.
Review
Agent skill upstream boundary
Notes
orca serve: all hosts run the sameAgentHookServeringest, so the fix applies wherever OSC 7501 is projected.stateonly. It no longer sees the falsewaiting.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)