MiniMax-AI / MiniMax-AI/minimax-code

[Bug]: Hardcoded SKILL_BLOCK_BUDGET_CHARS (20K) silently drops skills from available_skills block

Open
#97 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug desktop needs-triage
Dominant language
TypeScript
Stars
1.3k
Forks
141
Avg merge
2h 45m
Merged PRs (30d)
46

Description

[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

  1. 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.
  2. Create a new session.
  3. Inspect the available_skills block in the system prompt. Some skills are missing — but the skill is still registered and discoverable on disk.
  4. 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

  1. Make SKILL_BLOCK_BUDGET_CHARS configurable (per-agent, in config.yaml or via env var).
  2. Default to a larger value (e.g. 60K-80K) to comfortably support ~100 skills with current average description lengths.
  3. Log a warning when skills are dropped from the block, listing which ones.
  4. 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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at node_modules/@mavis/opencode-plugin/index.js around line 13672 and reproduce the issue with enough globally and per-agent skills to exceed the 20,000-character budget. Inspect how the available_skills block is assembled and how dropped skills are handled; done means installed skills are represented or a clear warning identifies those omitted, with the behavior verified in a new-session reproduction.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
ai
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.