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
Decode and preserve OpenAI Responses stream errors whose details arrive under a top-level error object. The current event schema recognizes top-level code/message and response.error, but strips { type: "error", error: { code, message } }, reducing actionable failures such as context overflow to OpenAI Responses stream error.
Regression test
The red protocol-level regression test is committed here:
It should retain context_length_exceeded: prompt too long and classify it as context-overflow.
Run from packages/llm:
bun test test/provider/openai-responses.test.ts --test-name-pattern "top-level error field"
Incident evidence and remaining uncertainty
A clean GPT-5.5 Fast request succeeded. The affected session history failed consistently after a provider switch, and a history-boundary bisect localized the first failure to one assistant step containing six web-search results (168,234 characters of tool output). History immediately before that step succeeded.
The installed build did not retain the raw SSE error event, so this test proves a real diagnostic-loss bug matching the observed fallback but does not yet prove which upstream validation rejected that history. Preserve or safely instrument the raw recognized error shape while fixing this so the underlying rejection can be classified.
It adds the missing top-level error object shape to the OpenAI Responses stream event schema and a regression test for preserving context_length_exceeded: prompt too long as context-overflow.
Could you assign this issue to me if that direction looks right?
Activity
harshmathurx commentedon Jul 9, 2026
@rekram1-node I opened a focused PR for this: #36131
It adds the missing top-level
errorobject shape to the OpenAI Responses stream event schema and a regression test for preservingcontext_length_exceeded: prompt too longascontext-overflow.Could you assign this issue to me if that direction looks right?
harshmathurx commentedon Jul 9, 2026
Correction: PR link is #36130.