Skip to content

Default Explore agent's hardcoded claude-haiku-4-5 pin silently routes subagents to a different provider quota than the session #175

Description

@DraconDev

Bug

src/default-agents.ts:40 pins model: "anthropic/claude-haiku-4-5" on the default Explore agent. Model resolution in src/agent-runner.ts:720 is:

const model = options.model ?? resolveDefaultModel(
  ctx.model, ctx.modelRegistry, agentConfig?.model,
);

agentConfig.model always wins over the parent session model. The README describes this as "haiku (falls back to inherit)", but the fallback in resolveDefaultModel only triggers when the model is absent from the registry — not when it is present but quota-exhausted.

Impact

On a session running a non-Anthropic model (e.g. minimax/MiniMax-M3), every Explore spawn silently goes to claude-haiku-4-5 — a different provider with a separate quota pool. When that pool is a capped key (OpenRouter free tier), a few concurrent Explore spawns exhaust it:

▸ Explore  Audit SPEC §9 audio
✗ anthropic: claude haiku 4.5 · ↻1
⎿  Error: 403: {"message":"Key limit exceeded (total limit)..."}

All subagents fail while the parent session is completely unaffected — and the parent LLM has no idea why, since nothing surfaces "your subagents are on a different provider" anywhere.

Suggested fixes (in increasing order of preference)

  1. Document the override path more prominently. The native fix exists (user .md with the same name, no model: → inherits parent), but discovery requires reading agent-runner.ts. (For reference, this is what we now do downstream.)

  2. Add a first-class per-agent model setting to subagents.json (e.g. modelOverrides: { "Explore": "provider/id" } and/or modelStrategy: "inherit-parent") so wrappers and users do not have to manage .md files that duplicate the default system prompt (staleness liability).

  3. Best: retry-spawn-with-parent-model on quota errors. When a subagent spawn/turn fails with 403 Key limit exceeded / 429, transparently retry the spawn with the parent session model instead of failing the agent run. Quota exhaustion is exactly the case where "cheap search model" should degrade to "whatever the session is using" — the work matters more than the model tier.

Environment

  • pi-subagents 0.14.3
  • pi-coding-agent (latest), session model minimax/MiniMax-M3, claude-haiku-4-5 resolved via OpenRouter

Downstream context: we worked around this in pi-goal-list-loop-audit@0.24.6 by managing ~/.pi/agent/agents/Explore.md without the model pin (with a drift test against your default-agents.ts). Happy to upstream any part of that if useful.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions