test: pin current tool-eval, guardrail, and truncation behavior ahead of background-jobs work

T0 characterization safety net per plans/background-jobs-design.md §9.3: 43 tests
pinning handle_collect/check/cancel/spawn, the pending-agents guardrail (incl.
ForceTerminate + counter resets), eval_tool_calls partition/re-sort/soft-fail/
loop-alert/truncation, truncate_if_needed's UTF-8 boundary edge, ToolCall::eval
prefix routing, merge_tool_results shape, and cancel_recursive recursion.

Known-buggy behaviors deliberately pinned for visible later diffs: handle_check
consumes finished handles, guardrail ignores finished-but-uncollected agents,
mid-char truncation returns the full string with marker prepended.

Not covered (findings): empty-after-dedup bail is unreachable from non-empty
input; run_child_agent needs a mock LLM client (none exists) — manual case;
over-threshold summarization pinned via deterministic unknown-model failure.
This commit is contained in:
2026-08-25 13:55:15 -06:00
parent 240eaa081a
commit bfc3b7bfea
4 changed files with 808 additions and 2 deletions
+21
View File
@@ -294,4 +294,25 @@ mod tests {
AgentExitStatus::Failed("x".into())
);
}
#[test]
fn cancel_recursive_aborts_nested_supervisors() {
let child_sig = create_abort_signal();
let mut child_handle = make_handle("c1", "worker", 2);
child_handle.abort_signal = child_sig.clone();
let mut child_sup = Supervisor::new(4, 3);
child_sup.register(child_handle).unwrap();
let parent_sig = create_abort_signal();
let mut parent_handle = make_handle("a1", "explore", 1);
parent_handle.abort_signal = parent_sig.clone();
parent_handle.child_supervisor = Some(Arc::new(RwLock::new(child_sup)));
let mut sup = Supervisor::new(4, 3);
sup.register(parent_handle).unwrap();
sup.cancel_recursive();
assert!(parent_sig.aborted());
assert!(child_sig.aborted());
}
}