test(channels): assert single tool protocol block in final prompt
This commit is contained in:
parent
35a3520621
commit
63a59e3735
1 changed files with 20 additions and 0 deletions
|
|
@ -3546,6 +3546,26 @@ mod tests {
|
|||
assert!(prompt.contains("**memory_recall**"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn prompt_includes_single_tool_protocol_block_after_append() {
|
||||
let ws = make_workspace();
|
||||
let tools = vec![("shell", "Run commands")];
|
||||
let mut prompt = build_system_prompt(ws.path(), "gpt-4o", &tools, &[], None, None);
|
||||
|
||||
assert!(
|
||||
!prompt.contains("## Tool Use Protocol"),
|
||||
"build_system_prompt should not emit protocol block directly"
|
||||
);
|
||||
|
||||
prompt.push_str(&build_tool_instructions(&[]));
|
||||
|
||||
assert_eq!(
|
||||
prompt.matches("## Tool Use Protocol").count(),
|
||||
1,
|
||||
"protocol block should appear exactly once in the final prompt"
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn prompt_injects_safety() {
|
||||
let ws = make_workspace();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue