opencode_wait
Wait for sessions or durable jobs to complete, returning completed, failed, or input-required statuses. Manage long waits with resumable timeouts and cancel observation anytime.
Instructions
Wait for a session or durable job. Returns completed, failed, input_required, or a resumable timeout. Cancelling this wait stops observation; use job_cancel or session_abort to stop OpenCode.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| jobId | No | Durable job ID returned by opencode_fire or opencode_run | |
| directory | No | Absolute path to the project directory. When provided, the request targets that project. If omitted, the OpenCode server uses its own working directory. | |
| messageId | No | Submitted user message ID to correlate the exact response | |
| sessionId | No | Session ID (required unless jobId is supplied) | |
| pollIntervalMs | No | Polling interval in milliseconds (default 2000) | |
| timeoutSeconds | No | Maximum seconds to wait (default 120); timeout is resumable |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | ||
| error | No | ||
| jobId | No | ||
| result | No | ||
| status | Yes | ||
| isError | Yes | ||
| directory | No | ||
| messageId | No | ||
| sessionId | No |