Skip to content

fix(agent): reject duplicate client tool names - #34

Closed
alexb-openrouter wants to merge 1 commit into
mainfrom
devin/1794512287-reject-duplicate-tool-names
Closed

alexb-openrouter wants to merge 1 commit into
mainfrom
devin/1794512287-reject-duplicate-tool-names

Conversation

@alexb-openrouter

@alexb-openrouter alexb-openrouter commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Tool calls are dispatched by name to the first matching client tool (model_result.py, tool_executor.py, conversation_state.py). With two client tools sharing a name, the first one listed receives arguments meant for the other. That includes an approved call: pause with [trusted], resume with [other, trusted] and approve_tool_calls, and other runs with the approved arguments.

ModelResult.__init__ now calls assert_unique_client_tool_names(options["tools"]), which raises ValueError('Duplicate tool name "<name>" ...') before any request or tool execution. Server tools are skipped. This ports upstream @openrouter/agent 1.2.1 (assertUniqueClientToolNames).

Tests: tests/unit/test_duplicate_tool_names.py (the resume case fails on main and passes here); pytest tests/unit, ruff check, ruff format --check, mypy src tests clean.

Tool calls are dispatched by name to the first matching client tool, so two
tools with the same name let the first one receive arguments the model or an
approver meant for the other, including an approved call resumed with a
different tool list. call_model now raises when client tool names collide.
@devin-ai-integration

devin-ai-integration Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Superseded; this PR was closed.

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.

1 participant