fix: remove __DCP_CONTEXT_HANDLED__ throw that leaked to error logs (#296) - #297
Open
ranxianglei wants to merge 3 commits into
Open
fix: remove __DCP_CONTEXT_HANDLED__ throw that leaked to error logs (#296)#297ranxianglei wants to merge 3 commits into
ranxianglei wants to merge 3 commits into
Conversation
📦 Built Plugin ArtifactBranch: Option A — Install from npm PR tag (recommended)opencode plugin opencode-acp@pr-297 --globalEach push to this PR publishes a new version under the Option B — Install from GitHubopencode plugin "github:ranxianglei/opencode-acp#2026-08-13_fix-dcp-context-handled-error" --globalOption C — Download artifact
tar xzf opencode-acp-pr297.tgz
cp -r package/dist ~/.cache/opencode/packages/opencode-acp@latest/node_modules/opencode-acp/dist
This comment is automatically updated on each push. |
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.
Problem (Issue #296)
/acpcommands throwError: __DCP_CONTEXT_HANDLED__which leaks to the opencode error log. In opencode 1.18.18, this produceslevel=ERRORentries for every/acpinvocation.Reported by @BsoBird on opencode 1.18.18 + ACP 1.14.16.
Root Cause
The command handler in
hooks.tsthrewnew Error("__DCP_CONTEXT_HANDLED__")after handling/acpcommands (lines 295, 299). This sentinel was meant to abort command processing, but opencode catches and logs it as an error.Fix
Replace both
throw new Error("__DCP_CONTEXT_HANDLED__")withreturn. Commands deliver output viasendIgnoredMessage(writes directly to session viaclient.session.prompt), so the hook can return normally without side effects.Verification