[Bug]: Hardcoded SKILL_BLOCK_BUDGET_CHARS (20K) silently drops skills from available_skills block
Description
The available_skills block injected into the agent's system prompt has a hardcoded character budget of 20,000 chars (SKILL_BLOCK_BUDGET_CHARS = 2e4 in node_modules/@mavis/opencode-plugin/index.js, around line 13672). When the total size of all registered skill descriptions exceeds this budget, the surplus skills are silently dropped from the block — the agent has no idea they exist, no warning is logged for the user or developer, and the system falls back to alternative tools (e.g. cloud MCP servers) without any signal.
Reproduction
- Install enough skills (registered both globally under
~/.mavis/skills/ and per-agent under ~/.mavis/agents/<agent>/skills/) so that the total description length exceeds 20K chars. ~48 skills with average description length ~425 chars is enough.
- Create a new session.
- Inspect the
available_skills block in the system prompt. Some skills are missing — but the skill is still registered and discoverable on disk.
- The agent will not know the dropped skill exists and will fall back to other tools (in our case, the cloud Matrix
transcribe_audio MCP tool, even though a local voice-transcriber skill was installed and working).
Expected
- The agent should be aware of every installed skill, or at least emit a clear warning when one is dropped from the system prompt.
- The user can configure or otherwise scale the budget to support at least 100 skills (as is common in mature agents).
- Or, switch to a lazy / on-demand model: keep a compact manifest in the system prompt, and inject the full
SKILL.md content only when the description matches the current request.
Suggested fix
- Make
SKILL_BLOCK_BUDGET_CHARS configurable (per-agent, in config.yaml or via env var).
- Default to a larger value (e.g. 60K-80K) to comfortably support ~100 skills with current average description lengths.
- Log a warning when skills are dropped from the block, listing which ones.
- Long-term: lazy-load skills by description match instead of injecting the full block up front.
Real-world impact we observed
- A
voice-transcriber skill (local mlx-whisper + whisper-large-v3-turbo for Telegram voice messages) was installed and registered, but silently dropped from the system prompt because it sorts last alphabetically and the budget had already been consumed.
- The agent defaulted to a cloud MCP transcription tool, which:
- Adds latency and external API cost
- Routes audio through a third party (privacy regression vs. local STT)
- Occasionally returned the STT model's default refusal string on short clips
- Only after the user explicitly mentioned the skill and the agent manually loaded it via the
skill tool did the local path activate.
- This is a quiet correctness/UX issue: the user's explicit configuration was overridden by a silent budget cap.
Environment
- Mavis (minimax-code) installed via the official macOS app
- 48 skills registered (mix of
source_type: user-mavis global and agent-scope)
- Model: MiniMax-M3
- Session type: root, channel Telegram
- Skill was registered before session start; new session did not pick it up
Workaround
Until fixed, call the skill tool by name to force-load a dropped skill. This works but requires the user/agent to know the skill is missing in the first place, which is the core issue.
[Bug]: Hardcoded SKILL_BLOCK_BUDGET_CHARS (20K) silently drops skills from
available_skillsblockDescription
The
available_skillsblock injected into the agent's system prompt has a hardcoded character budget of 20,000 chars (SKILL_BLOCK_BUDGET_CHARS = 2e4innode_modules/@mavis/opencode-plugin/index.js, around line 13672). When the total size of all registered skill descriptions exceeds this budget, the surplus skills are silently dropped from the block — the agent has no idea they exist, no warning is logged for the user or developer, and the system falls back to alternative tools (e.g. cloud MCP servers) without any signal.Reproduction
~/.mavis/skills/and per-agent under~/.mavis/agents/<agent>/skills/) so that the total description length exceeds 20K chars. ~48 skills with average description length ~425 chars is enough.available_skillsblock in the system prompt. Some skills are missing — but the skill is still registered and discoverable on disk.transcribe_audioMCP tool, even though a localvoice-transcriberskill was installed and working).Expected
SKILL.mdcontent only when the description matches the current request.Suggested fix
SKILL_BLOCK_BUDGET_CHARSconfigurable (per-agent, inconfig.yamlor via env var).Real-world impact we observed
voice-transcriberskill (localmlx-whisper+whisper-large-v3-turbofor Telegram voice messages) was installed and registered, but silently dropped from the system prompt because it sorts last alphabetically and the budget had already been consumed.skilltool did the local path activate.Environment
source_type: user-mavisglobal and agent-scope)Workaround
Until fixed, call the
skilltool by name to force-load a dropped skill. This works but requires the user/agent to know the skill is missing in the first place, which is the core issue.