Repository navigation
fix(core): preserve raw unknown finish diagnostics - #56508
rudycelekli wants to merge 1 commit into
Conversation
|
The following comment was made by an LLM, it may be inaccurate: |
There was a problem hiding this comment.
Looks correct. The new tests fail on the base for the three cases with a raw finish reason and pass with this change. The full session-runner.test.ts (233 tests) and the packages/core typecheck pass. Classification (incomplete-stream) and retry behaviour are unchanged, and the test checks that the retry hook still sees retry: true.
Public API: unchanged (only the error message text changes).
One gap worth a follow-up or a small addition here: compaction builds the same InvalidProviderOutputError in packages/core/src/session/compaction.ts (around line 549) and still drops the raw value (event.reason.raw). An unknown finish during compaction will still show the generic message.
Also note that #54713 edits the same lines in step.ts, so whichever lands second will need a rebase. It formats its raw reason as (x) rather than : "x", so it would be good to settle on one format.
Issue for this PR
Closes #44092
Type of change
What does this PR do?
Include the JSON-escaped raw provider finish reason in unknown-finish errors when it is available. Keep the existing message when absent, and preserve classification and retry behavior.
How did you verify your code works?
bun run checkpass.Screenshots / recordings
No visual UI change; errors and stored/replayed results are asserted directly.
Checklist
Added by the opencode bot (AI-generated).
Related: #34835, #44695