Skip to content

fix: honor IGNORE_ON_ENTER for tools inside a Toolset - #6361

Merged
longcw merged 1 commit into
mainfrom
longc/toolset-ignore-on-enter
Jul 9, 2026
Merged

fix: honor IGNORE_ON_ENTER for tools inside a Toolset#6361
longcw merged 1 commit into
mainfrom
longc/toolset-ignore-on-enter

Conversation

@longcw

@longcw longcw commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Closes #6354

ToolFlag.IGNORE_ON_ENTER was only honored for bare FunctionTool/RawFunctionTool instances in the on_enter reply filter — tools nested in a Toolset (e.g. EndCallTool) passed through unfiltered, so the model could fire a speculative end_call during the greeting turn (with delete_room=True, an instant hangup at pickup).

The filter now flattens toolsets and hides flagged tools via ToolContext._exclude, which drops them from the callable/LLM-visible set while keeping the owning toolset in place so executor routing and lifecycle are unaffected. Rather than threading the ignored set through the reply tasks, _on_enter_ignored_tools reads the on_enter contextvar directly; the reply task and its tool-response follow-ups inherit it through asyncio.create_task.

The realtime path is covered too: it only overrides its session tools when generate_reply is given tools=, so inside on_enter it now falls back to the agent's full set and hides flagged tools even without an explicit tools=.

EndCallTool gains an ignore_on_enter parameter (defaults to False, preserving current behavior) to opt into hiding end_call during the greeting.

@longcw
longcw requested a review from a team as a code owner July 9, 2026 07:18

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Open in Devin Review

@longcw
longcw merged commit 5010a5c into main Jul 9, 2026
26 checks passed
@longcw
longcw deleted the longc/toolset-ignore-on-enter branch July 9, 2026 12:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ToolFlag.IGNORE_ON_ENTER is silently ignored for tools inside a Toolset (e.g. EndCallTool)

2 participants