Skip to content

fix(shortcuts): seed scm.yaml subcommands with their own gh command - #1329

Merged
edenreich merged 1 commit into
mainfrom
fix/issue-1328
Sep 25, 2026
Merged

edenreich merged 1 commit into
mainfrom
fix/issue-1328

Conversation

@inference-gateway-maintainer

@inference-gateway-maintainer inference-gateway-maintainer Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Resolves #1328

Summary

The scm.yaml seeded by infer init relied on CustomShortcut.resolveCommandConfig appending a subcommand's own name: before its args: when the subcommand declares no command: of its own. Since the invoked names (issues, issue) do not match gh's real subcommands (issue list, issue view), both /scm shortcuts resolved to invalid commands (gh issues issue list ..., gh issue issue view ...) and failed at runtime. This gives each subcommand its own command: gh with the full args - the same pattern the seeded /git commit subcommand already uses - so the args resolve verbatim.

Changes

  • cmd/init/init.go: the seeded issues and issue subcommands now declare command: gh with the full gh args, so /scm issues runs gh issue list --json ... --limit 20 and /scm issue <number> runs gh issue view <number> --json ...
  • cmd/init/init_test.go: added TestSCMShortcutsSpellFullGHCommands pinning the seeded file against the regression (each subcommand declares its own gh command and starts with the real gh subcommand)
  • docs/shortcuts-guide.md: the SCM Shortcuts customization example now mirrors the fixed seeded file

Checked the sibling seeded files (git.yaml, mcp.yaml, reset.yaml, insights.yaml): they use the name-append pattern correctly (invoked name == real CLI subcommand) and are covered by TestVendoredShortcutsDelegateToCommands, so no change needed there.

Docs follow-up ticket for the standalone docs site: to be linked once filed (this PR already fixes the in-repo docs/shortcuts-guide.md example).

Verification

  • go test ./cmd/init/... passes
  • task precommit:run (mod tidy, fmt, lint:imports, golangci-lint, markdownlint) passes

resolveCommandConfig appends a subcommand's name to the parent args when the subcommand declares no command of its own, so the seeded /scm shortcuts ran invalid commands like 'gh issues issue list'. Give each subcommand command: gh with the full args, the pattern the seeded /git commit subcommand already uses, and align the SCM customization example in the shortcuts guide.
@edenreich
edenreich marked this pull request as ready for review September 25, 2026 22:41
@edenreich
edenreich requested a review from a team as a code owner September 25, 2026 22:41
@edenreich
edenreich merged commit 9fea65e into main Sep 25, 2026
1 check passed
@edenreich
edenreich deleted the fix/issue-1328 branch September 25, 2026 22:41
@inference-gateway-releaser

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 0.208.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

@inference-gateway-releaser inference-gateway-releaser Bot added the released Shipped in a release label Sep 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

released Shipped in a release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] /scm shortcuts seeded by infer init resolve to invalid gh commands

1 participant