OpenCode Output
opencode-outputPage through a turn's full retained answer, tool-call log, structured output, or file diff using offset/limit to read only what's needed without fetching the entire text each call.
Instructions
Page through a turn's full retained answer, tool-call log, structured output, or the OpenCode-reported file diff for that turn. Use detail:"compact" and max-output-chars on opencode/opencode-reply/opencode-status to keep every normal answer small; come back here with the same turn number to read more of it, one page at a time (offset/limit), without paying for the full text on every call — useful together with wait-seconds:0 plus opencode-status ids/wait-for fan-out, reading each turn's full output here only for the ones that need it. Requires exactly one of sessionId, threadId or conversationId, plus turn; section defaults to "answer". Retained output expires (OUTPUT_UNAVAILABLE) and is dropped once opencode-end succeeds, so read what you need before ending the session. Read-only: never mutates OpenCode.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| turn | Yes | The turn number to read (from a prior turn result's `turn` field). | |
| limit | No | How much of this page to return: chars for answer/structured-output/diff-patch (256..20000, default 4000), items for tool-calls/diff-stat (1..100, default 20 for tool-calls, 50 for diff-stat). Also bounded by this server's configured output limit. | |
| offset | No | Where to resume paging from (default 0): a UTF-16 code-unit offset for text sections, an item offset for tool-calls/diff-stat. Use the previous call's nextOffset; offset === total returns an empty final page. | |
| section | No | Which retained artifact to page through (default "answer"): the full final answer text, the tool-call log, the structured-output JSON (when output-schema was used), or the OpenCode-reported file diff for this turn (see diff-view). | |
| threadId | No | Alias for sessionId (Codex-compatible name), same session id value. Exactly one of sessionId, threadId, conversationId is required to target a session; opencode-status may omit all three to list tracked sessions instead. | |
| diff-view | No | Only with section:"diff" (default "stat"): "stat" lists changed files with add/delete counts, "patch" returns one file's patch text (requires file-index). | |
| sessionId | No | Id of a session tracked by this server, from a prior opencode call. Exactly one of sessionId, threadId, conversationId is required to target a session; opencode-status may omit all three to list tracked sessions instead. | |
| file-index | No | Only with diff-view:"patch": which file (by its fileIndex from a prior "stat" page) to read the patch of. | |
| snapshot-id | No | Pins reads to one frozen diff snapshot (required for diff-view:"patch", and for diff "stat" continuation once offset > 0): the id returned by a prior opencode-output diff read. Omit to fetch (or refetch, if the prior snapshot expired) a fresh one. | |
| conversationId | No | Deprecated alias for sessionId, same session id value. Exactly one of sessionId, threadId, conversationId is required to target a session; opencode-status may omit all three to list tracked sessions instead. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cost | No | ||
| diff | No | ||
| hint | No | ||
| kind | Yes | ||
| turn | No | ||
| agent | No | ||
| error | No | ||
| model | No | ||
| roots | No | ||
| total | No | ||
| action | No | ||
| agents | No | ||
| finish | No | ||
| models | No | ||
| offset | No | ||
| output | No | ||
| reason | No | ||
| server | No | ||
| status | Yes | ||
| tokens | No | ||
| turnId | No | ||
| cleanup | No | ||
| content | Yes | ||
| hasMore | No | ||
| partial | No | ||
| request | No | ||
| results | No | ||
| section | No | ||
| waitFor | No | ||
| readyIds | No | ||
| sessions | No | ||
| threadId | No | ||
| warnings | No | ||
| directory | No | ||
| elapsedMs | No | ||
| sessionId | No | ||
| toolCalls | No | ||
| truncated | No | ||
| nextOffset | No | ||
| observedAt | No | ||
| pendingIds | No | ||
| snapshotId | No | ||
| availability | No | ||
| filesChanged | No | ||
| resendSafety | No | ||
| responseLoop | No | ||
| upstreamRead | No | ||
| omittedFields | No | ||
| toolCallCount | No | ||
| upstreamRetry | No | ||
| executionState | No | ||
| opencodeVersion | No | ||
| pendingApprovals | No | ||
| structuredOutput | No | ||
| filesChangedCount | No | ||
| abortedRunningTurn | No | ||
| pendingApprovalCount | No | ||
| structuredOutputError | No | ||
| structuredOutputStatus | No |