Conversation
- change typed-session-errors - add SessionErrorSignal carrying name, statusCode, isRetryable, and providerID from session.error events - wrap session failures in SessionError and recover the classification through cause chains at the failure gate - classify message-level session errors at the attempt boundary while keeping Claude Code failures unclassified - keep cancellations typed as SessionAbortedError across gate aborts and preserve legacy anonymous error text - persist the classification as PhaseMetadata.error and clear it when a phase restarts Co-Authored-By: Claude <noreply@anthropic.com>
dagoaie
force-pushed
the
feat/typed-session-errors-pr
branch
from
September 11, 2026 18:26
10db6fe to
9d3ddb4
Compare
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FUdVGWR9FvgD11kEsuS1U4
dagoaie
force-pushed
the
feat/typed-session-errors-pr
branch
3 times, most recently
from
September 14, 2026 12:16
40c7323 to
3663f6d
Compare
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.
Why
A
session.errorevent carries a typed classification from the OpenCode SDK (name,data.statusCode,data.isRetryable,data.providerID), butdescribeSessionActivityflattens it to a message string andwatchSessionrethrows it as a plainError. The "step failed — waiting for your decision" gate, the attempt log andmetadata.jsoncannot tell a retryable 429 from an expired credential or a truncated output. As a side effect, aMessageAbortedErrordelivered throughsession.errorwas never recognised as a cancellation.Summary
SessionErrorSignal { name, message, statusCode?, isRetryable?, providerID? }built from the event;formatEventErrorreturns the exact same string, so activity lines do not changeSessionErrorat the attempt boundary (event-delivered and message-levelinfo.erroralike);nameis pinned to"SessionError"and the SDK name lives insignal.name, so provider data can never match a runner sentinel such asisUserAbortErrorMessageAbortedErrorasSessionAbortedErrorlog.warn:<message> (HTTP 429, retryable); unchanged when there is no statusPhaseMetadata.erroron failed phases viaphaseFailed(name, detail?, failure?)/phaseEnded(name, status, failure?); an operator abort at the gate keeps the attempt failure ascause, so metadata records what actually failed; cancelling the message itself records nothingrun-status.tsand the TUI are untouchedThe change was authored as OpenSpec change
typed-session-errors(new capabilitystep-failure-diagnostics) and landed withconvoy close, so this PR includes the archived change and the generatedopenspec/specs/step-failure-diagnostics/spec.md. Happy to drop the archive/spec files if you prefer to land those yourself.Verification
bun run typecheckbun test(3207 pass)bun run test:coverage(92.6 %)openspec validate typed-session-errors --strict--no-tui): the gate shows… (HTTP 401, not retryable)andmetadata.jsoncarrieserror. Note: an invalid credential reaches Convoy asAPIError401isRetryable: false, notProviderAuthError; the classification is carried as the SDK emits it.🤖 Generated with Claude Code
https://claude.ai/code/session_018yC7LkEoDKjy61RzyGy8W2