Skip to content

Feature: configurable tool scopes for sub-agents (reduce prompt bloat for small models) #21698

Description

@Jimmysnielsen

Feature Request

Allow sub-agent spawns to specify a tool scope to reduce system prompt size for small/local models.

Problem

Sub-agents receive the full tool definition set (~20+ tools) in their system prompt, consuming thousands of tokens. For local models with limited context (8-16K) and output caps (4K), this leaves insufficient room for reasoning and response generation.

A Qwen3 30B sub-agent tasked with "edit one line in a file" gets definitions for browser, cron, message, nodes, canvas, tts, etc. — none of which it needs. The model then spends its limited output budget on thinking tokens before it can even make a tool call.

Proposed Solution

Add a tools or toolScope parameter to sub-agent spawning:

{
  "task": "Edit the DND section in AGENTS.md",
  "model": "ollama/qwen3:30b-a3b-16k",
  "toolScope": "files"
}

Possible scopes:

  • files — read, write, edit only (~minimal prompt overhead)
  • shell — read, write, edit, exec, process
  • web — web_search, web_fetch, browser
  • full — everything (current default)
  • none — no tools, text-in text-out only
  • Or explicit list: ["read", "write", "edit"]

Impact

  • Makes local models (8-16K context) viable for tool-using sub-agent tasks
  • Reduces token waste on irrelevant tool definitions
  • Faster prefill = faster time-to-first-token
  • Could also benefit cloud model sub-agents (cheaper, faster)

Current Workaround

Use cloud models (Mistral, Sonnet) for tool-using sub-agents, reserve local models for text-only tasks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    staleMarked as stale due to inactivity

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions