Port gHashTag/BrowserOS:trios/agent-server/apps/server/src/lib/provider-error-classifier.ts (TypeScript, 1 function) to - #5926
Merged
Merged
Conversation
Port the terminal-error classifier (trios/agent-server/apps/server/src/lib/ provider-error-classifier.ts) to a t27 specification so the decision logic can be generated from .t27 instead of hand-written TypeScript. - ProviderErrorContext struct: statusCode (i32) and responseBody (str), an empty body standing in for the original's optional/absent body. - toLowerCase and includes become byte-wise helpers (to_lower_byte, contains_ignore_case) reproducing the original's case-insensitive phrase scan over TERMINAL_BALANCE_PHRASES. - The JSON.parse block's decision is ported as has_terminal_error_code: a hand-rolled scan that requires the "error" key followed by a "code" key and compares the value (quoted string or bare number, since the original stringifies the parsed code) against the Z.AI 1113 and BrowserOS CREDITS_EXHAUSTED terminal codes. - isTerminalProviderError keeps the original's decisions: 402 is terminal, a missing body stays retryable, a phrase or known-code match is terminal, and everything else conservatively stays retryable. 18 tests assert the original behavior: 402 terminal, missing body retryable, case-insensitive phrase matches, Z.AI 1113 in string and numeric form, CREDITS_EXHAUSTED, and 429/500 without a terminal code staying retryable. t27c parse, typecheck, spec-status (IMPLEMENTED), coverage (9/9 functions), and test-report (18/18 pass, 0 BLOCKED) all pass; generated Zig is 282 lines with no not-yet-implemented stubs. Closes #5843
A pull request must add exactly one docs/now entry and a bee has no way to know that: its brief names a boundary file and acceptance criteria, and docs/now/ is neither. The publisher adds it rather than failing the gate. Closes #5843 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Contributor
|
📓 NotebookLM Notebook linked to this PR
This notebook contains session context, decisions, and artifacts for this work. |
Contributor
This was referenced Oct 4, 2026
Merged
Merged
Merged
Closed
This was referenced Oct 4, 2026
Merged
Merged
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.
Closes #5843
Written by a bee on
queen-5843and published bytools/queen/publish.py. The branch itself is the bee's; the second commit is the coordination entry every pull request must add, which a bee has no way to know about.🤖 Generated with Claude Code