Skip to content

cttp: stream outbound %progress per chunk via stream flag#1004

Draft
mybropro wants to merge 1 commit into
urbit:developfrom
mybropro:cttp-progress-streaming
Draft

cttp: stream outbound %progress per chunk via stream flag#1004
mybropro wants to merge 1 commit into
urbit:developfrom
mybropro:cttp-progress-streaming

Conversation

@mybropro
Copy link
Copy Markdown

@mybropro mybropro commented Apr 27, 2026

Summary

Implements per-chunk %progress delivery for outbound HTTP requests handled by cttp.

When the iris %request gift arrives with stream=%.y, cttp:

  • fires a %start with empty body and complete=%.n on header receipt (so iris records the response-header)
  • fires a %continue per h2o body callback with the chunk and complete=%.n
  • fires a terminating %continue with empty body and complete=%.y on EOS

Default stream=%.n preserves the existing buffered path — a single %start with the full body and complete=%.y.

Wire-format change

The iris %request gift to the %i driver gains a trailing stream=? field. _cttp_ef_http_client now parses a 3-tuple [num req str] instead of [num req]. This is a coordinated change with urbit/urbit#7342.

VERE_ZUSE bumped 408 → 407 in both pkg/vere/mars.c and pkg/vere/pier.c to match the lull/iris bump.

Cannot land until

The companion arvo PR — urbit/urbit#7342 — is in. This vere PR can be reviewed in parallel but the kelvin assertion will refuse to boot against an unupgraded arvo.

Motivating use case

%llmproxy, an Urbit desk that proxies LLM inference to a local Ollama backend. Ollama streams responses as newline-delimited JSON; without %progress support the node agent must buffer the full response before forwarding anything over Ames.

Test plan

  • Buffered regression — *outbound-config:iris (default stream=%.n) → single %finished with full body, no %progress
  • Streaming — outbound-config:iris(stream %.y)%progress per h2o body callback, then %finished with empty body
  • Verified end-to-end on a fakezod with a local Python chunked HTTP server emitting random hex chunks of varied sizes

Follow-ons

  • %cancel support for in-flight streaming requests (still unimplemented)
  • Non-durable %progress injection (avoid event-log writes on a hot streaming path)

🤖 Generated with Claude Code

Implements per-chunk %progress delivery for outbound HTTP requests.
When the iris %request gift arrives with stream=%.y, cttp fires a
%start with empty body on header receipt, a %continue per body
callback as h2o delivers bytes, and a terminating %continue with
complete=%.y on EOS. Default stream=%.n preserves the existing
buffered path.

Bumps VERE_ZUSE 408 -> 407 to match the lull/iris wire-format
change in urbit/urbit. Cannot land until that PR is in.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant