Repository navigation
Fix interrupted managed responses and safe recovery - #4471
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Deploying openwork with
|
| Latest commit: |
0617f87
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://1a8628d3.openwork.pages.dev |
| Branch Preview URL: | https://codex-reliable-managed-infer.openwork.pages.dev |
5f5d053 to
082e623
Compare
082e623 to
28e5b32
Compare
There was a problem hiding this comment.
Warden security clearance: clear. No blocking findings (security or desktop↔den sync) in this diff (28e5b32191030198cbd04f17a5a950b931226a6d). Automated clearance satisfies the required-review gate only — a human still reviews and merges. Analysis run
28e5b32 to
0835e5b
Compare
0835e5b to
12037b0
Compare
0617f87 to
4911042
Compare
There was a problem hiding this comment.
Warden security clearance: clear. No blocking findings (security or desktop↔den sync) in this diff (491104223666c717af335d54b96ae35895888ea3). Automated clearance satisfies the required-review gate only — a human still reviews and merges. Analysis run
4911042 to
82bfcf9
Compare
There was a problem hiding this comment.
Warden security clearance: clear. No blocking findings (security or desktop↔den sync) in this diff (82bfcf9393109062d6c0d9b80c31f6bad5e60787). Automated clearance satisfies the required-review gate only — a human still reviews and merges. Analysis run
82bfcf9 to
49b985e
Compare
Test evidence — managed-responses-preserve-completion-partial-work-and-cancellation — ✅ passedSHA 49b985e · engine v1 ✅ passed · 11 expectations passed · 0 failed · 0 pending
verdict passed · 0 user observations · 0 probes · steps 0/0 ℹ️ ASSERTION — 1. Successful responses retain text and final usage onceThe real gateway preserves fragmented UTF-8, final usage including a repeated terminal choice, one completion marker, and the server-assigned request identity.
ℹ️ ASSERTION — 2. The first response frame survives arbitrary transport splitsHeartbeat-free JSON, UTF-8, delimiter and bytewise splits match the unsplit response: text, reasoning, tool fragments and usage remain intact, with one attempt and one DONE.
ℹ️ ASSERTION — 3. Request settings and tool-error history are not rewrittenThe gateway retains the chosen model, reasoning, routing preferences, transforms and output limits, including malformed historical arguments followed by their matching tool error. It does not substitute defaults or impose a new request contract.
ℹ️ ASSERTION — 4. Token-limit endings are not confused with broken transportStreaming and JSON length endings retain incomplete tool arguments, the provider's terminal reason and usage. The tool consumer, not the transport relay, decides whether a tool can execute.
ℹ️ ASSERTION — 5. Requested completion choices are preserved in both protocolsA controlled provider honoring n=2 returns both choices through JSON and SSE, including interleaved terminal choices, without retries. This proves relay compatibility, not live-provider support for n.
ℹ️ ASSERTION — 6. Broken and idle streams preserve only valid partial outputPremature EOF, malformed frames and unrequested choices emit an error without DONE. Idle streams time out at the gateway before the independent client deadline, including a first frame with no complete output.
ℹ️ ASSERTION — 7. Transport progress does not require visible model outputA provider sending heartbeats continues beyond three idle periods and then completes; only lack of transport progress triggers the stream-idle timeout.
ℹ️ ASSERTION — 8. Cancellation closes upstream before idle expiryClient abort closes the real provider connection within 700 ms of the abort instant, before the 1000 ms idle deadline, both before any downstream bytes and after partial text. No completion or second attempt is produced.
ℹ️ ASSERTION — 9. Timeout and provider failures remain safe and distinguishableReal slow headers and JSON bodies produce upstream_timeout, malformed/unfinished JSON has separate categories, provider failures preserve HTTP status and Retry-After, and every case makes one generation attempt.
ℹ️ ASSERTION — 10. The real engine persists successful tools and interrupted workWith a baseline model configuration, OpenCode executes Read once and persists its result. Premature provider EOF persists a session error beside partial text, verified by transcript readback, and leaves the busy state. This is not catalog-delivery or billing proof.
ℹ️ ASSERTION — 11. The existing routing boundary and content-free diagnostics remain intactInvalid credentials, unknown models, alternate-model selection and a freshly DPA-blocked organization do not reach upstream. Real service stdout/stderr excludes fixture prompt, private provider error, member bearer and provider credential sentinels; structured reporter behavior has separate supporting tests.
Test run created 2026-09-08T20:16:33.937Z · Source: |
There was a problem hiding this comment.
Warden security clearance: clear. No blocking findings (security or desktop↔den sync) in this diff (49b985e3d109bfac8be4f8f0e97eb625ad3b154e). Automated clearance satisfies the required-review gate only — a human still reviews and merges. Analysis run
Purpose
An interrupted managed AI response must not appear complete. Preserve partial work,
propagate cancellation and return safe diagnostics without changing accounting or
model settings.
Current scope and conflict resolution
Rebased on
dev@0857e81d897b97bc7b10b35c0b2193ec3328dab3at signed head49b985e3d109bfac8be4f8f0e97eb625ad3b154e.and immediately before dispatch. A late policy denial cleans up the timeout,
cancellation listener and optional analytics without contacting the provider.
errors, completion-aware analytics and preserved provider usage/terminal reasons.
arguments; requested choice counts work consistently. No gateway replay, model
substitution, forced reasoning settings or hidden-output deadline.
diagnostics. Existing role/count/correlation information remains available.
UI test-hook changes were dropped. This PR now changes 13 files, with no
schema, ledger, catalog, provider-materialization or SDK changes.
Verification — Passed
Passed on the exact head:
pnpm evals:pr specs/managed-inference.test.ts—1 real gateway/server/OpenCode journey, 11 assertion records, 0 failures, 0 skips,
exit 0. The explicit PR runner is local and does not print the E2E placement banner.
The updated journey verifies a freshly DPA-blocked organization produces no upstream
request, alongside completion, fragmentation, timeouts, cancellation, request
preservation and transcript readback. Generation is a controlled loopback fixture.
Supporting checks: 67 proxy tests passed after conflict resolution, including
the current DPA tests and response/analytics tests. Existing model-maintenance
validation and prior inference build/Desktop type checks passed. Exact-head CI is
green, including core tests, packaged Desktop smoke, service builds and required
checks; GitHub reports MERGEABLE / CLEAN and approved. Conditional unselected jobs
are not counted as passes.
Historical UI and packaging checks passed on an earlier reduced revision. They are
not relabeled as current-head proof; the production recovery renderer is now
unchanged from dev. Live provider performance, production provisioning and broadcasts
remain unverified. No merge, release or deployment is performed.
Follow-ups
The earlier broad proposal at
0617f87ais superseded:Strict-budget work is excluded at the requester's direction. Neither follow-up is
required to land this transport fix. Shared proxy surfaces must be reconciled when
the accounting follow-up lands.
Details:
docs/managed-response-reliability.md.