Repository navigation
feat: BPS 支持必选工具与指定函数、自定义工具 - #856
Merged
Merged
Conversation
12 tasks done
This was referenced Nov 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
解决的问题与行为变化
BPS 适配此前只接受
tool_choice=auto/none,客户端指定函数或要求必须调用工具时会在发送上游前失败。现在支持required、指定function/custom以及命名空间;从当前有效目录解析目标,在完整输出批次上校验目标身份和原始参数 schema,校验通过后才发出工具事件、保存回放。未声明、名称歧义、类型不匹配、缺少调用或返回错误目标均失败。约束只影响当前请求,不裁剪共享目录;错误目标不触发重新选择工具的生成。
allowed_tools等其他选择形式仍明确拒绝。关联记录与来源
TOOL-CHOICE.md和静态调用证据重新实现,未复制第三方业务源码或加载二进制。ZIP SHA-256:84aca0133285700017bb4d22f4a90f78929f322daa5243c841bf6bece34447a7。production@aa0b1abfe5b32c483b32c70fe0c813659ef58083;无其他 PR 依赖。管理员新功能提示
NewFeatureBadge展示位置:不适用,无 UI 改动。tool_choice_test.go,最终 head CI 已通过。复现与验收
lookup、other、client.execute。tool_choice={"type":"function","name":"lookup"}。此前该选择被拒绝;现在进入 BPS 适配,终态必须包含符合 schema 的lookup调用。协议、调度或传输改动补充
/v1/responses,现有 OAuth BPS 通道;模型映射不变,stream 与非 stream 共用终态工具校验。{"type":"function","name":"lookup"};BPS 线上 wire 使用指令,不发送其不支持的原生tool_choice。response.failed,保留终态 ID 与用量。实际验证
git diff --checkbackend:make test-unit/ CI lint、构建兼容性与运行影响
文档与用户可见变化
更新 BPS README,说明选择语法、命名空间、批次校验、失败终态与流式边界。无页面改动,不适用截图。尚未发布或部署。
Agent 使用声明
提交前自查
最终审查与验证:
78c7bc87b39b697ebe96ca9aa1a7ac93df75407e的 48 项实际运行检查通过,44 项按条件跳过。已核对 production 基线aa0b1abf、目录保持、整批校验、错误目标不修正和敏感值脱敏;无未解决审查意见。完整后端检查、BPS race 回归、lint。真实上游和生产未验证。