Skip to content

Update Cloudflare Deployment guide#3

Closed
nicosuave wants to merge 1 commit into
Query-farm:mainfrom
nicosuave:patch-1
Closed

Update Cloudflare Deployment guide#3
nicosuave wants to merge 1 commit into
Query-farm:mainfrom
nicosuave:patch-1

Conversation

@nicosuave
Copy link
Copy Markdown

I work with Cloudflare infrastructure a decent amount and Cloudflare Containers are definitely what you want here!

I work with Cloudflare infrastructure a decent amount and Cloudflare Containers are definitely what you want here!
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Feb 22, 2026

CLA assistant check
All committers have signed the CLA.

@nicosuave nicosuave closed this Feb 24, 2026
rustyconover added a commit that referenced this pull request Apr 28, 2026
Three related cleanups, finishing the symmetry between init and
exchange paths and between producer and exchange shapes.

#1: producer continuations now populate the access log's response_state.
``_run_http_producer_turn`` is refactored to take an ``outcome:
_DispatchOutcome`` parameter and mutate it directly (matching
``_run_http_exchange_turn``'s pattern), instead of returning a
``(buf, error_type, error_message)`` tuple that the caller bridged
into outcome by hand.  When the loop mints a continuation token it now
sets ``outcome.response_state_bytes = state_bytes`` — closing a real
telemetry gap where producer-continuation access-log records were
missing the issued state's bytes.

#3: drop the auth/transport_metadata contextvar fallback inside
``_run_http_producer_turn``.  Both call sites now pass them
explicitly; the helper signature requires ``auth: AuthContext`` and
``transport_metadata: Mapping[str, Any]`` (no defaults, no fallback).
Removes one redundant ``_get_auth_and_metadata()`` call per producer
continuation and matches the explicit-parameter pattern we already
established for ``stream_id``.

#2: split the init dispatcher's producer/exchange branches into
``_run_http_producer_init`` and ``_run_http_exchange_init``, mirroring
``_run_http_producer_turn`` / ``_run_http_exchange_turn`` on the
exchange-sync side.  ``_run_stream_init_sync`` is now a thin router:

    _run_stream_init_sync
    ├─ result.input_schema == _EMPTY_SCHEMA  → _run_http_producer_init
    └─ else                                  → _run_http_exchange_init

Each helper owns its own header-write + body-shape logic; the
dispatcher is just request validation, ctx injection, stream_id
generation, and the telemetry shell wrapping the impl call.

Verification:

* ruff format / ruff check / mypy / ty: clean.
* HTTP conformance against regular worker: 97 pass / 4 skip.
* HTTP conformance against strict-cap worker: 99 pass / 2 skip.
* Full pytest: 2986 passed.

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.

2 participants