Skip to content

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

Description

@vokasug

[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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions