Skip to content

Session wait endpoint always returns unavailable #33605

Description

@Xiaxinyuuu

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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions