Files
coder/agent/x/agentacp
Hugo Dutka 7dbbdd62e6 test(agent/x/agentacp): await recovery prompt before cleanup (#31566)
The recovery write-deadline test can finish its message assertions while
the fake harness is still sending session updates, letting cleanup close
the session underneath notification handlers. Wait for the prompt turn
to reach idle after checking the HTTP response, using the existing
`awaitTestSession` helper.

Refs
[CODAGT-1500](https://linear.app/codercom/issue/CODAGT-1500/flake-testapisessionrecoverywritedeadlinemessage).

<details>
<summary>Implementation decision</summary>

Use test-side synchronization rather than allowing the teardown ERROR or
changing production shutdown. The fake harness sends its updates before
its prompt response, and the pinned SDK waits for those notification
callbacks before returning the prompt result. Requiring idle prevents a
failed turn from satisfying the wait. HTTP write-deadline assertions
remain before the wait; production logging and lossless disconnect
draining are unchanged.

</details>

Generated by Coder Agents on behalf of @hugodutka.
2026-10-30 12:43:27 +01:00
..