fix(dispatcher): name what an api_error is, so a consumer can tell a failure from an abort - #16
Merged
Merged
Conversation
…failure from an abort Agent Code #1018 review. The orchestration lifecycle reads a newer-than- output api_error on an idle session as a failed turn. It could not tell three things apart: - An instance-wide session.error with NO sessionID. OpenCode publishes these when a SKILL.md, agent, command or plugin file fails to parse. The session filter lets them through because there is nothing to compare, so a healthy child read "failed: Failed to parse skill ...". They stay visible, marked errorType 'instance'. - A user's Esc (MessageAbortedError). This is an interruption, not a provider failure. Every session error now carries OpenCode's own error name as errorType. - This package's delta-buffer overflow. The turn continues; it is marked 'part_overflow'. Tests: - The recorded usage-limit row now also pins errorType APIError. - A new recorded abort row (case b of Agent Code's catalog) pins MessageAbortedError. - The instance case uses the payload exactly as OpenCode's source builds it. A live capture against 1.18.31 was attempted and produced no event; the fixture's provenance says so. - All three fail with the dispatcher change reverted. 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.
Agent Code #1018 review (PR #1044). Agent Code's orchestration lifecycle reads an
api_erroron an idle session, newer than the latest output, as a failed turn. It could not tell three things apart.session.error. OpenCode publishes these for instance-wide problems: a SKILL.md, agent, command or plugin file that fails to parse (skill/index.ts,config/agent.ts,config/command.ts,plugin/index.ts). Every session-scoped publish passes asessionID. The dispatcher's session filter lets these through because there is no id to compare. They stay visible, now markederrorType: 'instance'.MessageAbortedError. Every session error now carries OpenCode's own error name aserrorType:APIError,MessageAbortedError, and so on.errorType: 'part_overflow'.Tests
errorType: 'APIError'.MessageAbortedError.npm run check: 22/22 tests pass, and the build and pack checks pass.🤖 Generated with Claude Code