Agy acp: tool steps are left in WAITING without a tool_call or session/request_permission reaching the client

Version: agy 1.4.12 (agy acp, one process serving several sessions at once). Client: an ACP client that answers every session/request_permission within a few milliseconds.

What happens

  1. Mid-turn, a step is lost. In two sessions, while the session/prompt was still open, the model produced a run_command step. The client never got a tool_call update or a session/request_permission for it. The step stays CORTEX_STEP_STATUS_WAITING in the conversation database. No Stream goroutine exited line is logged, so the prompt never returns, and the client shows the turn running indefinitely.
  2. After a turn, the agent runs on its own. A session’s turn ended normally (Stream goroutine exited ..., sending completion signal, prompt answered with end_turn). A command from that turn had gone async after WaitMsBeforeAsync. When it finished about 1.5 minutes later, agy added a system message ([Message] ... task-N finished with result: ..., MESSAGE_PRIORITY_HIGH) and ran the agent again with no session/prompt open. That run read files and then reached a run_command that needs confirmation. The client got none of these steps, so the step waits forever and the client shows the session as idle.

Log evidence (acp-server log, 1.4.12)

  • Normal step: Monitor sir_flash_lite FINISHED: triggered=false, then within 10 ms Tool confirmation for conversation <A> step 1481 (... approved=true). The client had received that step’s tool_call about 0.2 s after the model response.
  • Lost step: streamGenerateContent at 14:42:37.64, Monitor agy_tool_safety FINISHED: triggered=true, reason="unknown_command", then Monitor sir_flash_lite FINISHED: triggered=false at 14:42:39.06. After that, nothing for conversation <A>: no Tool confirmation and no Stream goroutine exited. Step 1483 is WAITING. Another session on the same process kept getting confirmations at 14:42:29 and 14:42:46, so the client and the pipe were working.
  • Same pattern for conversation <B> (step 1002, monitors finished at 13:57:20.57).
  • After the turn, conversation <C>: Stream goroutine exited at 18:54:16, then [Sonar] Resolved active tags at 18:55:53 with no ACP Request received: session/prompt. Monitors pass at 18:56:09 and step 176 stays WAITING.
  • For comparison, session/cancel works: when a permission was pending, the client’s cancelled answer was logged as approved=false, then Cancelling conversation ..., and the stream exited.

Expected

  • Every step that needs confirmation is sent to the client as tool_call plus session/request_permission while the prompt is open.
  • Work that continues after a background task finishes either happens inside a client prompt or is reported to the client, rather than running unseen and stalling on a confirmation nobody can give.

Repro outline

  1. Start agy acp and open two or three sessions on the one process, with the client auto-approving permission requests.
  2. In each session, have the agent poll a slow command in a loop (for example sleep 6; <status check>, which needs confirmation under unknown_command or unquoted_shell_operators) for 20 to 40 minutes, while it also starts long commands that go async.
  3. Watch for a step that stays WAITING with no Tool confirmation line and no session/request_permission at the client.
  4. For the second issue: end a turn while an async command is still running, wait for it to finish, and check for agent steps logged with no open prompt.

Hi @zzunkie,

Thank you for the detailed report and ACP server logs.

The issue where agy acp deduplicated permission requests by tool call ID—leaving tool steps stuck in WAITING when a step required a second permission check (such as a safety monitor check followed by command confirmation)—has been fixed in Antigravity CLI v1.5.5 (Changelog).

Since your logs are from v1.4.12, please update to v1.5.5 by running agy update (or reinstalling from the CLI installation guide), restart your agy acp server process, and let us know if you still see any steps left in WAITING.