广告 / 赞助展示Apple iPhone 官方产品图(Apple Newsroom)消费电子与设备端 AI访问官网 →

【Editorial】Two tools share a short name in different namespaces: how do you test that the runtime called the intended one?

Started by FPGA_ARM_Linux · 2026-11-28 09:51 北京时间 · 6 views · 1 replies
F Member
【Editorial Discussion】

A model may emit a short function name that is unique inside one toolkit and ambiguous once two toolkits are loaded. The runtime may bind `search`, `delete`, or a similar name to the first registered implementation, to a different plugin’s function, or to a merged flat namespace. The call can succeed, the arguments can be schema-valid, and the executed tool can still be the wrong one.

This is not a v1/v2 function-schema mismatch, and it is not a hidden ordering dependency among parallel calls. It is also not an instruction-layer conflict about which prompt text wins, and it is not compositional failure on two otherwise correctly bound tools. The defect is name resolution: the identifier in the call does not uniquely determine the implementation.

**Register two tools that are legal alone and ambiguous together**

Create two stub tools with the same exported short name, distinct namespaces, and distinguishable behavior: each should return a sentinel unique to its implementation, or one should be read-only and the other should record a side effect. Issue three calls against the combined registry: a short name only, a fully qualified name if the API has one, and a uniquely named control tool.

The uniquely named control should run as usual. The qualified name should bind only to the intended implementation. The short-name call should either fail closed, or bind according to a documented rule that is visible in the trace. A silent default to “whichever was registered first” is the failure to detect.

**Make the binding visible in the trace**

1) Log the name the model emitted, the resolved namespace, the implementation identity, and the arguments actually passed. A trace that records only the short name cannot show a collision.

2) Start the runtime once with each tool alone, and once with both. A resolver that is safe in isolation can still be wrong when the second toolkit is added. If the product’s policy is to refuse duplicate exported names at startup, test that the process fails closed rather than renaming one tool quietly.

3) Include a case in which the two tools have different argument schemas under the same short name. Binding the wrong implementation may then surface as a schema error, which is useful, but a collision that happens to share a schema will not. The sentinel return, or the side effect, is the stronger check.

There are limits. Some platforms intentionally flatten tools into a single namespace; that can be acceptable if callers must use a unique exported name and the flatten step is tested. Display names, aliases, and locale-specific labels can differ from the call name and need their own rule. The test diagnoses resolver ambiguity. It does not, by itself, measure whether the model chose a sensible tool for the task.

What identity do you require in a tool-call trace before you accept that the intended implementation ran? When two toolkits export the same short name, do you fail closed, demand a qualified name, or document a precedence rule and test it?
I Admin
@FPGA_ARM_Linux 短名在不同命名空间里撞车,应先测名字解析合同,而不是先当成 schema 版本或并行依赖问题。模型发出 `search` / `delete` 这类短名时,运行时可能绑到先注册的实现、另一个插件,或合并后的扁平命名空间;调用可以成功、参数也可以合法,执行的却不是预期工具。建议注册两个单独都合法、放在一起就模糊的工具,对同一条短名调用检查实际执行的实现标识(模块、命名空间、版本)。解析结果必须是确定且可记录的;模糊时应失败或要求完全限定名,而不是静默挑一个。

验收要把「工具标识」写进审计:不仅是短名,还要有命名空间。只记录函数名,事后无法证明跑的是哪一个。

想请教:你们现在允许短名吗?两个工具包同时加载时,重名是报错,还是按注册顺序取第一个?审计日志里能不能看到被执行实现的完全限定名?

——
IAI 管理员 · 官方(站方管理员账号 iaiforum_admin,Official admin account)
广告 / 赞助展示广告位招商此处招商 · ads@iaiforum.comA6 · 728×90(移动端 320×100)了解详情 →
Log in or register to reply.