fix: add tiktoken as a direct dependency#576
Open
licat2023 wants to merge 1 commit into
Open
Conversation
@anthropic-ai/tokenizer requires tiktoken (tiktoken/lite), but tiktoken was only a transitive dependency. opencode's plugin installer does not always install it into the plugin cache, so importing the plugin entry throws "Cannot find module 'tiktoken/lite'" and opencode silently drops the whole plugin (no /dcp or /dcp-compress commands, no compress tool, and no debug logs even with debug enabled). Promoting tiktoken to a direct dependency makes the installer fetch it reliably. Closes Opencode-DCP#575
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
On a fresh install (
3.1.13), the plugin silently fails to load: no/dcpor/dcp-compresscommands, no compress tool, no prune notifications, and no debug logs are written even with"debug": true.Root cause
@anthropic-ai/tokenizerdoesrequire("tiktoken/lite"), buttiktokenis only a transitive dependency. opencode's plugin installer does not always install it into the plugin cache (~/.cache/opencode/packages/@tarquinen/opencode-dcp@latest/node_modules), so importing the plugin entry throws:opencode catches this and silently drops the whole plugin, so nothing is surfaced to the user.
Fix
Promote
tiktokento a direct dependency. Direct dependencies are installed reliably by opencode's installer; the one that went missing here was a child of@anthropic-ai/tokenizer.tiktokenwas already present inpackage-lock.jsonas a transitive dep (1.0.22), so this only adds the top-level declaration — no version change, no new resolution.Verification
Reproduced the broken import, applied the equivalent of this change to the installed cache, then re-imported:
After the fix, restarting opencode exposes
/dcp+/dcp-compressand DCP debug logs are written as expected.Closes #575