Skip to content

feat: mid-stream continuation plumbing — strict completions knobs + c… - #1445

Draft
hachall wants to merge 1 commit into
mainfrom
feat/continuation-plumbing
Draft

feat: mid-stream continuation plumbing — strict completions knobs + c…#1445
hachall wants to merge 1 commit into
mainfrom
feat/continuation-plumbing

Conversation

@hachall

@hachall hachall commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

…ontinuation key purpose

Two mechanical prerequisites for the resume middleware:

Strict onwards completions schema gains the generation-control fields a token-id resume replay needs: ignore_eos, min_tokens, stop_token_ids, skip_special_tokens, include_stop_str_in_output. The strict router previously dropped these on re-serialization, silently breaking resume semantics on the prod (strict) path. Round-trip + absent-by-default tests included; token-id prompt forms already supported.

ApiKeyPurpose gains Continuation: a hidden per-user key purpose (like batch/playground) the resume middleware will issue continuation legs on. The purpose is what model_traffic_rules keys on to steer resume traffic to a model's continuation deployment; it also authenticates the internal request through onwards and carries per-key rate limits as a resume throttle. Wired through is_inference_purpose + both onwards key-sync SQL mirrors, hidden-key creation, tariff purpose mapping, and the manual-key- creation guard (reserved for internal use, like batch/playground). No migration needed: purpose columns are VARCHAR throughout.

.sqlx cache regenerated (workspace, PG18) for the touched sync queries.

@hachall
hachall requested a review from Copilot August 5, 2026 21:45

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review this pull request because it exceeds the maximum number of files (300). Try reducing the number of changed files and requesting a review from Copilot again.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Aug 5, 2026

Copy link
Copy Markdown

Deploying control-layer with  Cloudflare Pages  Cloudflare Pages

Latest commit: 02a5ca3
Status: ✅  Deploy successful!
Preview URL: https://5eb97178.control-layer.pages.dev
Branch Preview URL: https://feat-continuation-plumbing.control-layer.pages.dev

View logs

…ontinuation key purpose

Two mechanical prerequisites for the resume middleware:

Strict onwards completions schema gains the generation-control fields a
token-id resume replay needs: ignore_eos, min_tokens, stop_token_ids,
skip_special_tokens, include_stop_str_in_output. The strict router
previously dropped these on re-serialization, silently breaking resume
semantics on the prod (strict) path. Round-trip + absent-by-default tests
included; token-id prompt forms already supported.

ApiKeyPurpose gains Continuation: a hidden per-user key purpose (like
batch/playground) the resume middleware will issue continuation legs on.
The purpose is what model_traffic_rules keys on to steer resume traffic to
a model's continuation deployment; it also authenticates the internal
request through onwards and carries per-key rate limits as a resume
throttle. Wired through is_inference_purpose + both onwards key-sync SQL
mirrors, hidden-key creation, tariff purpose mapping, and the manual-key-
creation guard (reserved for internal use, like batch/playground). No
migration needed: purpose columns are VARCHAR throughout.

.sqlx cache regenerated (workspace, PG18) for the touched sync queries.
@hachall
hachall force-pushed the feat/continuation-plumbing branch from 9c51643 to 02a5ca3 Compare August 5, 2026 21:56
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