sandbox-agent/research/specs/event-stream-parity.md
2026-02-04 13:45:31 -08:00

23 lines
966 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Spec: Event Stream Parity
**Proposed API Changes**
- Ensure all core session manager events map to OpenCodes expected event types and sequencing.
- Provide structured, ordered event delivery with backpressure handling.
**Summary**
OpenCode relies on SSE event streams for UI state. We need full parity in event ordering, types, and payloads, not just message/part events.
**OpenCode Endpoints (Reference)**
- `GET /opencode/event`
- `GET /opencode/global/event`
**Core Functionality Required**
- Deterministic event ordering and replay by offset.
- Explicit `session.status` transitions (busy/idle/error).
- `message.updated` and `message.part.updated` with full payloads.
- Permission and question events with full metadata.
- Error events with structured details.
**OpenCode Compat Wiring + Tests**
- Replace partial event emission with full parity for all supported events.
- Add E2E tests that validate event ordering and type coverage in SSE streams.