fix(dispatcher): a session error reports the provider's text from error.data.message - #15
Merged
Merged
Conversation
…or.data.message
Agent Code #1018: an orchestration child's usage-limit failure reached the
parent as "OpenCode session error". OpenCode 1.18 publishes session.error
as { sessionID, error: { name, data: { message, statusCode, ... } } }, the
shape of the assistant row's error in its database, and the lookup read
only message and error.message. It now reads error.data.message first,
then error.message, then error.name, the same order the Terminal runtime
uses. The fail-first test uses a real error from an OpenCode 1.18.31
database row.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
For Agent Code #1018, where orchestration children fail silently.
Why
OpenCode 1.18 publishes
session.erroras{ sessionID, error: { name, data: { message, statusCode, … } } }. That is the same shape as the assistant row'serrorin its database.The dispatcher looked up
['message', 'error.message'], found nothing, and every failure read "OpenCode session error", a usage limit included. The parent agent therefore couldn't tell a quota problem from anything else.Change
The lookup order is now
message→error.data.message→error.message→error.name, the orderopencode-terminal-headless'sLiveStateProjectoralready uses.Test
src/dispatcher/sessionError.test.tsdispatches a real error taken from an OpenCode 1.18.31 database row: a zai 429 "Usage limit reached for 5 hour. Your limit will reset at 2026-09-19 14:14:24". The fixture is intesting/fixtures/session-error/with its provenance. The test fails on main, and the full suite passes.🤖 Generated with Claude Code