修正原生工具 repair 用例中失效的提示词断言
Project CI / Repository checks (pull_request) Failing after 43s
Project CI / Frontend tests (pull_request) Failing after 31s
Project CI / Backend tests (pull_request) Failing after 1m37s
Project CI / Native shell tests (pull_request) Failing after 9m3s

移除 legacy text JSON schema 后,断言「提供原生函数时不得输出这段 JSON」必然失败
改为断言现行原生协议约束,并新增否定断言防止该段 schema 回流
tool_choice=required、arguments.input 嵌套、禁止扁平化和 respond_to_user 断言保持不变

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
2026-07-27 03:57:59 +00:00
parent 5fb9af8303
commit a6c0775fb7
@@ -5505,7 +5505,10 @@ async fn background_agent_runtime_repairs_malformed_native_function_arguments()
.recv_timeout(Duration::from_secs(2))
.expect("initial native tool plan request");
assert!(initial_request.contains("\"tool_choice\":\"required\""));
assert!(initial_request.contains("提供原生函数时不得输出这段 JSON"));
// 三种协议统一使用原生工具后,legacy text JSON schema 已从 planning 请求中移除;
// 这里既断言现行原生协议约束,也防止那段失效 schema 回流。
assert!(initial_request.contains("必须直接调用当前请求提供的原生函数"));
assert!(!initial_request.contains("Legacy text JSON schema"));
assert!(initial_request.contains("arguments.input"));
assert!(initial_request.contains("禁止把 input 字段扁平到 arguments 顶层"));
assert!(initial_request.contains("必须调用 respond_to_user"));