Repository navigation
fix(llm): preserve nested OpenAI stream errors - #36130
Merged
Merged
Conversation
5 tasks
rekram1-node
force-pushed
the
nested-errors
branch
from
July 9, 2026 19:36
56f9e18 to
1ecf9f9
Compare
teknium1
added a commit
to NousResearch/hermes-agent
that referenced
this pull request
Jul 17, 2026
… frames Port from anomalyco/opencode#36130: the Responses spec carries streaming error details at the top level of the error frame, but the official OpenAI SDK and several OpenAI-compatible proxies wrap them in an HTTP-style nested envelope ({"type": "error", "error": {code, message, param}}). _raise_stream_error only read top-level fields, so nested-envelope frames collapsed to the generic 'stream emitted error event' placeholder with code=None — the error classifier never saw the provider's real failure reason, misrouting rate-limit / context-overflow / entitlement errors into the generic retry path. Top-level fields keep precedence; the envelope is a fallback. Null-tolerant for spec-compliant frames with explicit nulls.
This was referenced Jul 19, 2026
Gravezzz
pushed a commit
to Gravezzz/hermes-agent
that referenced
this pull request
Jul 21, 2026
… frames Port from anomalyco/opencode#36130: the Responses spec carries streaming error details at the top level of the error frame, but the official OpenAI SDK and several OpenAI-compatible proxies wrap them in an HTTP-style nested envelope ({"type": "error", "error": {code, message, param}}). _raise_stream_error only read top-level fields, so nested-envelope frames collapsed to the generic 'stream emitted error event' placeholder with code=None — the error classifier never saw the provider's real failure reason, misrouting rate-limit / context-overflow / entitlement errors into the generic retry path. Top-level fields keep precedence; the envelope is a fallback. Null-tolerant for spec-compliant frames with explicit nulls.
randlee
pushed a commit
to randlee/hermes-agent
that referenced
this pull request
Aug 11, 2026
… frames Port from anomalyco/opencode#36130: the Responses spec carries streaming error details at the top level of the error frame, but the official OpenAI SDK and several OpenAI-compatible proxies wrap them in an HTTP-style nested envelope ({"type": "error", "error": {code, message, param}}). _raise_stream_error only read top-level fields, so nested-envelope frames collapsed to the generic 'stream emitted error event' placeholder with code=None — the error classifier never saw the provider's real failure reason, misrouting rate-limit / context-overflow / entitlement errors into the generic retry path. Top-level fields keep precedence; the envelope is a fallback. Null-tolerant for spec-compliant frames with explicit nulls.
3 of 6 tasks
prmartinow
pushed a commit
to prmartinow/hermes-agent
that referenced
this pull request
Aug 26, 2026
… frames Port from anomalyco/opencode#36130: the Responses spec carries streaming error details at the top level of the error frame, but the official OpenAI SDK and several OpenAI-compatible proxies wrap them in an HTTP-style nested envelope ({"type": "error", "error": {code, message, param}}). _raise_stream_error only read top-level fields, so nested-envelope frames collapsed to the generic 'stream emitted error event' placeholder with code=None — the error classifier never saw the provider's real failure reason, misrouting rate-limit / context-overflow / entitlement errors into the generic retry path. Top-level fields keep precedence; the envelope is a fallback. Null-tolerant for spec-compliant frames with explicit nulls.
melon-xf
added a commit
to melon-xf/hermes-agent
that referenced
this pull request
Sep 3, 2026
… frames Port from anomalyco/opencode#36130: the Responses spec carries streaming error details at the top level of the error frame, but the official OpenAI SDK and several OpenAI-compatible proxies wrap them in an HTTP-style nested envelope ({"type": "error", "error": {code, message, param}}). _raise_stream_error only read top-level fields, so nested-envelope frames collapsed to the generic 'stream emitted error event' placeholder with code=None — the error classifier never saw the provider's real failure reason, misrouting rate-limit / context-overflow / entitlement errors into the generic retry path. Top-level fields keep precedence; the envelope is a fallback. Null-tolerant for spec-compliant frames with explicit nulls.
jinhuang712
pushed a commit
to jinhuang712/opencode
that referenced
this pull request
Sep 26, 2026
Co-authored-by: Harsh Mathur <[email protected]> Co-authored-by: Aiden Cline <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue for this PR
Closes #36118
Type of change
What does this PR do?
Preserves OpenAI Responses SSE error details when the event arrives as:
{ "type": "error", "error": { "code": "...", "message": "..." } }The stream parser already handled top-level
code/messageandresponse.error; this adds the missing top-levelerrorobject shape so provider errors keep their code/message and context-overflow classification.@rekram1-node tagging you since you have recent ownership in the LLM/provider area. Could you assign #36118 to me if this direction looks right?
How did you verify your code works?
type: "error"with nestederror.code/error.message.git diff --check.packages/llm, but dependency install is blocked in this environment by a 403 while resolvingghostty-web@github:anomalyco/ghostty-web#513463a6f....Screenshots / recordings
N/A
Checklist