ae13397e5f
A native harness's forwarder mirrors the session one HTTP POST at a
time — a request per transcript item, a request per streamed text
chunk. On loopback that is invisible. From another region it caps the
forwarder at roughly one event per round trip, so a turn that the pane
finished in seconds keeps trickling into the web UI for tens of
seconds.
Add `POST /v1/sessions/{id}/events/batch`, which runs a run of events
through the same handler as the single-post route, in order, and
reports each one's outcome so a caller can advance a durable cursor
over the delivered prefix instead of re-sending events that already
landed. Point the claude-native delta forwarder at it: a poll's chunks
now cost one round trip instead of one each, with a per-event fallback
for deployments older than the route.
At `--network-delay-ms 100`, mirroring one poll of streamed text drops
from ~2.52s to ~0.14s (24 requests to 1); the two new
`forward_native_deltas_*` benchmark journeys are the matched pair that
measures it and guards the regression.
Co-authored-by: Isaac <no-reply@databricks.com>
Signed-off-by: harry-yao_data <harry.yao@databricks.com>