fix(setup): install namespaced /gstack-review OpenCode command without shadowing the builtin /review - #2651
Open
Lockyer228 wants to merge 3 commits into
Open
Conversation
OpenCode's builtin /review is a subtask command and shadows gstack's review skill. Write commands/gstack-review.md with subtask: false instead of overriding the builtin.
Do not clobber a user-owned gstack-review.md. Drop the dead init branch. Tell installers to type /gstack-review instead of /review.
Tests now fail if OPENCODE_COMMANDS is retargeted. README lists commands/gstack-review.md for install and manual removal.
|
Merging to
After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here |
|
An error occurred while submitting your PR to the queue: |
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.
Why (in your own words)
./setup --host opencodelinks gstack's generated skills into~/.config/opencode/skills/, but never writes anything under~/.config/opencode/commands/. OpenCode 1.18.3 ships a built-in/reviewslash command withsubtask: true, and its command-registration loop skips any skill whose frontmattername:matches an existing command — so gstack'sreviewskill (frontmattername: review) never becomes a working/review. Typing/reviewruns the builtin subtask instead, and withplanas the primary agent that comes back as "Task cancelled." (skill({ name: "review" })still works, so the skill itself is fine.)This change makes the collision explicit and safe: setup installs a namespaced
~/.config/opencode/commands/gstack-review.mdcommand (subtask: false) that loads the gstack review skill by its frontmatter name, so/gstack-reviewworks and OpenCode's builtin/reviewis left untouched. Non-colliding skills (qa, ship, ...) are deliberately not turned into command files — OpenCode already registers those from the skillname. Files that don't carry the generated banner are never overwritten.Live evidence
BEFORE —
origin/main@51932ece(v1.68.2.0). The OpenCode install path has nocommands/handling at all; onlyskills/is linked:AFTER — this branch, the real
install_opencode_collision_commandsrun against a throwaway$HOMEwith agstack-reviewskill installed:review.mdandinit.mdare not created, so OpenCode's builtin commands keep working unchanged.Behavior tests (bun 1.3.13):
The wiring is pinned: a static test asserts
OPENCODE_COMMANDSis exactly$HOME/.config/opencode/commands, and a behavior test drives the real constant and the real function through a temporary$HOME. Mutating that constant to a wrong directory makes the suite fail (verified: 7 pass / 2 fail, non-zero exit), so a future regression in the target path is caught.Scope
setup(newinstall_opencode_collision_commands+ wiring in the OpenCode install block),test/setup-opencode-collision-commands.test.ts,README.md(install table + manual-uninstall entry for the new command file).$HOME. This host cannot drive the interactive OpenCode TUI (no configured provider or credentials).bun run test— this environment's Playwright/browse lane fails with "Target page, context or browser has been closed", unrelated to this diff (the OpenCode: slash commands route to non-existent 'plan' subagent #2629 tests pass in the shard logs). Interactive/gstack-reviewinside the real OpenCode TUI, and Windows (the bash behavior tests follow the repo's existingskipIf(win32)convention).Linked issue
Fixes #2629