Skip to content

feat: add core-tool warm start and dynamic tool discovery to avoid full-schema prompt bloat #220

@huangrichao2020

Description

@huangrichao2020

Scenario

This is not exactly a bug, and developers can work around it themselves, but it would be better if GA had a native mechanism to control the system prompt/tool prompt size.

As GenericAgent gains more tools, injecting the full tool schema into the prompt on every startup or every request will quickly make the prompt too long, slow down startup, waste tokens, and make the model navigate through many irrelevant tools.

In real use, many tasks only need core tools: file read/write, command execution, file search, messaging, and status queries. Long-tail tools should be discovered and loaded on demand.

Current Pain Points

  • The full tool schema goes directly into the prompt, making the initial context heavy.
  • Even a simple status query carries the entire tool list.
  • The more tools are added, the slower the base experience becomes.
  • The model is more likely to choose irrelevant tools because tool selection cost increases.

Suggested Direction

Introduce “core tool warm start + dynamic discovery”:

  • Inject only core tools by default: files, commands, search, messages, task status, and tool discovery.
  • Add meta tools such as tool_search / tool_manifest so the model can retrieve tools as needed.
  • Build an index cache for tool schemas and load them by domain/keyword.
  • Keep short schemas for high-frequency tools and only summaries for low-frequency tools.
  • Once a tool is selected during the session, inject its full schema or execute its adapter.

The skill system already has a similar idea with “index cache + prompt summary limit”: provide a small summary first, expand only when needed. The tool system could follow the same pattern so the base prompt does not grow linearly with the number of tools.

Acceptance Criteria

  • The initial prompt for normal chat/status queries becomes significantly shorter.
  • Core tools remain usable without an extra discovery step.
  • Long-tail tools can be found and executed through tool search.
  • Adding more tools does not linearly increase the base prompt size.

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