test: assert memory routing without depending on host memory files

memory_config() only reports enabled when a global memory index or a
workspace memory store exists on disk, so asserting the handler's
'name is required' detail was environment-dependent even with the
memory pref forced on. The routing test now accepts either
memory-handler-owned message: the 'Memory tool failed' prefix alone
proves the memory__ prefix reached the memory handler.
This commit is contained in:
2026-08-25 20:52:31 -06:00
parent 2eb63cfc0d
commit 5a9f8c42b9
+5 -6
View File
@@ -4730,18 +4730,17 @@ mod tests {
#[test]
fn eval_routes_memory_prefix_to_memory_handler() {
let mut app_state = AppState::test_default();
let mut app_config = (*app_state.config).clone();
app_config.memory = Some(true);
app_state.config = Arc::new(app_config);
let mut ctx = RequestContext::new(Arc::new(app_state), WorkingMode::Cmd);
let mut ctx = RequestContext::new(Arc::new(AppState::test_default()), WorkingMode::Cmd);
ctx.tool_scope.functions.append_memory_functions();
let out = run_async(call_with_args("memory__read", json!({})).eval(&mut ctx)).unwrap();
let err = out["tool_call_error"].as_str().unwrap();
assert!(err.starts_with("Memory tool failed"), "{err}");
assert!(err.contains("name is required"), "{err}");
assert!(
err.contains("name is required") || err.contains("Memory tools are disabled"),
"expected a memory-handler-owned error regardless of host memory files: {err}"
);
}
#[test]