hh 823337409a feat(claude): expose the headless stream-json transport, with real streaming
`ClaudeCodeOptions.transport="stream_json"` runs the agent on `claude -p`
with stream-json on both pipes instead of driving the TUI through a
pseudo-tty. Opt-in: the default stays `pty`, so nothing moves until a
config asks for it.

The reason to ask for it is that the PTY path pays a multi-second
readiness wait before every spawn and can silently lose a prompt to a
swallowed paste; the headless path writes to a pipe and gets a native
`result` record back. `--remote-control` and friends are dropped by the
transport when set, since they'd take claude out of print mode.

`include_partial_messages` then gives clients genuine token-level SSE.
Blocks are emitted from the `StreamEvent`s rather than forwarded raw:
the payload is already Anthropic-shaped but arrives as a dict, so it
would need validating against the SDK union anyway, and rebuilding it
through our own builders drops an unrecognized block or delta type the
same way `_emit_block` already does instead of raising mid-stream on a
claude release that adds one. When streaming, the whole-block records
are kept for TurnCapture but not re-emitted — that would duplicate every
block on the wire.

Verified end-to-end against a live claude: both paths accumulate to the
identical Message (same blocks, same stop_reason, same usage), the
envelope stays 1:1, and block indices stay collision-free across a turn
that spans several API requests.
2026-07-28 03:00:10 +02:00
2026-05-20 21:30:10 +02:00
2026-05-19 14:19:15 +02:00
2026-05-20 13:00:08 +02:00
2026-05-19 11:26:47 +02:00
2026-05-20 21:30:10 +02:00
2026-05-20 13:00:08 +02:00
2026-05-19 11:27:28 +02:00
2026-05-19 11:26:47 +02:00
2026-05-19 11:26:47 +02:00
S
Description
Agentic registry, gateway and head of operations for Beaver agent
Readme
997 KiB
Languages
Python 86.9%
HTML 12.4%
Dockerfile 0.7%