Skip to content

fix(dispatcher): a session error reports the provider's text from error.data.message - #15

Merged
Juliusolsson05 merged 1 commit into
mainfrom
fix/session-error-message
Sep 19, 2026
Merged

Juliusolsson05 merged 1 commit into
mainfrom
fix/session-error-message

Conversation

@Juliusolsson05

Copy link
Copy Markdown
Owner

For Agent Code #1018, where orchestration children fail silently.

Why

OpenCode 1.18 publishes session.error as { sessionID, error: { name, data: { message, statusCode, … } } }. That is the same shape as the assistant row's error in 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 messageerror.data.messageerror.messageerror.name, the order opencode-terminal-headless's LiveStateProjector already uses.

Test

src/dispatcher/sessionError.test.ts dispatches 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 in testing/fixtures/session-error/ with its provenance. The test fails on main, and the full suite passes.

🤖 Generated with Claude Code

…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>
@Juliusolsson05
Juliusolsson05 merged commit 9d6bb31 into main Sep 19, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant