Skip to content

[Bug]: delegate_task lets an agent run a pay-per-token OpenRouter model with no cost signal — spent ~$150 of user credits unasked #40712

Closed as not planned

Description

@crakjack

Area: apps/server

What happened
orchestrator_capabilities listed the OpenCode provider with one model, openrouter/google/gemini-4-neon, labelled only "Gemini 4 Neon". Nothing in the catalog said it bills OpenRouter credits per token. A Claude agent in a T3 thread used it as one of three review judges (via delegate_task, provider opencode) for about 23 long reviews over one day. Each review read a large document and browsed the web, and together they used up the whole OpenRouter balance (about $150). The user expected judges to run on their subscriptions (Claude Hub, Codex Hub, Antigravity) and never approved OpenRouter spend. The first sign was the child failing with:

Prompt tokens limit exceeded: 321362 > 291380. To increase, visit https://openrouter.ai/settings/credits and add more credits

Steps to reproduce

  1. Enable the OpenCode provider with an OpenRouter API key in OpenCode's auth.
  2. Call orchestrator_capabilities: the OpenCode entry shows openrouter/... models with labels only, no billing source or cost.
  3. Call delegate_task with providerInstanceId: "opencode" and an openrouter/... model.
  4. The child runs and bills OpenRouter with no prompt, cap or warning to the user.

Expected behavior
Pay-per-token routes are clearly marked in orchestrator_capabilities (for example a billing: "metered" field), and delegate_task on a metered route asks the user (or needs a per-provider opt-in / spend cap) before starting, at least the first time per thread.

Actual behavior
Metered and subscription routes look identical to the agent and to the delegation API. The only signal was the provider failing once the credits ran out.

Impact
Real money lost (~$150) with no user approval. Any agent that picks a model by name can do this.

Version: 0.1.12-nightly.20261122.5071 (desktop, macOS)

Environment: macOS (Darwin 27.2), parent agent Claude Code (Opus 5.5) inside T3; child provider OpenCode → OpenRouter google/gemini-4-neon.

Workaround
Disable the OpenCode provider in T3, and a user-level PreToolUse hook in Claude Code that denies any mcp__t3-code__* call whose input mentions openrouter.

Activity

  1. juliusmarminge commented on Nov 22, 2026

    @juliusmarminge
    Member

    Thanks for writing this up. It asks for new behaviour rather than reporting a defect, so it does not belong in the bug tracker and I'm closing it as not planned here. Feature ideas are discussed in Discussions: please post it there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions