Repository navigation
[Bug] agent prompt tool scopes leak full GitHub tool catalog #526
Copy link
Copy link
Description
Summary
Agent prompt dumps show tool-call catalogs are not scoped per agent/module. Multiple agents receive the full GitHub tool list instead of only the tool functions relevant to their assigned module, and Gmail tools are not visible despite Gmail being connected.
Problem
What happened:
- Prompt dumps for different agents include a massive GitHub tool catalog regardless of agent role.
- Agent-specific tool sections are effectively not filtered by assigned module/function.
- Gmail is connected, but Gmail tool calls are not exposed/visible in prompts where expected.
What was expected:
- Each agent should only receive tool functions relevant to its assigned module/scope.
- Connected integrations should surface their corresponding tool sets (e.g., Gmail tools should appear when Gmail is connected/authorized).
- Prompt tool rendering should be consistent across agent identities (main, welcome, orchestrator, etc.).
Impact:
- Increased prompt bloat and higher token cost.
- Coordination quality drops because agents see irrelevant tools.
- Integration UX is confusing (GitHub dominates; Gmail appears missing).
Steps to reproduce:
- Use a setup with GitHub and Gmail connected.
- Run onboarding / multi-agent flow.
- Inspect prompt dumps under
prompt-dumps/*(examples from20260413T050050Z):1_main.md2_orchestrator.md13_welcome.md
- Compare each agent's tool section and connected integration rendering.
- Observe repeated full GitHub tool catalog in multiple agent prompts and missing expected Gmail tools.
Version / platform:
- Observed in desktop/dev environment from local prompt dumps.
Solution (optional)
Potential fixes:
- Enforce per-agent tool allowlist at prompt-construction time.
- Render integration tools by connected provider with strict filtering by agent scope.
- Add diagnostics logging showing: connected integrations -> resolved toolkits -> final tool schemas per agent.
Acceptance criteria
- Scoped tool rendering — Each agent prompt contains only tools allowed for that agent/module.
- Integration parity — Connected Gmail integration yields visible Gmail tool schemas where applicable.
- No cross-agent leakage — Welcome/orchestrator and other agents no longer receive unrelated full GitHub catalogs.
- Regression safety — Add tests for prompt builder/tool resolution covering multi-agent scoping and multi-integration rendering.
Related
- Prompt dump examples:
prompt-dumps/20260413T050050Z/1_main.md,2_orchestrator.md,13_welcome.md - Related onboarding routing issue: [Bug] onboarding flow keeps using main agent instead of welcome/orchestrator #525
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
- StatusShow more project fieldsDone
Activity
feat(agent): add subagents + delegate_name fields to AgentDefinition (t…
feat(agent): drive orchestrator delegation tools from TOML subagents (t…
feat(agent): plumb per-agent tool scoping through bus + tool loop (ti…
feat(dispatch): route channel messages to welcome/orchestrator by onb…
feat(debug_dump): apply orchestrator definition filter to main dump (t…
test(dispatch): unit tests for build_visible_tool_set + cargo fmt cle…
feat(agent): welcome->orchestrator routing + per-agent tool scoping (#…
fix(agent): thread agent_id into build_session_agent_inner
fix(agent): thread agent_id into build_session_agent_inner (#584)
feat(agent): welcome->orchestrator routing + per-agent tool scoping (t…
fix(agent): thread agent_id into build_session_agent_inner (tinyhuman…
feat(agent): welcome->orchestrator routing + per-agent tool scoping (t…
fix(agent): thread agent_id into build_session_agent_inner (tinyhuman…
chore(vendor): bump tinyagents for the run-state block and the agent'…