MCP: the auto-save recovery tests look for the JSON-quoted path

automation autosave_is_durable_before_reply_and_queries_do_not_rotate
and the CLI's mcp_autosave_survives_kill_and_restart_without_touching_
desktop_settings asserted that the initialize instructions contain the
previous session's auto-save path as raw text. The instructions embed
the auto-save info as JSON, so on Windows the path's backslashes are
escaped and the raw match can never succeed (both failed on every
Windows run; the server's reply is right). They now look for the path
as serde_json prints it, which also matches on Linux and macOS.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
Jeremy Yao 2026-10-10 09:37:00 -04:00
parent a91952dadc
commit 2a404f6226
2 changed files with 6 additions and 2 deletions

View File

@ -373,7 +373,9 @@ fn mcp_autosave_survives_kill_and_restart_without_touching_desktop_settings() {
assert_eq!(manifest["ended"], false);
let mut restarted = McpChild::start(&config, true);
let init = restarted.rpc("initialize", json!({}));
assert!(init["instructions"].as_str().unwrap().contains(path));
// The instructions embed the auto-save info as JSON, so the path appears JSON-quoted (on
// Windows with its backslashes escaped).
assert!(init["instructions"].as_str().unwrap().contains(&json!(path).to_string()));
assert_eq!(init["_meta"]["effectcraftAutoSave"]["previousSessions"][0]["autosave"], path);
restarted.tool("open_project", json!({"path":path}));
let comp = restarted.tool("get_comp", json!({"comp":"Survives restart"}));

View File

@ -269,7 +269,9 @@ fn autosave_is_durable_before_reply_and_queries_do_not_rotate() {
drop(s); // Abrupt process loss has no EOF cleanup; the checkpoint already exists.
let mut restarted = server().with_autosave(&dir).unwrap();
let init = rpc(&mut restarted, 1, "initialize", json!({}));
assert!(init["instructions"].as_str().unwrap().contains(path));
// The instructions embed the auto-save info as JSON, so the path appears JSON-quoted (on
// Windows with its backslashes escaped).
assert!(init["instructions"].as_str().unwrap().contains(&json!(path).to_string()));
assert_eq!(init["_meta"]["effectcraftAutoSave"]["previousSessions"][0]["autosave"], path);
call_json(&mut restarted, "open_project", json!({"path": path}));
assert_eq!(call_json(&mut restarted, "get_project", json!({}))["items"][0]["name"], "Durable");