From 13f75a2cc5cd7304515cd1ec10b1a6a800f2e543 Mon Sep 17 00:00:00 2001 From: Angel-Mario Savin Date: Tue, 17 Nov 2026 12:13:14 +0200 Subject: [PATCH] Test that a running session keeps its subagent types until it is resumed The headless test now changes the Codex models while a session runs, checks the session's process still has the types it started with, then resumes it and waits for the new ones. Real helper runs covered the rest of #110: with npx off PATH the helper reports "npx was not found on PATH. Codex subagents need Node.js.", and with an empty CODEX_HOME it reports "Codex isn't signed in. Run `codex login`, then try again."; the mod puts "Codex failed: " in front of both. Closes #110 --- src/app/headless.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/app/headless.rs b/src/app/headless.rs index af7b1a8..771bef0 100644 --- a/src/app/headless.rs +++ b/src/app/headless.rs @@ -2457,4 +2457,11 @@ fn custom_subagents_reach_new_sessions() { shows(ws, r#"{"codex":{"edits":true,"types":[{"name":"codex-gpt-6-1-sol","model":"gpt-6.1-sol","description":"Runs the task in OpenAI Codex on gpt-6.1-sol."#) && shows(ws, r#""opencode":{"edits":false,"types":[{"name":"opencode-openai-gpt-6-1-sol","model":"openai/gpt-6.1-sol","description":"Runs the task in OpenCode on openai/gpt-6.1-sol."#) }); + + // A settings change reaches a running session only once it is resumed: its process keeps the types it started with. + h.step(|ws| ws.store.data.settings.custom_subagents.codex.models = vec!["gpt-7".into()]); + h.settle(); + assert!(!shows(h.ws(), "codex-gpt-7"), "the running session keeps its types"); + h.step(|ws| ws.restart_session(&id)); + h.wait("the resumed session to get the new types", |ws| shows(ws, r#""types":[{"name":"codex-gpt-7","model":"gpt-7""#)); }