You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 1bbb63b
Browse filesBrowse the repository at this point in the historyBrowse files
fix(responses): strip output-only reasoning status unconditionally
The cross-backend fix kept `status` on any reasoning item that forwarded its
`encrypted_content`, to honour "an item whose blob is forwarded is not
otherwise modified". That invariant was defensive rather than observed, and
it broke the cold-record recovery path.
With no provenance record — after a restart, TTL expiry or eviction — the
blob is retained, so `status` is retained too, and OpenAI rejects the request
on the field before it ever validates the blob:
400 Unknown parameter: 'input[1].status'.
The opaque-blob recovery correctly does not match that error, so the
conversation stayed broken.
Measured against the live backends:
- OpenAI never mints `status` on a reasoning item (keys are content,
encrypted_content, id, summary, type), so the retain branch could only ever
fire for an item minted elsewhere — the exact item OpenAI then rejects. It
never protected an OpenAI-minted item.
- Grok accepts its own 1707-char blob with `status` removed: 200.
- With `status` removed, that same item replayed to gpt-5.6-sol returns 200
and the usage log records sendCount=2,
recoveryKinds=['opaque-blob-rejection'] — removing the field is what lets
the request reach the blob check the recovery is armed for.
The `content` rule is untouched: blanking predates this and is required by
ChatGPT's input contract.
Co-Authored-By: Claude Fable 5 <[email protected]>
Copy file name to clipboardExpand all lines: structure/04_transports-and-sidecars.md
+19-17Lines changed: 19 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -549,20 +549,22 @@ replays are explicit and receive the same repair.
549
549
These compatibility guards are covered by focused tests and should stay close to the adapters that
550
550
need them.
551
551
552
-
Responses passthrough keeps output-only `status` on any `reasoning` input item that retains opaque
553
-
`encrypted_content` because OpenAI-operated backends may bind the blob to that field. The established
554
-
raw-`content` rule remains separate: ChatGPT accepts reasoning input only with empty `content`, so a
555
-
native blob plus raw content keeps the blob and `status` but still blanks `content`. That shape is a
556
-
known unresolved contract conflict, not evidence that either existing rule is safe to broaden. The
557
-
blob is kept unless the in-process thread record proves that the current provider, destination,
558
-
adapter, model, or credential differs from the route recorded for the prior request on that client
559
-
thread. On a proven change the blob and `status` are removed while the reasoning item and its summary
560
-
survive; `status` is also removed from blobless reasoning items. Missing, expired, or evicted identity
561
-
state is unknown. The comparison uses the durable destination and credential identities with the
562
-
provider, adapter, and model, so OAuth token-generation refreshes do not look like backend changes;
563
-
when either durable dimension is unavailable it refuses to record rather than falling back to a
564
-
volatile identity. This deterministic pre-flight is the primary path and covers threads the process
565
-
has served while their record remains inside the TTL/LRU bounds. Missing, expired, evicted, and
552
+
Responses passthrough always removes output-only `status` from `reasoning` input items, including
553
+
items that retain opaque `encrypted_content`. The prior retains-blob-keeps-status invariant was
554
+
defensive rather than observed: measured OpenAI reasoning items never contain `status`, and Grok
555
+
accepts its own blob with `status` removed. Keeping it on a cold cross-backend replay instead made
556
+
OpenAI reject the unknown field before validating the blob, starving opaque-blob recovery of the
557
+
provenance error it needs. The established raw-`content` rule remains separate: ChatGPT accepts
558
+
reasoning input only with empty `content`, so a native blob plus raw content keeps the blob but still
559
+
blanks `content`. The blob is kept unless the in-process thread record proves that the current
560
+
provider, destination, adapter, model, or credential differs from the route recorded for the prior
561
+
request on that client thread. On a proven change the blob is removed while the reasoning item and
562
+
its summary survive; `status` has already been removed on every path. Missing, expired, or evicted
563
+
identity state is unknown. The comparison uses the durable destination and credential identities
564
+
with the provider, adapter, and model, so OAuth token-generation refreshes do not look like backend
565
+
changes; when either durable dimension is unavailable it refuses to record rather than falling back
566
+
to a volatile identity. This deterministic pre-flight is the primary path and covers threads the
567
+
process has served while their record remains inside the TTL/LRU bounds. Missing, expired, evicted, and
566
568
pre-process history stays fail-soft on the first send. If a Responses upstream then returns its own
567
569
self-identifying opaque-blob 4xx (`invalid_encrypted_content`, or xAI's two `invalid-argument`
568
570
decoder errors), the proxy rebuilds once through the same sanitation path: reasoning
@@ -589,9 +591,9 @@ conversation's last-serving identity and cause a later main-model turn to strip
589
591
- 목적과 의도: Keep same-backend opaque reasoning replay while preventing backend-private blobs and output-only fields from breaking the first turn after a route change.
590
592
- 기존 구현 및 제약 조건: Reasoning-input sanitation already handled raw content and `ocxr1:` envelopes; the replay cache already supplied a bounded, thread-scoped physical-route identity, but no record connected that identity to native `encrypted_content` provenance.
591
593
- 검토한 주요 대안: Strip every opaque blob, persist provenance across restarts, trust generic 4xx prose, rely only on a retry, or combine deterministic route comparison with a narrowly identified recovery.
592
-
- 선택한 방식: Preserve `status`whenever its blob is forwarded without changing the pre-existing raw-`content` blanking rule; otherwise remove output-only `status`, compare and update a 64-entry/256 KiB/one-hour in-process serving-identity record using durable destination and credential dimensions at request time, pass a proven change into the Responses adapter before the first send, and use one self-identified opaque-blob recovery only when provenance was unknown.
593
-
- 다른 대안 대신 이 방식을 선택한 이유: Unknown provenance can still be valid after restart, durable storage is unnecessary for this bounded compatibility hint, and deterministic pre-flight avoids the extra paid or stateful upstream attempt whenever the process has evidence. The upstream's narrow error identity supplies authoritative evidence only for histories the process could not observe.
594
-
- 장점, 단점 및 영향: Same-route and unknown replay retain cached reasoning on the first send, known cross-route replay keeps the reasoning item without its undecodable blob, and a cold cross-route replay recovers with one extra round trip and one degraded-reasoning turn. A repeated rejection is surfaced unchanged after exactly one recovery attempt.
594
+
- 선택한 방식: Remove output-only `status`from every reasoning input item without changing the pre-existing raw-`content` blanking rule; compare and update a 64-entry/256 KiB/one-hour in-process serving-identity record using durable destination and credential dimensions at request time, pass a proven change into the Responses adapter before the first send, and use one self-identified opaque-blob recovery only when provenance was unknown.
595
+
- 다른 대안 대신 이 방식을 선택한 이유: The former blob/status coupling was defensive rather than observed, and live backends showed that removing `status` preserves same-backend Grok replay while allowing cold cross-backend requests to reach blob validation. Unknown provenance can still be valid after restart, durable storage is unnecessary for this bounded compatibility hint, and deterministic pre-flight avoids the extra paid or stateful upstream attempt whenever the process has evidence. The upstream's narrow error identity supplies authoritative evidence only for histories the process could not observe.
596
+
- 장점, 단점 및 영향: Same-route and unknown replay retain cached reasoning on the first send without replaying an output-only field, known cross-route replay keeps the reasoning item without its undecodable blob, and a cold cross-route replay can reach opaque-blob recovery instead of failing early on `status`. A repeated blob rejection is surfaced unchanged after exactly one recovery attempt.
595
597
596
598
DeepSeek's stateless Responses compatibility pass normalizes only unambiguous tool-call batches.
597
599
Calls emitted before the first matched output stay together as one assistant batch, followed by
0 commit comments