Skip to content

fix(v1): register /dcp command in opencode config hook - #694

Open
s1reyash wants to merge 1 commit into
Tarquinen:masterfrom
s1reyash:fix/register-v1-dcp-command
Open

s1reyash wants to merge 1 commit into
Tarquinen:masterfrom
s1reyash:fix/register-v1-dcp-command

Conversation

@s1reyash

@s1reyash s1reyash commented Dec 1, 2026

Copy link
Copy Markdown

Closes #588.

Summary

  • Register opencodeConfig.command["dcp"] in the V1 plugin config hook whenever config.commands.enabled is true, matching the V2 behavior and the existing command.execute.before handler in lib/hooks.ts.
  • Keep /dcp registered even when config.compress.permission === "deny" so users can still run /dcp manual, /dcp stats, /dcp context, /dcp sweep, /dcp decompress, and /dcp recompress, while continuing to gate /dcp-compress on config.compress.permission !== "deny".
  • Extract registerV1Commands into lib/commands/register.ts and add unit tests in tests/plugin-commands.test.ts.

Verification

  • npm run format:check passed
  • npm run typecheck passed
  • npm run build passed
  • npm test passed (127/127 + 8/8 logger tests)
  • npm run check:package passed

linsaftw added a commit to linsaftw/opencode-dynamic-context-pruning that referenced this pull request Dec 2, 2026
Port upstream PRs for V1 /dcp registration and V2 /dcp-compress palette
dispatch. Preserve command behavior when compress is denied.

Refs: Tarquinen#694
Refs: Tarquinen#628
Upstream-PR: Tarquinen#694
Upstream-PR: Tarquinen#628
linsaftw added a commit to linsaftw/opencode-dynamic-context-pruning that referenced this pull request Dec 2, 2026
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.

[Bug]: The command /dcp is not registered, eventhough it is referenced for (re-)enabling auto compression mode

1 participant