Skip to content

fix(runtime): complete ToolSearch prefix stability across providers - #1376

Closed
zszz3 wants to merge 5 commits into
vastsa:mainfrom
zszz3:codex/fix-toolsearch-provider-followup
Closed

zszz3 wants to merge 5 commits into
vastsa:mainfrom
zszz3:codex/fix-toolsearch-provider-followup

Conversation

@zszz3

@zszz3 zszz3 commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

问题与修改

#1355 合入了 #1325 较早的版本,固定工具清单仍只对官方 Flash 生效,遗漏了后续跨接口补丁。本 PR 补回这些提交,并对齐最新 main 的 Pi 1.0.1;不会重做已经合入的 system/Skill 持久化改动。

  • 按实际绑定的协议能力选择:已验证的 Responses/Codex、Kimi、Pi Messages 保留原生增量;Pi 1.0.1 的 Claude 原生工具变更现已使用完整定义内联,同样保留按需追加,不在首轮预装完整目录。只有 system 支持、没有工具增量能力的 Claude 等接口不能走这条路径。
  • 其余 Chat Completions、Responses/Codex、Claude、Gemini 和兼容中转采用稳定的完整工具清单,ToolSearch 仅改变激活状态。首次请求会变大;这不是无成本优化,也不承诺短会话更便宜。
  • 发送前剔除 Desktop 私有 tool_activation 元数据,防止折叠 system 的适配器因激活状态变化再次改写前缀;完整记录仍用于保存和恢复。
  • 未激活调用仍在扩展/Host 前拒绝,激活不绕过模式、审批或权限。保留重启、压缩、撤销和 schema/account/route 失效语义,以及 128 工具与上下文预算超限时的按需回退。

验证

最终候选 6492b63aed71,基于 3c2291bd1a0d。复用现有工作树开发环境和共享 Cargo target;main 升级 Pi 1.0.1 后按冻结锁文件增量更新现有依赖,没有另建测试环境。

  • 6 类 Desktop 可选协议、12 种能力分支:真实 runtime 用户入口 → 搜索 A → 执行 A → 搜索 B → 执行 B;在真实 Pi 适配器发送边界捕获序列化请求。检查初始工具清单、系统指令、历史语义前缀,以及原生路径首轮不声明后续工具。Claude 路径另外断言后续出现 tool_definition。
  • 旧 main 策略在策略/适配器测试中 12 项失败;修复后通过。Pi 1.0.1 下错误地固定 Claude 原生路径的策略也先失败,再由新增能力分支修复。
  • Runtime 全量 1,253 项通过。桌面及其余工作区测试:桌面 3,487 项及其余工作区测试通过。
  • JS 构建、Desktop 类型检查、lint、文档检查、Pi 依赖/补丁检查、Host 构建通过。
  • 最终提交上 Host + production sidecar + 本地 HTTP/SSE:system transcript 5 项、官方 Flash 4 项、无能力标记的兼容接口 4 项全部通过;隔离 Electron transcript 回归通过。
  • 修复既有 managed-exec 测试就绪文件竞态:写完整 JSON 后原子改名,仅改变测试同步。此前本机测试曾有进程启动/计时超时,降低并发、正常运行后重新验证,未将失败尝试计为通过。

Claude Code review skill 的最终复审被 403 Insufficient account balance 阻断,因此保留 draft,不声称最终候选已通过该复审。较早审查关于 Flash fixture 应使用 native 的疑虑不适用:Flash 本就应走固定清单;关于每次调用都重新搜索的建议也未采用,成功 ToolSearch 结果已经提供激活名称。这两点的最终 CC 复核仍待完成。

远端 CI 的 JavaScript、Rust,以及独立 Docs、PR-base 四项检查均已通过。GitHub 合并候选 96ef3db7a53d 与本地验证提交代码树一致。本 PR 保持 draft,未请求合并。

离线适配器与本地 SSE 测试证明请求构造、执行和恢复流程,不证明服务端实际缓存命中率。本轮未调用付费模型。固定目录首轮成本、超限回退、工具目录变化,以及无中途 system 支持的真实 Skill 更新仍可能影响缓存。此前 DeepSeek 成本实验不是本轮跨模型验证,不能外推。

Related to #1285; follows up #1325 and #1355.

zszz3 added 5 commits October 4, 2026 12:11
Select fixed declarations by transport capabilities instead of a Flash
allowlist, retaining native anchored additions where Pi supports them.
Keep execution activation private to Desktop so folding adapters do not
rewrite their leading instructions after each search.

Exercise all Desktop-selectable adapters through the runtime tool loop,
with compatible-route HTTP and process coverage and independent activation
restoration and permission checks.
The unflagged fixture now declares its catalog upfront. Assert persisted activation and stable request schemas instead of expecting a later declaration delta.
CI observed the readiness file between creation and its JSON write. Rename a completed sibling file into place so process cancellation assertions begin only after the PID list is readable.
Distinguish the pinned adapter behavior from the provider inline-tool beta.
System-message and tool-reference capabilities cannot enable an unsupported
wire format.
Keep verified Anthropic tool changes on their native append-only path now
that Pi sends full definitions inline. System-only bindings still need a
fixed catalog, and the request matrix covers both capability boundaries.
@zszz3 zszz3 closed this Oct 4, 2026
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