Skip to content

Port gHashTag/BrowserOS:trios/agent-server/apps/server/src/lib/provider-error-classifier.ts (TypeScript, 1 function) to - #5926

Merged
gHashTag merged 2 commits into
masterfrom
queen-5843
Oct 4, 2026
Merged

gHashTag merged 2 commits into
masterfrom
queen-5843

Conversation

@gHashTag

@gHashTag gHashTag commented Oct 4, 2026

Copy link
Copy Markdown
Owner

Closes #5843

Written by a bee on queen-5843 and published by tools/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.

1 file changed, 376 insertions(+)

🤖 Generated with Claude Code

Trinity Bee and others added 2 commits October 4, 2026 06:31
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>
@github-actions

github-actions Bot commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

📓 NotebookLM Notebook linked to this PR

This notebook contains session context, decisions, and artifacts for this work.

@github-actions

github-actions Bot commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-10-04 06:56:48 UTC

Summary

Status Count
Total Open PRs 50
PRs with Failing Checks 49
PRs with All Checks Green 1
READY 1
FAILING 49
PENDING 0
NO CHECKS YET 0

Seal Status

  • ⚠️ STALE -- sha256(compiler.rs)=b45a356c2eb6 != manifest seal=87e5cbd3ad94.
    The committed NMSE numbers were certified against an older compiler.rs.
    Run scripts/reseal-check.sh locally for the two-step reseal command (advisory; not a merge gate).

This was referenced Oct 4, 2026
This was referenced Oct 4, 2026
@gHashTag
gHashTag merged commit 106df9b into master Oct 4, 2026
29 of 31 checks passed
@gHashTag
gHashTag deleted the queen-5843 branch October 4, 2026 17:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants