Repository navigation
fix(setup): install namespaced /gstack-review OpenCode command without shadowing the builtin /review - #2651
fix(setup): install namespaced /gstack-review OpenCode command without shadowing the builtin /review#2651Lockyer228 wants to merge 3 commits into
Conversation
|
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: |
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.
7ccfa05 to
4a06014
Compare
|
Thank you, @Lockyer228. Your fix is folded into v1.91.19.0 (#3025), which is now merged, and you're credited as a co-author on the release commit and in the CHANGELOG. Closing this PR because the change is on main now. |
|
thanks for folding this into the wave — appreciate the co-author credit and the changelog mention. honestly been learning a ton from gstack itself, so glad you're putting the whole setup out there for everyone. lmk if anything else comes up around this area, happy to help. |
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