Bug: Second Tool from Custom Plugin Not Exposed to Agents (Possible Race Condition)
A new bug report in GitHub issue #29476 documents a frustrating edge case: when a custom plugin registers multiple tools, only the first tool becomes available to agents. The second registration silently fails to expose.
The Problem
A developer building a custom voice-call-local plugin registered two tools using identical patterns:
// โ
This works
api.registerTool({
name: "voice_call",
label: "Voice Call",
description: "Make phone calls...",
parameters: VoiceCallToolSchema,
async execute(toolCallId, params) { /* ... */ }
});
// โ This never shows up
api.registerTool({
name: "make_call",
label: "Make Call (Smart)",
description: "Make a phone call with guaranteed quality...",
parameters: MakeCallToolSchema,
async execute(_toolCallId, params) { /* ... */ }
});The plugin loads successfully. Logs show no errors. But make_call simply never appears in the agent's available tools.
Extensive Debugging
The developer went through systematic isolation tests:
- Config verification โ No
tools.allow/tools.denyrestrictions, no per-agent overrides, plugin in allowlist - Schema swap test โ Replaced
make_callwith the exact same schema asvoice_call. Still invisible. - Separate plugin test โ Created a minimal two-tool plugin. Result: plugin quarantined (inconclusive)
The Hypothesis: Tool Registry Race Condition
This bug may be related to issue #25692, which documented "all agent tools unavailable after gateway restart." That issue revealed timing problems where:
- Gateway starts before tool registry is ready
- Sessions connect before tools are registered
The current bug may be a variant: the tool registry doesn't correctly handle multiple registerTool() calls from the same custom plugin. The first call wins, subsequent calls are lost.
What This Means for Plugin Developers
If you're building custom plugins with multiple tools and hitting this issue:
- Verify it's not your schema โ Try swapping to a known-working schema
- Check for name collisions โ Make sure bundled plugins don't use your tool names
- Watch for quarantine โ If your plugin lands in
_quarantine/, check dependencies - Workaround โ For now, consider wrapper scripts outside the tool system, or splitting tools across multiple plugins (if that works)
Current Status
No fix yet. No workaround confirmed. The issue needs triage to determine whether this is:
- A race condition in tool registry startup
- A bug specific to custom (non-bundled) plugins registering multiple tools
- A tool indexing/caching issue that drops subsequent
registerTool()calls
If you've hit this bug or found a workaround, add your findings to the GitHub issue. More repro data helps narrow down the root cause.
Comments (0)
No comments yet. Be the first to comment!