Skip to content

fix: default system prompt so the gateway skips the 7K-token cmd agent prompt - #2

Merged
seankoji merged 1 commit into
mainfrom
fix/default-system
Sep 28, 2026
Merged

seankoji merged 1 commit into
mainfrom
fix/default-system

Conversation

@seankoji

Copy link
Copy Markdown

Summary

  • When a request has no system message, the gateway substitutes the Command Code cmd agent prompt, about 7.3K tokens: coding-agent persona, CLI tools (file edit, bash, explore sub-agent), commit rules and a taste file.
    • Every system-less call pays for it, and the model is told it has tools it can't use.
    • Measured on GLM-5.3: 7,378 prompt tokens with no system message, 20–23 with a one-line system prompt.
  • The proxy now sends a one-line default (You are a helpful assistant., overridable via PCMC_DEFAULT_SYSTEM) when the system message is missing or blank. Blank isn't an option: MiniMax rejects it with "The system field can't be blank".
  • Requests that already carry a system prompt are unchanged.

Test plan

  • npm test: 7/7 pass, including a new default-system test
  • Live through LiteLLM on the NAS: GLM-5.3 and MiniMax-M2.5 with a one-line system prompt use 20–26 prompt tokens; without one, about 7.3K

🤖 Generated with Claude Code

…cmd agent prompt

Without params.system the gateway substitutes the ~7.3K-token Command Code
CLI agent prompt (measured 7,378 prompt tokens vs 20 with a one-line system
prompt on GLM-5.3), costing tokens on every call and steering the model to
act as a coding agent with tools it does not have. MiniMax rejects a blank
system, so default to a real one-liner, overridable via PCMC_DEFAULT_SYSTEM.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@seankoji
seankoji merged commit d01be09 into main Sep 28, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant