Problem
The v2 session wait endpoint is exposed as:
POST /api/session/:sessionID/wait
Its OpenAPI description says it waits for a session agent loop to become idle. However, the current SessionV2.wait() implementation returns OperationUnavailableError, so the endpoint always responds with 503 ServiceUnavailableError for an existing session.
Expected behavior
For an existing session:
- return
204 immediately when the session is already idle
- wait for active local execution to finish before returning
204
Actual behavior
SessionV2.wait() reports the operation as unavailable, so the public endpoint cannot be used by clients or tests that need to wait for a prompt run to settle.
Proposed fix
Wire SessionV2.wait() to the local session execution coordinator instead of treating it as unfinished.
Problem
The v2 session wait endpoint is exposed as:
POST /api/session/:sessionID/waitIts OpenAPI description says it waits for a session agent loop to become idle. However, the current
SessionV2.wait()implementation returnsOperationUnavailableError, so the endpoint always responds with503 ServiceUnavailableErrorfor an existing session.Expected behavior
For an existing session:
204immediately when the session is already idle204Actual behavior
SessionV2.wait()reports the operation as unavailable, so the public endpoint cannot be used by clients or tests that need to wait for a prompt run to settle.Proposed fix
Wire
SessionV2.wait()to the local session execution coordinator instead of treating it as unfinished.