fix(agents): address review: edited agent fields only, --when-closed error without a settings folder, docs

- Preferences OK sends only the agent settings changed in the window, before prefs.set, so a refused one
  applies nothing and one changed through prefs.agents while the window is open keeps its value.
- mcp --when-closed error refuses when there is no settings folder instead of going headless.
- Docs: automation roots make plain mcp headless; a session that went headless needs a new MCP session
  for the window; a window-run export may still finish after cancellation; crate docs name the
  closed-app choices.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
David MannandClaude Opus 5.5 committed 2026-12-03 02:58:15 +01:00
1 parent 6ef812a7d0
commit a7652fff9d
6 files changed
+60 -15

No files matched your search

+5 -1
View File
@@ -390,7 +390,11 @@ fn mcp(args: &[String], safe_mode: bool) -> Result<(), String> {
} else {
match prefs_dir::prefs_dir() {
Some(dir) => Box::new(LiveBackend::new(live_config(dir, when_closed))),
// No settings folder (no home folder): no window can be found either.
// No settings folder (no home folder): no window can be found either, so `--when-closed error`
// refuses rather than answering from a session the agent didn't ask for.
None if when_closed == Some(WhenAppClosed::Error) => {
return Err("VectorCraft's settings folder can't be found (no home folder), so its window can't be either: open VectorCraft, or run `mcp` without `--when-closed error`".into());
}
None => Box::new(with_stores(Headless::with_document())),
}
};