Fix Rig tool continuation and plan creation

This commit is contained in:
2026-08-14 09:01:53 -05:00
parent 5737f8342c
commit f4a04d0240
12 changed files with 642 additions and 155 deletions
@@ -188,6 +188,7 @@ pub fn recall_tool_history(
let filtered = entries
.iter()
.filter(|entry| entry.name != RECALL_TOOL_HISTORY_NAME)
.filter(|entry| {
(query.tool_use_id.is_empty() || entry.tool_use_id == query.tool_use_id)
&& (query.tool_name.is_empty() || entry.name == query.tool_name)
@@ -141,6 +141,21 @@ fn recall_supports_exact_call_id_and_case_insensitive_text_search() {
);
}
#[test]
fn recall_never_returns_a_prior_recall_call() {
let messages = tool_exchange(
"recall-1",
RECALL_TOOL_HISTORY_NAME,
serde_json::json!({}),
"a prior synthetic recall result",
);
assert_eq!(
recall_tool_history(&messages, &[], ToolHistoryQuery::default()),
"No matching tool calls found in conversation history."
);
}
#[test]
fn loop_guard_detects_repeated_failures_and_resets_after_detection() {
let mut guard = ToolLoopGuard::new(5, 3);