Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions docs/deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -396,8 +396,14 @@ Application-level safeguards:
`GET /v1/tasks/{task_id}:subscribe`
- service subscribes to OpenCode `/event` stream and forwards filtered
per-session updates
- stream emits incremental `TaskArtifactUpdateEvent` with channel metadata
(`reasoning` / `tool_call` / `final_answer`)
- stream emits incremental `TaskArtifactUpdateEvent` on a single artifact
with `opencode.block_type` metadata
(`text` / `reasoning` / `tool_call`) and monotonic `opencode.sequence`
- routing is schema-first via OpenCode `part.type` + `part_id` state, not
inline marker parsing
- `message.part.delta` may arrive before `message.part.updated`; the service
buffers those deltas and replays them when the part state is available
- structured `tool` parts are emitted as `tool_call` block updates
- events without `message_id` are discarded to avoid ambiguous correlation
- final snapshot is emitted only when stream chunks did not already produce
the same final answer; stream then closes with `TaskStatusUpdateEvent(final=true)`
the same final text; stream then closes with `TaskStatusUpdateEvent(final=true)`
14 changes: 11 additions & 3 deletions docs/guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,18 @@ This guide covers configuration, authentication, API behavior, streaming re-subs
- Streaming (`/v1/message:stream`) emits incremental
`TaskArtifactUpdateEvent` and then
`TaskStatusUpdateEvent(final=true)`. Stream artifacts carry
`artifact.metadata.opencode.channel` with values
`reasoning` / `tool_call` / `final_answer`. Events without
`artifact.metadata.opencode.block_type` with values
`text` / `reasoning` / `tool_call`. All chunks share one stream
artifact ID and preserve original timeline via
`artifact.metadata.opencode.sequence`. Events without
`message_id` are dropped. A final snapshot is only emitted when stream
chunks did not already produce the same final answer text.
chunks did not already produce the same final text.
Stream routing is schema-first: the service classifies chunks primarily by
OpenCode `part.type` (plus `part_id` state) rather than inline text markers.
`message.part.delta` and `message.part.updated` are merged per `part_id`;
out-of-order deltas are buffered and replayed when the corresponding
`part.updated` arrives. Structured `tool` parts are emitted as `tool_call`
blocks with normalized state payload.
Non-streaming requests return a `Task` directly.
- Requests require `Authorization: Bearer <token>`; otherwise `401` is
returned. Agent Card endpoints are public.
Expand Down
Loading
Loading