Skip to content

fix(agent): keep the system prompt byte-stable across agent-mode switches (Shift+Tab) - #1135

Merged
edenreich merged 7 commits into
mainfrom
fix/issue-1134
Aug 31, 2026
Merged

edenreich merged 7 commits into
mainfrom
fix/issue-1134

Conversation

@inference-gateway-maintainer

@inference-gateway-maintainer inference-gateway-maintainer Bot commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor

Resolves #1134

Summary

Mode switches mid-conversation (Shift+Tab in chat, or accepting a plan) no longer swap the system prompt sent as message[0]. Previously the agent rebuilt message[0] from the live mode (agent.system_prompt_plan in plan mode, agent.system_prompt_auto in auto-accept), changing the conversation prefix and invalidating provider prompt/KV caches, so the whole conversation was re-processed at uncached rates. The mode-change <system-reminder> user message is now the single, cache-preserving carrier of mode-specific instructions, enriched with everything the old per-mode prompts carried.

What changed

  • internal/agent/agent_utils.go: removed getSystemPromptForMode(); message[0] is always assembled from agent.system_prompt and is byte-stable across turns AND across mode switches. buildToolsInfo() (AVAILABLE TOOLS) and buildBashAllowInfo() (BASH ALLOW-LIST) moved from the static prompt into the per-request volatile tail, so the live mode's tool roster still updates on the next turn without touching message[0].
  • config/reminders.go: the built-in on_mode_change guidance now carries the full per-mode behavior the old prompts held - the plan workflow (clarify first, AskUserQuestion for discrete choices, RequestPlanApproval only when complete), the required plan Markdown sections, the plan/auto tool-set deltas consistent with llm_tool_service.ListToolsForMode, the auto-accept destructive-action policy, and the standard per-call approval note. Users override per-key via the reminder's guidance map in reminders.yaml.
  • ReminderQuery.ModeGuidance (internal/agent/domain/hooks.go) plus modeGuidanceOverrides(): prompts.yaml per-mode adjustments (agent.mode_adjustment_plan / agent.mode_adjustment_auto) layer onto the reminder when set. Precedence: user-edited reminders.yaml guidance beats prompts.yaml adjustment beats built-in default.
  • config/prompts.go: agent.system_prompt_plan / _auto renamed to agent.mode_adjustment_plan / agent.mode_adjustment_auto (YAML keys mode_adjustment_plan / mode_adjustment_auto). They ship empty and are no longer backfilled - the built-in texts live in the reminder guidance. No backward compatibility (YAGNI): the old YAML keys and env aliases are simply gone; only the renamed INFER_PROMPTS_AGENT_MODE_ADJUSTMENT_PLAN / _AUTO env vars load.
  • Docs: docs/configuration-reference.md and docs/plan-mode.md updated (rename and precedence notes, the byte-stability guarantee, infer debug agent system_prompt now listing the tools and bash-allow-list sections under the volatile tail). reminders.enabled: false behavior is documented explicitly: the mode-change reminder is the sole carrier of mode instructions, so with reminders disabled the per-mode instructions are not delivered (documented trade-off, per the issue's open question 3).

Deliberately kept (per the issue's open questions)

  • The native tools array still shrinks in plan mode, so providers that fold tools into the cache prefix still see a residual miss on a mode flip (open question 1a). System-prompt stability is the main win; enforcing plan-mode read-only at execution time instead of via the tool list is a possible follow-up.
  • Repeated flips re-inject the full guidance each time; the compact short-form idea (open question 5) is not implemented.

Tests

  • New TestAgentServiceImpl_BuildSystemPromptByteStableAcrossModeSwitch pins message[0] byte-identity across standard/plan/auto-accept even with mode adjustments configured (the acceptance-criteria regression test).
  • Guidance-precedence test (user-edited reminder guidance beats prompts.yaml adjustment beats built-in) and the plan-format contract test live in config/reminders_mode_change_test.go; the legacy-alias tests were removed together with the aliases.
  • cmd/runtime covers the renamed INFER_PROMPTS_AGENT_MODE_ADJUSTMENT_PLAN / _AUTO env vars loading into the mode-adjustment slots.

Verification

  • go vet -tags purego ./..., golangci-lint run --build-tags purego, markdownlint, and go test -race -tags purego ./... all pass.
  • Two pre-existing failures in cmd/runtime/config_pointer_env_test.go (pointer defaults tests) also fail on main at 00f2061 in this runner environment; they are unrelated to this change.

@edenreich

Copy link
Copy Markdown
Contributor

@infer can you finalise the work on this PR? prepare it for a review. use /ponytail:ponytail /go /go-concurrency

Update the PR title and body.

@inference-gateway-maintainer

inference-gateway-maintainer Bot commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor Author

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

Todos

Pull Request

#1135

✅ Infer Result: Success

All skills loaded and followed. Everything is committed, pushed, and the PR is updated. Let me close out the todos:

All done - the PR is finalized, committed, pushed, and ready for review.

What I did

Diagnosed and fixed the failing prepare CI check. It was failing only because go fmt ./... reformatted two files from the salvaged commit (cmd/runtime/config.go env-override map alignment and config/prompts.go struct padding). Fixed with go fmt ./... and committed as style(config).

Validated the whole change against the issue's acceptance criteria, then completed the missing pieces (docs):

  • docs/configuration-reference.md and docs/plan-mode.md now document the agent.mode_adjustment_plan/_auto rename, the legacy system_prompt_plan/_auto keys and INFER_PROMPTS_AGENT_SYSTEM_PROMPT_PLAN/_AUTO env aliases (still load, warn, and lose to the new names), the byte-stable message[0] guarantee, guidance precedence (user-edited reminders.yaml guidance > prompts.yaml mode adjustment > built-in), and the reminders.enabled: false trade-off (mode-change reminder is now the sole carrier of mode instructions, so they are not delivered when reminders are off). Committed as docs(agent): ....

Check results (mirroring CI):

  • go vet -tags purego ./... - pass
  • golangci-lint (purego) + import-alias lint + markdownlint - pass
  • go test -race -tags purego ./... - all green; the only failures are the two pre-existing cmd/runtime pointer-defaults tests (config_pointer_env_test.go), which I verified fail identically on main at 00f2061 in this runner environment - unrelated to this PR (noted in the PR body)

PR housekeeping: retitled to fix(agent): keep the system prompt byte-stable across agent-mode switches (Shift+Tab), rewrote the body with the full summary, back-compat notes, the two deliberately-kept open design questions from #1134, the test list and verification; marked it ready for review. Also filed [DOCS] tracking issue inference-gateway/docs#623 for the cross-repo docs reconciliation.

Deliberately skipped (per the issue's open questions, called out in the PR body): the residual native-tools-array cache miss in plan mode (option 1a accepted) and the compact short-form guidance on repeated flips (open question 5) - both are follow-up material, not blockers.

Model: ollama_cloud/glm-5.3-flash · Exit Code: 0 · Duration: 13m 31s

Tokens: 5,141,891 in · 26,200 out · 5,168,091 total (56 requests)

Tool calls: 69 total · 100% success rate

Traces
Session: 1788186928-ebe81b1a

session (headless, success)                                                 13m24s
├── chat ollama_cloud/glm-5.3-flash                                           3.7s
│   ╰── POST /v1/chat/completions [inference-gateway]                         3.6s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     3.6s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               3.6s
│               ╰── POST /v1/chat/completions [inference-gateway]             3.6s [error: *errors.errorString]
├── execute_tool Read call_jea25pgz                                          263µs
├── execute_tool Read call_rg73pso4                                          267µs
├── execute_tool Bash call_fof7ts6y                                            4ms
├── chat ollama_cloud/glm-5.3-flash                                           3.8s
│   ╰── POST /v1/chat/completions [inference-gateway]                         3.8s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     3.8s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               3.8s
│               ╰── POST /v1/chat/completions [inference-gateway]             3.8s [error: *errors.errorString]
├── execute_tool TodoWrite call_ydmhfhxe                                      74µs
├── execute_tool Bash call_9ddsnlss                                          706ms
├── chat ollama_cloud/glm-5.3-flash                                           2.7s
│   ╰── POST /v1/chat/completions [inference-gateway]                         2.7s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     2.7s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               2.7s
│               ╰── POST /v1/chat/completions [inference-gateway]             2.7s [error: *errors.errorString]
├── execute_tool Bash call_d8b1lgjw                                           10ms
├── execute_tool Bash call_oitljjq3                                          567ms
├── chat ollama_cloud/glm-5.3-flash                                           5.0s
│   ╰── POST /v1/chat/completions [inference-gateway]                         5.0s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     5.0s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               5.0s
│               ╰── POST /v1/chat/completions [inference-gateway]             5.0s [error: *errors.errorString]
├── execute_tool Bash call_0b4v686k                                          830ms
├── chat ollama_cloud/glm-5.3-flash                                           6.4s
│   ╰── POST /v1/chat/completions [inference-gateway]                         6.4s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     6.3s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               6.3s
│               ╰── POST /v1/chat/completions [inference-gateway]             6.3s [error: *errors.errorString]
├── execute_tool TodoWrite call_jsd0995w                                     112µs
├── execute_tool Memory call_co3djz4u                                        157µs
├── chat ollama_cloud/glm-5.3-flash                                           1.8s
│   ╰── POST /v1/chat/completions [inference-gateway]                         1.8s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     1.8s
│           ╰── POST /proxy/:provider/*path [inference-gateway]               1.8s
│               ╰── POST /v1/chat/completions [inference-gateway]             1.8s
├── execute_tool Read call_x405h723                                          151µs
├── chat ollama_cloud/glm-5.3-flash                                           1.8s
│   ╰── POST /v1/chat/completions [inference-gateway]                         1.8s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     1.8s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               1.8s
│               ╰── POST /v1/chat/completions [inference-gateway]             1.8s [error: *errors.errorString]
├── execute_tool Bash call_ts1dipbu                                            5ms
├── chat ollama_cloud/glm-5.3-flash                                           2.3s
│   ╰── POST /v1/chat/completions [inference-gateway]                         2.3s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     2.3s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               2.3s
│               ╰── POST /v1/chat/completions [inference-gateway]             2.3s [error: *errors.errorString]
├── execute_tool Bash call_2weguamq                                            6ms
├── chat ollama_cloud/glm-5.3-flash                                           2.9s
│   ╰── POST /v1/chat/completions [inference-gateway]                         2.9s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     2.9s
│           ╰── POST /proxy/:provider/*path [inference-gateway]               2.9s
│               ╰── POST /v1/chat/completions [inference-gateway]             2.9s
├── execute_tool Bash call_xbm2eose                                            5ms
├── chat ollama_cloud/glm-5.3-flash                                           2.8s
│   ╰── POST /v1/chat/completions [inference-gateway]                         2.8s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     2.8s
│           ╰── POST /proxy/:provider/*path [inference-gateway]               2.8s
│               ╰── POST /v1/chat/completions [inference-gateway]             2.8s
├── execute_tool Bash call_0qjwop5y                                            5ms
├── chat ollama_cloud/glm-5.3-flash                                          16.9s
│   ╰── POST /v1/chat/completions [inference-gateway]                        16.9s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]    16.9s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]              16.9s
│               ╰── POST /v1/chat/completions [inference-gateway]            16.9s [error: *errors.errorString]
├── execute_tool Grep call_sfwn2d13                                          466ms
├── execute_tool Bash call_w9c3sh1h                                           1m2s [error: tool_error]
├── chat ollama_cloud/glm-5.3-flash                                           4.9s
│   ╰── POST /v1/chat/completions [inference-gateway]                         4.8s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     4.8s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               4.8s
│               ╰── POST /v1/chat/completions [inference-gateway]             4.8s [error: *errors.errorString]
├── execute_tool Bash call_ozf0aae1                                          687ms
├── chat ollama_cloud/glm-5.3-flash                                           4.4s
│   ╰── POST /v1/chat/completions [inference-gateway]                         4.4s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     4.3s
│           ╰── POST /proxy/:provider/*path [inference-gateway]               4.3s
│               ╰── POST /v1/chat/completions [inference-gateway]             4.3s
├── execute_tool Bash call_ch1lcf5q                                          40.9s [error: tool_error]
├── chat ollama_cloud/glm-5.3-flash                                           9.8s
│   ╰── POST /v1/chat/completions [inference-gateway]                         9.8s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     9.8s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               9.8s
│               ╰── POST /v1/chat/completions [inference-gateway]             9.8s [error: *errors.errorString]
├── execute_tool Read call_bpujw8l3                                          255µs
├── chat ollama_cloud/glm-5.3-flash                                          10.6s
│   ╰── POST /v1/chat/completions [inference-gateway]                        10.6s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]    10.6s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]              10.6s
│               ╰── POST /v1/chat/completions [inference-gateway]            10.6s [error: *errors.errorString]
├── execute_tool Read call_gdosu3ie                                          160µs
├── chat ollama_cloud/glm-5.3-flash                                          27.9s
│   ╰── POST /v1/chat/completions [inference-gateway]                        27.9s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]    27.9s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]              27.9s
│               ╰── POST /v1/chat/completions [inference-gateway]            27.9s [error: *errors.errorString]
├── execute_tool Grep call_q7vpacku                                            4ms
├── execute_tool Bash call_tsfmeemv                                          423ms [error: tool_error]
├── chat ollama_cloud/glm-5.3-flash                                          11.9s
│   ╰── POST /v1/chat/completions [inference-gateway]                        11.9s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]    11.9s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]              11.9s
│               ╰── POST /v1/chat/completions [inference-gateway]            11.9s [error: *errors.errorString]
├── execute_tool Bash call_np8rrt4t                                           24ms
├── chat ollama_cloud/glm-5.3-flash                                           1.9s
│   ╰── POST /v1/chat/completions [inference-gateway]                         1.8s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     1.8s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               1.8s
│               ╰── POST /v1/chat/completions [inference-gateway]             1.8s [error: *errors.errorString]
├── execute_tool Bash call_s0iwvdm0                                            9ms
├── chat ollama_cloud/glm-5.3-flash                                           2.2s
│   ╰── POST /v1/chat/completions [inference-gateway]                         2.2s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     2.1s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               2.1s
│               ╰── POST /v1/chat/completions [inference-gateway]             2.1s [error: *errors.errorString]
├── execute_tool Bash call_523d15yb                                           1.1s [error: tool_error]
├── chat ollama_cloud/glm-5.3-flash                                           3.8s
│   ╰── POST /v1/chat/completions [inference-gateway]                         3.7s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     3.7s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               3.7s
│               ╰── POST /v1/chat/completions [inference-gateway]             3.7s [error: *errors.errorString]
├── execute_tool Bash call_s88584i7                                           11ms
├── chat ollama_cloud/glm-5.3-flash                                           2.7s
│   ╰── POST /v1/chat/completions [inference-gateway]                         2.7s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     2.6s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               2.6s
│               ╰── POST /v1/chat/completions [inference-gateway]             2.6s [error: *errors.errorString]
├── execute_tool Bash call_kaetbskq                                           18ms
├── chat ollama_cloud/glm-5.3-flash                                           7.5s
│   ╰── POST /v1/chat/completions [inference-gateway]                         7.5s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     7.5s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               7.5s
│               ╰── POST /v1/chat/completions [inference-gateway]             7.5s [error: *errors.errorString]
├── execute_tool TodoWrite call_zgj3h3a1                                      64µs
├── execute_tool Bash call_jakcay0u                                            7ms
├── chat ollama_cloud/glm-5.3-flash                                           4.6s
│   ╰── POST /v1/chat/completions [inference-gateway]                         4.5s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     4.5s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               4.5s
│               ╰── POST /v1/chat/completions [inference-gateway]             4.5s [error: *errors.errorString]
├── execute_tool Bash call_xrnvdhz4                                            3ms
├── chat ollama_cloud/glm-5.3-flash                                           2.3s
│   ╰── POST /v1/chat/completions [inference-gateway]                         2.3s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     2.2s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               2.2s
│               ╰── POST /v1/chat/completions [inference-gateway]             2.2s [error: *errors.errorString]
├── execute_tool Read call_s003x6sk                                          177µs
├── chat ollama_cloud/glm-5.3-flash                                           6.6s
│   ╰── POST /v1/chat/completions [inference-gateway]                         6.6s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     6.6s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               6.6s
│               ╰── POST /v1/chat/completions [inference-gateway]             6.6s [error: *errors.errorString]
├── execute_tool Bash call_gho6bnav                                          56.4s
├── chat ollama_cloud/glm-5.3-flash                                           4.3s
│   ╰── POST /v1/chat/completions [inference-gateway]                         4.2s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     4.2s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               4.2s
│               ╰── POST /v1/chat/completions [inference-gateway]             4.2s [error: *errors.errorString]
├── execute_tool Bash call_ftqx6rma                                          3m21s [error: tool_error]
├── chat ollama_cloud/glm-5.3-flash                                           5.7s
│   ╰── POST /v1/chat/completions [inference-gateway]                         5.7s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     5.7s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               5.7s
│               ╰── POST /v1/chat/completions [inference-gateway]             5.7s [error: *errors.errorString]
├── execute_tool Bash call_6s7n14a4                                          28.7s
├── chat ollama_cloud/glm-5.3-flash                                           7.3s
│   ╰── POST /v1/chat/completions [inference-gateway]                         7.3s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     7.2s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               7.2s
│               ╰── POST /v1/chat/completions [inference-gateway]             7.2s [error: *errors.errorString]
├── execute_tool Grep call_odfmt0tx                                           61ms
├── execute_tool Bash call_hwzq1om2                                            9ms
├── chat ollama_cloud/glm-5.3-flash                                           7.4s
│   ╰── POST /v1/chat/completions [inference-gateway]                         7.4s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     7.3s
│           ╰── POST /proxy/:provider/*path [inference-gateway]               7.3s
│               ╰── POST /v1/chat/completions [inference-gateway]             7.3s
├── execute_tool Grep call_9d7ejpcx                                          307ms
├── chat ollama_cloud/glm-5.3-flash                                           5.1s
│   ╰── POST /v1/chat/completions [inference-gateway]                         5.1s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     5.1s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               5.1s
│               ╰── POST /v1/chat/completions [inference-gateway]             5.1s [error: *errors.errorString]
├── execute_tool Read call_l3efyvlx                                          286µs
├── execute_tool Read call_mq7g3st6                                          367µs
├── chat ollama_cloud/glm-5.3-flash                                           4.0s
│   ╰── POST /v1/chat/completions [inference-gateway]                         4.0s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     4.0s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               4.0s
│               ╰── POST /v1/chat/completions [inference-gateway]             4.0s [error: *errors.errorString]
├── execute_tool Read call_93k43r4k                                          192µs
├── execute_tool Read call_r66l5tw4                                          178µs
├── chat ollama_cloud/glm-5.3-flash                                          13.9s
│   ╰── POST /v1/chat/completions [inference-gateway]                        13.9s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]    13.9s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]              13.9s
│               ╰── POST /v1/chat/completions [inference-gateway]            13.9s [error: *errors.errorString]
├── execute_tool Read call_i2lfhi3m                                          153µs
├── chat ollama_cloud/glm-5.3-flash                                          29.3s
│   ╰── POST /v1/chat/completions [inference-gateway]                        29.3s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]    29.3s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]              29.3s
│               ╰── POST /v1/chat/completions [inference-gateway]            29.3s [error: *errors.errorString]
├── execute_tool MultiEdit call_g4cga49e                                     421µs
├── chat ollama_cloud/glm-5.3-flash                                           4.8s
│   ╰── POST /v1/chat/completions [inference-gateway]                         4.7s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     4.7s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               4.7s
│               ╰── POST /v1/chat/completions [inference-gateway]             4.7s [error: *errors.errorString]
├── execute_tool MultiEdit call_xb9ry6bu                                     273µs
├── chat ollama_cloud/glm-5.3-flash                                          11.4s
│   ╰── POST /v1/chat/completions [inference-gateway]                        11.4s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]    11.4s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]              11.4s
│               ╰── POST /v1/chat/completions [inference-gateway]            11.4s [error: *errors.errorString]
├── execute_tool TodoWrite call_l5fpgcax                                     117µs
├── execute_tool Bash call_zo9i10pc                                           3.0s [error: tool_error]
├── chat ollama_cloud/glm-5.3-flash                                           5.3s
│   ╰── POST /v1/chat/completions [inference-gateway]                         5.2s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     5.2s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               5.2s
│               ╰── POST /v1/chat/completions [inference-gateway]             5.2s [error: *errors.errorString]
├── execute_tool Read call_ema3uuyc                                          143µs
├── chat ollama_cloud/glm-5.3-flash                                           3.9s
│   ╰── POST /v1/chat/completions [inference-gateway]                         3.8s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     3.8s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               3.8s
│               ╰── POST /v1/chat/completions [inference-gateway]             3.8s [error: *errors.errorString]
├── execute_tool MultiEdit call_w3egmpks                                     383µs
├── chat ollama_cloud/glm-5.3-flash                                           2.6s
│   ╰── POST /v1/chat/completions [inference-gateway]                         2.6s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     2.6s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               2.6s
│               ╰── POST /v1/chat/completions [inference-gateway]             2.6s [error: *errors.errorString]
├── execute_tool Bash call_3o6ss53o                                           2.8s
├── chat ollama_cloud/glm-5.3-flash                                           5.1s
│   ╰── POST /v1/chat/completions [inference-gateway]                         5.1s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     5.0s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               5.0s
│               ╰── POST /v1/chat/completions [inference-gateway]             5.0s [error: *errors.errorString]
├── execute_tool Bash call_x1hng70e                                           10ms
├── chat ollama_cloud/glm-5.3-flash                                           2.6s
│   ╰── POST /v1/chat/completions [inference-gateway]                         2.6s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     2.6s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               2.6s
│               ╰── POST /v1/chat/completions [inference-gateway]             2.6s [error: *errors.errorString]
├── execute_tool Bash call_pbsagzq3                                           5.4s
├── chat ollama_cloud/glm-5.3-flash                                           4.5s
│   ╰── POST /v1/chat/completions [inference-gateway]                         4.5s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     4.4s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               4.4s
│               ╰── POST /v1/chat/completions [inference-gateway]             4.4s [error: *errors.errorString]
├── execute_tool Bash call_gtoquzcl                                            9ms
├── chat ollama_cloud/glm-5.3-flash                                           4.2s
│   ╰── POST /v1/chat/completions [inference-gateway]                         4.2s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     4.2s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               4.2s
│               ╰── POST /v1/chat/completions [inference-gateway]             4.2s [error: *errors.errorString]
├── execute_tool Bash call_2ugpq6ft                                            5ms
├── chat ollama_cloud/glm-5.3-flash                                          14.3s
│   ╰── POST /v1/chat/completions [inference-gateway]                        14.2s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]    14.2s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]              14.2s
│               ╰── POST /v1/chat/completions [inference-gateway]            14.2s [error: *errors.errorString]
├── execute_tool Bash call_7tufelf9                                           5.2s
├── chat ollama_cloud/glm-5.3-flash                                           4.5s
│   ╰── POST /v1/chat/completions [inference-gateway]                         4.4s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     4.4s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               4.4s
│               ╰── POST /v1/chat/completions [inference-gateway]             4.4s [error: *errors.errorString]
├── execute_tool Bash call_b2bdb4eb                                            5ms
├── chat ollama_cloud/glm-5.3-flash                                           3.1s
│   ╰── POST /v1/chat/completions [inference-gateway]                         3.1s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     3.0s
│           ╰── POST /proxy/:provider/*path [inference-gateway]               3.0s
│               ╰── POST /v1/chat/completions [inference-gateway]             3.0s
├── execute_tool Bash call_fdcxfehd                                           5.2s
├── chat ollama_cloud/glm-5.3-flash                                           3.6s
│   ╰── POST /v1/chat/completions [inference-gateway]                         3.5s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     3.5s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               3.5s
│               ╰── POST /v1/chat/completions [inference-gateway]             3.5s [error: *errors.errorString]
├── execute_tool Bash call_2sbwvcog                                           1.5s
├── chat ollama_cloud/glm-5.3-flash                                          25.2s
│   ╰── POST /v1/chat/completions [inference-gateway]                        25.2s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]    25.1s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]              25.1s
│               ╰── POST /v1/chat/completions [inference-gateway]            25.1s [error: *errors.errorString]
├── execute_tool WebFetch call_6cnfw4bw                                      111ms
├── chat ollama_cloud/glm-5.3-flash                                           9.4s
│   ╰── POST /v1/chat/completions [inference-gateway]                         9.4s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     9.4s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               9.4s
│               ╰── POST /v1/chat/completions [inference-gateway]             9.4s [error: *errors.errorString]
├── execute_tool Write call_z4z3ae88                                         704µs
├── chat ollama_cloud/glm-5.3-flash                                           3.2s
│   ╰── POST /v1/chat/completions [inference-gateway]                         3.2s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     3.2s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               3.2s
│               ╰── POST /v1/chat/completions [inference-gateway]             3.2s [error: *errors.errorString]
├── execute_tool Bash call_iyw5i3ny                                           1.4s
├── chat ollama_cloud/glm-5.3-flash                                           3.5s
│   ╰── POST /v1/chat/completions [inference-gateway]                         3.5s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     3.5s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               3.5s
│               ╰── POST /v1/chat/completions [inference-gateway]             3.5s [error: *errors.errorString]
├── execute_tool Bash call_gpdgzv7g                                           1.7s
├── chat ollama_cloud/glm-5.3-flash                                           7.7s
│   ╰── POST /v1/chat/completions [inference-gateway]                         7.7s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     7.6s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               7.6s
│               ╰── POST /v1/chat/completions [inference-gateway]             7.6s [error: *errors.errorString]
├── execute_tool Write call_o91hvjvx                                         618µs
├── chat ollama_cloud/glm-5.3-flash                                           3.4s
│   ╰── POST /v1/chat/completions [inference-gateway]                         3.4s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     3.3s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               3.3s
│               ╰── POST /v1/chat/completions [inference-gateway]             3.3s [error: *errors.errorString]
├── execute_tool Bash call_3tzfe8ex                                           1.1s
├── chat ollama_cloud/glm-5.3-flash                                           6.9s
│   ╰── POST /v1/chat/completions [inference-gateway]                         6.8s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     6.8s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               6.8s
│               ╰── POST /v1/chat/completions [inference-gateway]             6.8s [error: *errors.errorString]
├── execute_tool Bash call_68qe3xmu                                            8ms
├── chat ollama_cloud/glm-5.3-flash                                           4.7s
│   ╰── POST /v1/chat/completions [inference-gateway]                         4.6s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     4.6s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               4.6s
│               ╰── POST /v1/chat/completions [inference-gateway]             4.6s [error: *errors.errorString]
├── execute_tool Memory call_lp2l2sv7                                         1.1s
├── chat ollama_cloud/glm-5.3-flash                                           4.3s
│   ╰── POST /v1/chat/completions [inference-gateway]                         4.3s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     4.2s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               4.2s
│               ╰── POST /v1/chat/completions [inference-gateway]             4.2s [error: *errors.errorString]
├── execute_tool TodoWrite call_zfcwa02y                                      75µs
╰── chat ollama_cloud/glm-5.3-flash                                           7.8s
    ╰── POST /v1/chat/completions [inference-gateway]                         7.7s
        ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     7.7s [error: *errors.errorString]
            ╰── POST /proxy/:provider/*path [inference-gateway]               7.7s
                ╰── POST /v1/chat/completions [inference-gateway]             7.7s [error: *errors.errorString]
Stats
Tool Calls

╭───────────┬───────┬───────┬─────────╮
│ Tool      │ Calls │ Fail% │ Avg     │
├───────────┼───────┼───────┼─────────┤
│ Bash      │ 38    │ 16%   │ 11075ms │
│ Read      │ 12    │ 0%    │ 0ms     │
│ TodoWrite │ 5     │ 0%    │ 0ms     │
│ Grep      │ 4     │ 0%    │ 209ms   │
│ MultiEdit │ 3     │ 0%    │ 0ms     │
│ Memory    │ 2     │ 0%    │ 549ms   │
│ Write     │ 2     │ 0%    │ 0ms     │
│ WebFetch  │ 1     │ 0%    │ 111ms   │
╰───────────┴───────┴───────┴─────────╯

Token Usage

╭────────────────────────────┬─────────┬────────┬────────────┬─────────┬──────╮
│ Model                      │ Prompt  │ Cached │ Completion │ Total   │ Cost │
├────────────────────────────┼─────────┼────────┼────────────┼─────────┼──────┤
│ ollama_cloud/glm-5.3-flash │ 5141891 │ 0      │ 26200      │ 5168091 │ -    │
╰────────────────────────────┴─────────┴────────┴────────────┴─────────┴──────╯

Sessions

╭───────────┬──────────┬──────────╮
│ Execution │ Mode     │ Sessions │
├───────────┼──────────┼──────────┤
│ headless  │ headless │ 1        │
╰───────────┴──────────┴──────────╯

Triggered by edenreich · Infer Action · OSS

gofmt the INFER_PROMPTS_AGENT_MODE_ADJUSTMENT_* entries in cmd/runtime/config.go and the struct padding in config/prompts.go; the CI prepare go fmt check flagged both.
…instructions

Update configuration-reference.md and plan-mode.md for the #1134 rename (agent.system_prompt_plan/_auto to agent.mode_adjustment_plan/_auto) with the deprecation and precedence notes, the byte-stable system prompt guarantee, and the reminders.enabled false behavior (mode-specific instructions are not delivered when reminders are off).
@inference-gateway-maintainer inference-gateway-maintainer Bot changed the title fix: resolve #1134 (salvaged) fix(agent): keep the system prompt byte-stable across agent-mode switches (Shift+Tab) Aug 31, 2026
@inference-gateway-maintainer
inference-gateway-maintainer Bot marked this pull request as ready for review August 31, 2026 14:48
@inference-gateway-maintainer
inference-gateway-maintainer Bot requested a review from a team as a code owner August 31, 2026 14:48
@edenreich

Copy link
Copy Markdown
Contributor

@infer remove backward compatibility deprecation notes! no backward compatibility needed. use /ponytail:ponytail YAGNI

@inference-gateway-maintainer

inference-gateway-maintainer Bot commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor Author

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

Todos

  • Read skills (ponytail, go) and repo memories
  • Locate all backward-compat/deprecation code for mode_adjustment rename
  • Remove legacy YAML key aliases, deprecation warnings, legacy env aliases + their tests
  • Update docs and PR body to drop back-compat mentions
  • Run checks (vet, lint, tests, markdownlint), commit, push

Pull Request

#1135

✅ Infer Result: Success

Done. All backward-compatibility and deprecation machinery for the mode-adjustment rename is gone - pushed as 682ec98 on fix/issue-1134, with the PR body rewritten to match.

What was removed (commit refactor(config): drop backward-compat aliases for mode adjustments, -119 lines)

  • config/prompts.go: deleted the whole UnmarshalYAML method that let the old agent.system_prompt_plan / _auto YAML keys decode into the new fields; the gopkg.in/yaml.v3 import went with it. New keys mode_adjustment_plan / mode_adjustment_auto are now the only yaml keys.
  • cmd/runtime/config.go: deleted the deprecated-alias block in applyPromptsEnvOverrides (INFER_PROMPTS_AGENT_SYSTEM_PROMPT_PLAN / _AUTO still loading with a logger.Warn deprecation warning). Only INFER_PROMPTS_AGENT_MODE_ADJUSTMENT_PLAN / _AUTO load now. The pre-existing dead-env warning for INFER_AGENT_SYSTEM_PROMPT_PLAN now points at the renamed var instead of a dead one.
  • Tests: deleted TestLoadConfigFromViper_PromptsModeAdjustmentLegacyEnvAliases and ...RenamedEnvWins; replaced with one ...ModeAdjustmentEnvOverride test covering the renamed vars. In config/prompts_test.go the "legacy and new keys" precedence case is gone and the valid-yaml fixture now uses mode_adjustment_plan directly.
  • Comment references to the deprecated keys removed in config/reminders.go, internal/agent/agent_utils.go, internal/agent/domain/hooks.go (grepped: zero system_prompt_plan|system_prompt_auto|deprecat hits remain outside generated CHANGELOG).
  • Docs: docs/configuration-reference.md lost the "Replaces the deprecated ... still loads" clauses and the issue-[FEATURE] Mode change via Shift+Tab must not swap the system prompt (keep the prompt cache warm) #1134 migration note; docs/plan-mode.md lost the "deprecated key still loads" sentence. The reminders.enabled: false trade-off documentation was kept (it is behavior, not compat).
  • PR body updated: back-compat bullet dropped, "No backward compatibility (YAGNI)" stated instead.

Verification

  • Grep finds zero remaining references; go vet -tags purego ./..., task lint (import aliases + golangci-lint 0 issues. + markdownlint) all clean; go test -race -tags purego ./... passes everywhere except the two pre-existing cmd/runtime/config_pointer_env_test.go pointer-defaults failures that fail identically on main in this runner (documented in the PR body).
  • Full pre-commit gate (mod:tidy, mocks:generate, fmt, lint) ran clean on commit; tree is clean and pushed - nothing uncommitted.

Skipped by design: no rename warning, no fallback, no migration doc - the rename never shipped in a release, so there is nothing to stay compatible with.

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

Tokens: 2,602,704 in · 35,644 out · 2,638,348 total (32 requests)

Tool calls: 57 total · 100% success rate

Traces
Session: 1788187854-a0c33065

session (headless, success)                                                 14m58s
├── chat ollama_cloud/glm-5.3-flash                                           8.6s
│   ╰── POST /v1/chat/completions [inference-gateway]                         8.6s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     8.6s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               8.6s
│               ╰── POST /v1/chat/completions [inference-gateway]             8.6s [error: *errors.errorString]
├── execute_tool Read call_xxfn465k                                          245µs
├── execute_tool Read call_6a582yp6                                          248µs
├── execute_tool TodoWrite call_z6mfbeh8                                      65µs
├── chat ollama_cloud/glm-5.3-flash                                           3.1s
│   ╰── POST /v1/chat/completions [inference-gateway]                         3.1s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     3.1s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               3.1s
│               ╰── POST /v1/chat/completions [inference-gateway]             3.1s [error: *errors.errorString]
├── execute_tool Memory call_o3ejp5rh                                        228µs
├── execute_tool Memory call_wjwsudwo                                        122µs
├── execute_tool Read call_i70lnq58                                          196µs
├── chat ollama_cloud/glm-5.3-flash                                           3.9s
│   ╰── POST /v1/chat/completions [inference-gateway]                         3.9s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     3.9s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               3.9s
│               ╰── POST /v1/chat/completions [inference-gateway]             3.9s [error: *errors.errorString]
├── execute_tool TodoWrite call_z8ru0p66                                      52µs
├── execute_tool Grep call_38zlw5jf                                          706ms
├── chat ollama_cloud/glm-5.3-flash                                           3.5s
│   ╰── POST /v1/chat/completions [inference-gateway]                         3.5s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     3.5s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               3.5s
│               ╰── POST /v1/chat/completions [inference-gateway]             3.5s [error: *errors.errorString]
├── execute_tool Read call_9nywehtj                                          207µs
├── execute_tool Read call_8d883s1l                                          169µs
├── chat ollama_cloud/glm-5.3-flash                                           2.9s
│   ╰── POST /v1/chat/completions [inference-gateway]                         2.9s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     2.9s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               2.9s
│               ╰── POST /v1/chat/completions [inference-gateway]             2.9s [error: *errors.errorString]
├── execute_tool Read call_w225t2kg                                          221µs
├── execute_tool Read call_1fuhf6nd                                          221µs
├── chat ollama_cloud/glm-5.3-flash                                          15.1s
│   ╰── POST /v1/chat/completions [inference-gateway]                        15.1s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]    15.1s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]              15.1s
│               ╰── POST /v1/chat/completions [inference-gateway]            15.1s [error: *errors.errorString]
├── execute_tool Read call_1kxi1fed                                          290µs
├── execute_tool Read call_95bxlbg2                                          294µs
├── execute_tool Read call_pwhlwxru                                          199µs
├── execute_tool Read call_ifcv17tq                                          213µs
├── chat ollama_cloud/glm-5.3-flash                                           2.6s
│   ╰── POST /v1/chat/completions [inference-gateway]                         2.6s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     2.6s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               2.6s
│               ╰── POST /v1/chat/completions [inference-gateway]             2.6s [error: *errors.errorString]
├── execute_tool Read call_y6osck6y                                          175µs
├── execute_tool Read call_aw6s20c5                                          171µs
├── execute_tool Read call_snvzzwcc                                          160µs
├── chat ollama_cloud/glm-5.3-flash                                          13.9s
│   ╰── POST /v1/chat/completions [inference-gateway]                        13.9s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]    13.8s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]              13.8s
│               ╰── POST /v1/chat/completions [inference-gateway]            13.8s [error: *errors.errorString]
├── execute_tool Bash call_9p0j8uv0                                            5ms
├── chat ollama_cloud/glm-5.3-flash                                           6.6s
│   ╰── POST /v1/chat/completions [inference-gateway]                         6.6s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     6.6s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               6.6s
│               ╰── POST /v1/chat/completions [inference-gateway]             6.6s [error: *errors.errorString]
├── execute_tool Grep call_y1c2coi1                                            4ms
├── chat ollama_cloud/glm-5.3-flash                                           3.0s
│   ╰── POST /v1/chat/completions [inference-gateway]                         3.0s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     3.0s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               3.0s
│               ╰── POST /v1/chat/completions [inference-gateway]             3.0s [error: *errors.errorString]
├── execute_tool Read call_waua6pj6                                          167µs
├── chat ollama_cloud/glm-5.3-flash                                           8.1s
│   ╰── POST /v1/chat/completions [inference-gateway]                         8.1s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     8.1s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               8.1s
│               ╰── POST /v1/chat/completions [inference-gateway]             8.1s [error: *errors.errorString]
├── execute_tool TodoWrite call_vr7dp64a                                      71µs
├── execute_tool MultiEdit call_v6qnhnxp                                     709µs
├── chat ollama_cloud/glm-5.3-flash                                          13.4s
│   ╰── POST /v1/chat/completions [inference-gateway]                        13.4s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]    13.4s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]              13.4s
│               ╰── POST /v1/chat/completions [inference-gateway]            13.4s [error: *errors.errorString]
├── execute_tool Edit call_ye44g59u                                          389µs
├── execute_tool MultiEdit call_gq713xcf                                     428µs [error: tool_error]
├── execute_tool MultiEdit call_q5w9xd9t                                     630µs
├── chat ollama_cloud/glm-5.3-flash                                          14.6s
│   ╰── POST /v1/chat/completions [inference-gateway]                        14.6s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]    14.5s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]              14.5s
│               ╰── POST /v1/chat/completions [inference-gateway]            14.5s [error: *errors.errorString]
├── execute_tool Read call_5fy4wybn                                          190µs
├── chat ollama_cloud/glm-5.3-flash                                          39.9s
│   ╰── POST /v1/chat/completions [inference-gateway]                        39.9s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]    39.9s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]              39.9s
│               ╰── POST /v1/chat/completions [inference-gateway]            39.9s [error: *errors.errorString]
├── execute_tool Grep call_1j4mgd1o                                            1ms
├── chat ollama_cloud/glm-5.3-flash                                          1m37s
│   ╰── POST /v1/chat/completions [inference-gateway]                        1m37s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]    1m37s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]              1m37s
│               ╰── POST /v1/chat/completions [inference-gateway]            1m37s [error: *errors.errorString]
├── chat ollama_cloud/glm-5.3-flash                                          57.2s
│   ╰── POST /v1/chat/completions [inference-gateway]                        57.2s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]    57.2s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]              57.2s
│               ╰── POST /v1/chat/completions [inference-gateway]            57.2s [error: *errors.errorString]
├── execute_tool Bash call_hl0zhaoy                                            3ms
├── chat ollama_cloud/glm-5.3-flash                                           1m4s
│   ╰── POST /v1/chat/completions [inference-gateway]                         1m4s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     1m4s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               1m4s
│               ╰── POST /v1/chat/completions [inference-gateway]             1m4s [error: *errors.errorString]
├── execute_tool MultiEdit call_47ea2n77                                     446µs
├── chat ollama_cloud/glm-5.3-flash                                          24.8s
│   ╰── POST /v1/chat/completions [inference-gateway]                        24.7s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]    24.7s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]              24.7s
│               ╰── POST /v1/chat/completions [inference-gateway]            24.7s [error: *errors.errorString]
├── execute_tool Edit call_bs19dvw6                                          651µs
├── execute_tool Edit call_xqvdz69d                                          471µs
├── execute_tool MultiEdit call_dikxlz9z                                     392µs
├── chat ollama_cloud/glm-5.3-flash                                           7.8s
│   ╰── POST /v1/chat/completions [inference-gateway]                         7.8s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     7.8s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               7.8s
│               ╰── POST /v1/chat/completions [inference-gateway]             7.8s [error: *errors.errorString]
├── execute_tool Edit call_pqmjfs0c                                          315µs
├── execute_tool MultiEdit call_kntkat9a                                     472µs
├── chat ollama_cloud/glm-5.3-flash                                           4.2s
│   ╰── POST /v1/chat/completions [inference-gateway]                         4.1s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     4.1s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               4.1s
│               ╰── POST /v1/chat/completions [inference-gateway]             4.1s [error: *errors.errorString]
├── execute_tool Grep call_z4iaugqm                                          138ms
├── execute_tool TodoWrite call_qj8ppqdv                                      73µs
├── execute_tool Bash call_f2n26dyb                                          744ms
├── chat ollama_cloud/glm-5.3-flash                                           7.4s
│   ╰── POST /v1/chat/completions [inference-gateway]                         7.3s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     7.3s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               7.3s
│               ╰── POST /v1/chat/completions [inference-gateway]             7.3s [error: *errors.errorString]
├── execute_tool Bash call_kkmqy63u                                          1m18s
├── chat ollama_cloud/glm-5.3-flash                                           2.6s
│   ╰── POST /v1/chat/completions [inference-gateway]                         2.5s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     2.5s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               2.5s
│               ╰── POST /v1/chat/completions [inference-gateway]             2.5s [error: *errors.errorString]
├── execute_tool Bash call_ap46661m                                          3m17s [error: tool_error]
├── chat ollama_cloud/glm-5.3-flash                                           9.7s
│   ╰── POST /v1/chat/completions [inference-gateway]                         9.6s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     9.6s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               9.6s
│               ╰── POST /v1/chat/completions [inference-gateway]             9.6s [error: *errors.errorString]
├── execute_tool Bash call_bwlde7x6                                          26.9s
├── chat ollama_cloud/glm-5.3-flash                                           2.7s
│   ╰── POST /v1/chat/completions [inference-gateway]                         2.7s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     2.6s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               2.6s
│               ╰── POST /v1/chat/completions [inference-gateway]             2.6s [error: *errors.errorString]
├── execute_tool Bash call_4cy7wxzf                                            9ms
├── chat ollama_cloud/glm-5.3-flash                                          21.0s
│   ╰── POST /v1/chat/completions [inference-gateway]                        21.0s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]    20.9s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]              20.9s
│               ╰── POST /v1/chat/completions [inference-gateway]            20.9s [error: *errors.errorString]
├── execute_tool TodoWrite call_rusg2n18                                      61µs
├── execute_tool Bash call_gftcsyey                                           15ms
├── chat ollama_cloud/glm-5.3-flash                                           2.9s
│   ╰── POST /v1/chat/completions [inference-gateway]                         2.8s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     2.8s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               2.8s
│               ╰── POST /v1/chat/completions [inference-gateway]             2.8s [error: *errors.errorString]
├── execute_tool Bash call_mmt0i1cs                                          1m12s
├── chat ollama_cloud/glm-5.3-flash                                           7.8s
│   ╰── POST /v1/chat/completions [inference-gateway]                         7.7s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     7.7s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               7.7s
│               ╰── POST /v1/chat/completions [inference-gateway]             7.7s [error: *errors.errorString]
├── execute_tool Bash call_uaof12lk                                          265ms
├── execute_tool Bash call_iwvlme6m                                           1.8s
├── chat ollama_cloud/glm-5.3-flash                                          16.5s
│   ╰── POST /v1/chat/completions [inference-gateway]                        16.4s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]    16.4s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]              16.4s
│               ╰── POST /v1/chat/completions [inference-gateway]            16.4s [error: *errors.errorString]
├── execute_tool Write call_y35gh0de                                         731µs
├── chat ollama_cloud/glm-5.3-flash                                           2.6s
│   ╰── POST /v1/chat/completions [inference-gateway]                         2.5s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     2.5s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               2.5s
│               ╰── POST /v1/chat/completions [inference-gateway]             2.5s [error: *errors.errorString]
├── execute_tool Bash call_5lvymwpv                                           1.5s
├── chat ollama_cloud/glm-5.3-flash                                           7.3s
│   ╰── POST /v1/chat/completions [inference-gateway]                         7.3s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     7.3s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               7.3s
│               ╰── POST /v1/chat/completions [inference-gateway]             7.3s [error: *errors.errorString]
├── execute_tool Bash call_dnoqk52t                                            9ms
├── chat ollama_cloud/glm-5.3-flash                                          11.7s
│   ╰── POST /v1/chat/completions [inference-gateway]                        11.7s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]    11.6s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]              11.6s
│               ╰── POST /v1/chat/completions [inference-gateway]            11.6s [error: *errors.errorString]
├── execute_tool Memory call_6ihrjdm2                                         1.2s
├── execute_tool Memory call_fuxpxkro                                         1.2s
├── chat ollama_cloud/glm-5.3-flash                                           5.5s
│   ╰── POST /v1/chat/completions [inference-gateway]                         5.5s
│       ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]     5.5s [error: *errors.errorString]
│           ╰── POST /proxy/:provider/*path [inference-gateway]               5.5s
│               ╰── POST /v1/chat/completions [inference-gateway]             5.5s [error: *errors.errorString]
├── execute_tool TodoWrite call_n0alyid8                                      61µs
╰── chat ollama_cloud/glm-5.3-flash                                          21.4s
    ╰── POST /v1/chat/completions [inference-gateway]                        21.4s
        ╰── POST /proxy/ollama_cloud/chat/completions [inference-gateway]    21.3s [error: *errors.errorString]
            ╰── POST /proxy/:provider/*path [inference-gateway]              21.3s
                ╰── POST /v1/chat/completions [inference-gateway]            21.3s [error: *errors.errorString]
Stats
Tool Calls

╭───────────┬───────┬───────┬─────────╮
│ Tool      │ Calls │ Fail% │ Avg     │
├───────────┼───────┼───────┼─────────┤
│ Read      │ 16    │ 0%    │ 0ms     │
│ Bash      │ 13    │ 8%    │ 29095ms │
│ TodoWrite │ 6     │ 0%    │ 0ms     │
│ MultiEdit │ 6     │ 17%   │ 0ms     │
│ Grep      │ 4     │ 0%    │ 212ms   │
│ Memory    │ 4     │ 0%    │ 590ms   │
│ Edit      │ 4     │ 0%    │ 0ms     │
│ Write     │ 1     │ 0%    │ 0ms     │
╰───────────┴───────┴───────┴─────────╯

Token Usage

╭────────────────────────────┬─────────┬────────┬────────────┬─────────┬──────╮
│ Model                      │ Prompt  │ Cached │ Completion │ Total   │ Cost │
├────────────────────────────┼─────────┼────────┼────────────┼─────────┼──────┤
│ ollama_cloud/glm-5.3-flash │ 2674146 │ 0      │ 43836      │ 2717982 │ -    │
╰────────────────────────────┴─────────┴────────┴────────────┴─────────┴──────╯

Sessions

╭───────────┬──────────┬──────────╮
│ Execution │ Mode     │ Sessions │
├───────────┼──────────┼──────────┤
│ headless  │ headless │ 1        │
╰───────────┴──────────┴──────────╯

Triggered by edenreich · Infer Action · OSS

inference-gateway-maintainer Bot and others added 4 commits August 31, 2026 15:03
The rename of agent.system_prompt_plan/_auto to agent.mode_adjustment_plan/_auto is unreleased, so no compatibility layer is needed (YAGNI). Removes the UnmarshalYAML legacy-key decoding, the deprecated INFER_PROMPTS_AGENT_SYSTEM_PROMPT_PLAN/_AUTO env aliases with their warnings, and the legacy-alias tests; the renamed YAML keys and env vars are now the only way to configure mode adjustments. Docs no longer advertise the deprecated names, and the dead-env warning now points INFER_AGENT_SYSTEM_PROMPT_PLAN at the renamed var.
…ve prompt cache

Plan mode advertised only 8 tool schemas, so a mid-session standard/plan
switch changed the request's tools array and invalidated the provider's
cached prefix despite the byte-stable system prompt from #1134. All
mid-session modes now advertise the full tool list; plan-mode restrictions
are enforced at execution time (recoverable error, mirroring the bash
allow-list), plan-only tools are rejected outside plan mode, and doomed
calls skip the approval prompt. ReadOnly subagents keep their filtered
list. The status-bar tool count now reflects what is actually sent.
@edenreich
edenreich merged commit dab2dae into main Aug 31, 2026
1 check passed
@edenreich
edenreich deleted the fix/issue-1134 branch August 31, 2026 16:18
@inference-gateway-releaser

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 0.186.0 🎉

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 1, 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.

[FEATURE] Mode change via Shift+Tab must not swap the system prompt (keep the prompt cache warm)

1 participant