When a tool config declares a custom tool whose name collides with a Pi built-in (for example a code tool named read), the SDK's ToolResolver rejects it with ReservedToolNameError. But the check runs last: resolve() first resolves the code tools' secrets and calls the workflow, platform, and gateway adapter resolvers, and only then validates names (_validate_unique_names(tool_specs) at sdks/python/agenta/sdk/agents/tools/resolver.py line 229; the reserved-name check itself is lines 90-96).
What a caller sees today:
- A reserved-named
code tool with a missing secret surfaces MissingToolSecretError instead of ReservedToolNameError, pointing the author at the wrong problem.
- A reserved-named gateway, reference, or platform tool still reaches its adapter (secret lookups, network calls) before rejection, so the resolver does work for a payload that will always be refused.
The rejection still always happens before any specs leave resolve(), so no reserved name reaches the runner. This is error-precedence and wasted-work hygiene, not a bypass. Declared custom tool names should be validated up front, before secret lookup and adapter resolution, while the final _validate_unique_names(tool_specs) call stays to cover adapter-produced spec names.
Follow-up from a review comment on #5651: #5651 (comment)
When a tool config declares a custom tool whose name collides with a Pi built-in (for example a
codetool namedread), the SDK'sToolResolverrejects it withReservedToolNameError. But the check runs last:resolve()first resolves the code tools' secrets and calls the workflow, platform, and gateway adapter resolvers, and only then validates names (_validate_unique_names(tool_specs)atsdks/python/agenta/sdk/agents/tools/resolver.pyline 229; the reserved-name check itself is lines 90-96).What a caller sees today:
codetool with a missing secret surfacesMissingToolSecretErrorinstead ofReservedToolNameError, pointing the author at the wrong problem.The rejection still always happens before any specs leave
resolve(), so no reserved name reaches the runner. This is error-precedence and wasted-work hygiene, not a bypass. Declared custom tool names should be validated up front, before secret lookup and adapter resolution, while the final_validate_unique_names(tool_specs)call stays to cover adapter-produced spec names.Follow-up from a review comment on #5651: #5651 (comment)