Skip to content

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

Closed

Description

Summary

The scm.yaml seeded by infer init (createSCMShortcutsFile in cmd/init/init.go) resolves to invalid gh commands, so both of its /scm subcommands fail at runtime.

Steps to Reproduce

  1. Run infer init on a fresh userspace so ~/.infer/shortcuts/scm.yaml is seeded.
  2. Start a chat session and run /scm issues (or /scm issue 123).

Expected Behavior

/scm issues should run gh issue list --json ... --limit 20 and /scm issue <number> should run gh issue view <number> --json ....

Actual Behavior

CustomShortcut.resolveCommandConfig (internal/presentation/shortcuts/custom.go) appends the subcommand's own name: before its args: when the subcommand defines no command: of its own, so the seeded YAML resolves to invalid commands:

  • /scm issues runs gh issues issue list --json ... - gh rejects it with unknown command "issues" for "gh" (gh's command is singular gh issue list).
  • /scm issue <number> runs gh issue issue view --json ... - the duplicated issue makes gh fail as well.

Suggested fix: give each subcommand its own command: gh with the full args (the pattern the seeded /git commit subcommand uses with command: bash), then update the "SCM Shortcuts" customization example in docs/shortcuts-guide.md (it currently mirrors the seeded file).

Discovered while verifying the subcommand-resolution behavior during #1317 (PR #1327); the resolution trace is recorded there.

Activity

  1. edenreich commented on Sep 25, 2026

    @edenreich
    Contributor

    @infer Can you fix this? use /ponytail:ponytail

  2. moved this to Todo in 2026on Sep 25, 2026
  3. added theissue type on Sep 25, 2026
  4. inference-gateway-maintainer commented on Sep 25, 2026

    @inference-gateway-maintainer
    ContributorAuthor

    Model: ollama_cloud/glm-5.3-flash · View Job

    Todos

    Pull Request

    #1329

    ✅ Infer Result: Success

    Fixed. PR: #1329 (draft, fix/issue-1328, board at QA).

    What changed (3 files, +34):

    • cmd/init/init.go - the seeded scm.yaml subcommands now declare their own command: gh with the full args, so /scm issues resolves to gh issue list --json ... --limit 20 and /scm issue <number> to gh issue view <number> --json .... The name-append path in resolveCommandConfig was left alone; the sibling seeded files (git.yaml, mcp.yaml, reset.yaml, insights.yaml) use it correctly and are already pinned by TestVendoredShortcutsDelegateToCommands.
    • cmd/init/init_test.go - one small regression test (TestSCMShortcutsSpellFullGHCommands) asserting each /scm subcommand declares command: gh and starts with the real gh subcommand.
    • docs/shortcuts-guide.md - the SCM customization example mirrors the fixed seeded file.

    Checks: go test ./cmd/init/... and task precommit:run (mod tidy, fmt, lint:imports, golangci-lint, markdownlint) all pass.

    Follow-ups: [DOCS] sweep ticket filed at inference-gateway/docs#789 for the standalone docs site; no other repos affected (no schema/gateway/env changes).

    Model: ollama_cloud/glm-5.3-flash · Exit Code: 0 · Duration: 5m 45s

    Tokens: 1,502,622 in · 20,421 out · 1,523,043 total (26 requests)

    Tool calls: 44 total · 100% success rate

    Traces
    Session: 1790374327-0161531d
    
    session (headless, success)                                                                        5m37s
    ├── chat ollama_cloud/glm-5.3-flash                                                                 6.6s
    │   ╰── POST /v1/chat/completions [inference-gateway, server]                                       6.6s
    │       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]     6.6s
    │           ╰── POST /proxy/:provider/*path [inference-gateway, server]                             6.6s
    │               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                 6.6s
    ├── execute_tool TodoWrite call_ui6o95ok                                                            79µs
    ├── execute_tool Bash call_zjezj6f4                                                                467ms
    ├── chat ollama_cloud/glm-5.3-flash                                                                 2.1s
    │   ╰── POST /v1/chat/completions [inference-gateway, server]                                       2.1s
    │       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]     2.1s
    │           ╰── POST /proxy/:provider/*path [inference-gateway, server]                             2.1s
    │               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                 2.1s
    ├── execute_tool Bash call_u2hly9x3                                                                 1.8s
    ├── execute_tool Bash call_p2blrf87                                                                  3ms
    ├── chat ollama_cloud/glm-5.3-flash                                                                 3.2s
    │   ╰── POST /v1/chat/completions [inference-gateway, server]                                       3.2s
    │       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]     3.2s
    │           ╰── POST /proxy/:provider/*path [inference-gateway, server]                             3.2s
    │               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                 3.2s
    ├── execute_tool Bash call_k4vyxbxc                                                                936ms
    ├── execute_tool Bash call_30if1jif                                                                  7ms
    ├── chat ollama_cloud/glm-5.3-flash                                                                 3.6s
    │   ╰── POST /v1/chat/completions [inference-gateway, server]                                       3.6s
    │       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]     3.6s
    │           ╰── POST /proxy/:provider/*path [inference-gateway, server]                             3.6s
    │               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                 3.6s
    ├── execute_tool Read call_yc2hm8wf                                                                152µs
    ├── execute_tool Memory call_6i00deeg                                                              120µs
    ├── chat ollama_cloud/glm-5.3-flash                                                                 5.8s
    │   ╰── POST /v1/chat/completions [inference-gateway, server]                                       5.8s
    │       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]     5.8s
    │           ╰── POST /proxy/:provider/*path [inference-gateway, server]                             5.8s
    │               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                 5.8s
    ├── execute_tool Grep call_p3fwfrbg                                                                  1ms
    ├── chat ollama_cloud/glm-5.3-flash                                                                 2.5s
    │   ╰── POST /v1/chat/completions [inference-gateway, server]                                       2.5s
    │       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]     2.5s
    │           ╰── POST /proxy/:provider/*path [inference-gateway, server]                             2.5s
    │               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                 2.5s
    ├── execute_tool Read call_xakd3mdt                                                                509µs
    ├── execute_tool Read call_isgt5hzw                                                                165µs
    ├── chat ollama_cloud/glm-5.3-flash                                                                18.3s
    │   ╰── POST /v1/chat/completions [inference-gateway, server]                                      18.3s
    │       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]    18.2s
    │           ╰── POST /proxy/:provider/*path [inference-gateway, server]                            18.2s
    │               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                18.2s
    ├── execute_tool Grep call_1v06jurp                                                                721µs
    ├── execute_tool Read call_jilzllgg                                                                164µs
    ├── chat ollama_cloud/glm-5.3-flash                                                                 9.8s
    │   ╰── POST /v1/chat/completions [inference-gateway, server]                                       9.8s
    │       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]     9.8s
    │           ╰── POST /proxy/:provider/*path [inference-gateway, server]                             9.8s
    │               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                 9.8s
    ├── execute_tool Grep call_qu5bk5ui                                                                454µs
    ├── execute_tool Grep call_klwg6b7m                                                                  1ms
    ├── execute_tool Read call_wtbn2u80                                                                145µs
    ├── chat ollama_cloud/glm-5.3-flash                                                                 3.6s
    │   ╰── POST /v1/chat/completions [inference-gateway, server]                                       3.6s
    │       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]     3.6s
    │           ╰── POST /proxy/:provider/*path [inference-gateway, server]                             3.6s
    │               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                 3.6s
    ├── execute_tool Read call_unpbwus6                                                                165µs
    ├── execute_tool Read call_48v1ucxc                                                                220µs
    ├── chat ollama_cloud/glm-5.3-flash                                                                36.2s
    │   ╰── POST /v1/chat/completions [inference-gateway, server]                                      36.2s
    │       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]    36.2s
    │           ╰── POST /proxy/:provider/*path [inference-gateway, server]                            36.2s
    │               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                36.2s
    ├── execute_tool Grep call_m24cybsm                                                                382ms
    ├── execute_tool TodoWrite call_11o2pbv9                                                            56µs
    ├── chat ollama_cloud/glm-5.3-flash                                                                 3.4s
    │   ╰── POST /v1/chat/completions [inference-gateway, server]                                       3.4s
    │       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]     3.4s
    │           ╰── POST /proxy/:provider/*path [inference-gateway, server]                             3.4s
    │               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                 3.4s
    ├── execute_tool MultiEdit call_ejn5hvsm                                                           683µs
    ├── chat ollama_cloud/glm-5.3-flash                                                                 9.8s
    │   ╰── POST /v1/chat/completions [inference-gateway, server]                                       9.8s
    │       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]     9.8s
    │           ╰── POST /proxy/:provider/*path [inference-gateway, server]                             9.8s
    │               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                 9.8s
    ├── execute_tool Edit call_co7ounfp                                                                649µs
    ├── execute_tool Edit call_2kyfl87w                                                                411µs
    ├── chat ollama_cloud/glm-5.3-flash                                                                 2.6s
    │   ╰── POST /v1/chat/completions [inference-gateway, server]                                       2.6s
    │       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]     2.6s
    │           ╰── POST /proxy/:provider/*path [inference-gateway, server]                             2.6s
    │               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                 2.6s
    ├── execute_tool Bash call_1ntkra2l                                                                50.3s
    ├── chat ollama_cloud/glm-5.3-flash                                                                 4.2s
    │   ╰── POST /v1/chat/completions [inference-gateway, server]                                       4.2s
    │       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]     4.2s
    │           ╰── POST /proxy/:provider/*path [inference-gateway, server]                             4.2s
    │               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                 4.2s
    ├── execute_tool TodoWrite call_jwf7qkli                                                            68µs
    ├── execute_tool Bash call_we0qfph7                                                                1m15s
    ├── chat ollama_cloud/glm-5.3-flash                                                                 4.2s
    │   ╰── POST /v1/chat/completions [inference-gateway, server]                                       4.1s
    │       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]     4.1s
    │           ╰── POST /proxy/:provider/*path [inference-gateway, server]                             4.1s
    │               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                 4.1s
    ├── execute_tool Bash call_7edkdloe                                                                  7ms
    ├── execute_tool Bash call_srjdtj7s                                                                  5ms
    ├── chat ollama_cloud/glm-5.3-flash                                                                 3.7s
    │   ╰── POST /v1/chat/completions [inference-gateway, server]                                       3.7s
    │       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]     3.7s
    │           ╰── POST /proxy/:provider/*path [inference-gateway, server]                             3.7s
    │               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                 3.7s
    ├── execute_tool Bash call_m8v4hzzv                                                                  6ms
    ├── chat ollama_cloud/glm-5.3-flash                                                                 3.3s
    │   ╰── POST /v1/chat/completions [inference-gateway, server]                                       3.3s
    │       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]     3.3s
    │           ╰── POST /proxy/:provider/*path [inference-gateway, server]                             3.3s
    │               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                 3.3s
    ├── execute_tool Bash call_w4e31nxl                                                                 4.3s
    ├── chat ollama_cloud/glm-5.3-flash                                                                 9.6s
    │   ╰── POST /v1/chat/completions [inference-gateway, server]                                       9.5s
    │       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]     9.5s
    │           ╰── POST /proxy/:provider/*path [inference-gateway, server]                             9.5s
    │               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                 9.5s
    ├── execute_tool Bash call_vse66lhc                                                                 1.9s
    ├── execute_tool Write call_pivpeb21                                                               860µs
    ├── chat ollama_cloud/glm-5.3-flash                                                                 2.0s
    │   ╰── POST /v1/chat/completions [inference-gateway, server]                                       2.0s
    │       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]     2.0s
    │           ╰── POST /proxy/:provider/*path [inference-gateway, server]                             2.0s
    │               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                 2.0s
    ├── execute_tool Bash call_wbhcz5f6                                                                 1.9s
    ├── chat ollama_cloud/glm-5.3-flash                                                                 6.3s
    │   ╰── POST /v1/chat/completions [inference-gateway, server]                                       6.3s
    │       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]     6.3s
    │           ╰── POST /proxy/:provider/*path [inference-gateway, server]                             6.3s
    │               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                 6.3s
    ├── execute_tool Bash call_liargdpd                                                                863ms
    ├── chat ollama_cloud/glm-5.3-flash                                                                 9.2s
    │   ╰── POST /v1/chat/completions [inference-gateway, server]                                       9.2s
    │       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]     9.2s
    │           ╰── POST /proxy/:provider/*path [inference-gateway, server]                             9.2s
    │               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                 9.2s
    ├── execute_tool WebFetch call_mp5lm9a0                                                            142ms
    ├── chat ollama_cloud/glm-5.3-flash                                                                22.7s
    │   ╰── POST /v1/chat/completions [inference-gateway, server]                                      22.7s
    │       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]    22.6s
    │           ╰── POST /proxy/:provider/*path [inference-gateway, server]                            22.6s
    │               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                22.6s
    ├── execute_tool Write call_y5grmsth                                                               629µs
    ├── execute_tool Write call_w5shm1i8                                                               622µs
    ├── chat ollama_cloud/glm-5.3-flash                                                                 3.1s
    │   ╰── POST /v1/chat/completions [inference-gateway, server]                                       3.1s
    │       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]     3.1s
    │           ╰── POST /proxy/:provider/*path [inference-gateway, server]                             3.1s
    │               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                 3.1s
    ├── execute_tool Bash call_fqyokpc9                                                                 1.5s
    ├── execute_tool Bash call_09qst1v1                                                                 2.3s
    ├── chat ollama_cloud/glm-5.3-flash                                                                 4.9s
    │   ╰── POST /v1/chat/completions [inference-gateway, server]                                       4.9s
    │       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]     4.9s
    │           ╰── POST /proxy/:provider/*path [inference-gateway, server]                             4.9s
    │               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                 4.9s
    ├── execute_tool Memory call_8l40c3s6                                                               1.2s
    ├── execute_tool Bash call_0sk31c9t                                                                  7ms
    ├── chat ollama_cloud/glm-5.3-flash                                                                 4.2s
    │   ╰── POST /v1/chat/completions [inference-gateway, server]                                       4.2s
    │       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]     4.2s
    │           ╰── POST /proxy/:provider/*path [inference-gateway, server]                             4.2s
    │               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                 4.2s
    ├── execute_tool Bash call_moav0ov2                                                                539ms
    ├── execute_tool TodoWrite call_9ndprqz5                                                            58µs
    ╰── chat ollama_cloud/glm-5.3-flash                                                                 4.2s
        ╰── POST /v1/chat/completions [inference-gateway, server]                                       4.1s
            ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]     4.1s
                ╰── POST /proxy/:provider/*path [inference-gateway, server]                             4.1s
                    ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                 4.1s
    
    Stats
    Tool Calls
    
    ╭───────────┬───────┬───────┬────────╮
    │ Tool      │ Calls │ Fail% │ Avg    │
    ├───────────┼───────┼───────┼────────┤
    │ Bash      │ 18    │ 0%    │ 7851ms │
    │ Read      │ 7     │ 0%    │ 203µs  │
    │ Grep      │ 5     │ 0%    │ 77ms   │
    │ TodoWrite │ 4     │ 0%    │ 58µs   │
    │ Write     │ 3     │ 0%    │ 718µs  │
    │ Memory    │ 2     │ 0%    │ 620ms  │
    │ Edit      │ 2     │ 0%    │ 541µs  │
    │ WebFetch  │ 1     │ 0%    │ 142ms  │
    │ MultiEdit │ 1     │ 0%    │ 682µs  │
    ╰───────────┴───────┴───────┴────────╯
    
    Token Usage
    
    ╭────────────────────────────┬─────────┬─────────┬────────────┬─────────┬──────╮
    │ Model                      │ Prompt  │ Cached  │ Completion │ Total   │ Cost │
    ├────────────────────────────┼─────────┼─────────┼────────────┼─────────┼──────┤
    │ ollama_cloud/glm-5.3-flash │ 1502622 │ 1070720 │ 20421      │ 1523043 │ -    │
    ╰────────────────────────────┴─────────┴─────────┴────────────┴─────────┴──────╯
    
    Sessions
    
    ╭───────────┬──────────┬──────────╮
    │ Execution │ Mode     │ Sessions │
    ├───────────┼──────────┼──────────┤
    │ headless  │ headless │ 1        │
    ╰───────────┴──────────┴──────────╯
    

    Triggered by edenreich · Infer Action · OSS

  5. moved this from Todo to In progress in 2026on Sep 25, 2026
  6. added a commit that references this issue on Sep 25, 2026
    9fea65e
  7. inference-gateway-releaser commented on Sep 26, 2026

    @inference-gateway-releaser
    Contributor

    🎉 This issue has been resolved in version 0.208.2 🎉

    The release is available on:

    Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugreleased

    Type

    Projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions