Skip to content

fix(provider): normalize terminal failures#907

Merged
dcramer merged 6 commits into
mainfrom
fix/uniform-provider-errors
Jul 25, 2026
Merged

fix(provider): normalize terminal failures#907
dcramer merged 6 commits into
mainfrom
fix/uniform-provider-errors

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Provider failures now use one structured contract across Gateway, Pi, and the
turn runtime. Retry decisions recognize verified transient status and transport
signals, honor bounded retry-after hints, and no longer depend on rewriting
Error.name.

Terminal provider failures carry safe classification fields into Sentry and
show actionable, sanitized user copy with the existing event reference. Unknown
failures keep the generic fallback, partial model-authored replies keep their
existing interruption behavior, and Gateway fallback configuration remains out
of scope.

Refs JUNIOR-53.

Requested by immutable dcramer via Junior.

--

View Junior Session in Sentry

@vercel

vercel Bot commented Jul 15, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
junior-docs Ready Ready Preview Jul 25, 2026 3:05am

Request Review

Comment thread packages/junior/src/chat/services/provider-error.ts
Comment thread packages/junior/src/chat/services/provider-error.ts
Comment thread packages/junior/src/chat/services/provider-error.ts Outdated
Comment thread packages/junior/src/chat/services/provider-error.ts
Comment thread packages/junior/src/chat/services/provider-error.ts Outdated
Comment thread packages/junior/src/chat/agent/index.ts Outdated
@dcramer
dcramer force-pushed the fix/uniform-provider-errors branch from 22698f0 to 2f93dc4 Compare July 24, 2026 16:23
@dcramer dcramer changed the title fix(agent): normalize provider failures fix(provider): normalize terminal failures Jul 24, 2026
Comment thread packages/junior/src/chat/agent/index.ts Outdated
Comment thread packages/junior/src/chat/services/provider-error.ts
Comment thread packages/junior/src/chat/services/provider-error.ts
Comment thread packages/junior/src/chat/services/provider-error.ts
Comment thread packages/junior/src/chat/services/provider-error.ts
dcramer added 5 commits July 24, 2026 19:31
Classify provider errors once for retry policy, telemetry, and sanitized terminal replies. Preserve retry hints without leaking upstream payloads to users.

Refs JUNIOR-53
Classify known connection and timeout codes through nested error causes so transient gateway failures retain retry behavior.
Keep the normalized provider classifier compatible with Pi's transient provider and transport patterns while retaining Junior's typed error kinds.
Comment thread packages/junior/src/chat/services/provider-error.ts

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 33fa92d. Configure here.

Comment thread packages/junior/src/chat/services/provider-error.ts
Delegate assistant retry recognition to Pi, keep Junior's terminal vetoes narrow, and avoid recording raw provider payloads in normalized errors.

Refs JUNIOR-53
@dcramer
dcramer force-pushed the fix/uniform-provider-errors branch from 33fa92d to 491dd8a Compare July 25, 2026 03:04
@dcramer
dcramer merged commit 2a86540 into main Jul 25, 2026
42 of 45 checks passed
@dcramer
dcramer deleted the fix/uniform-provider-errors branch July 25, 2026 07:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: medium PR risk score: medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant