Skip to content

The ultimate harness for coding agents and beyond. All your agents. All your machines. One command center. Start with code, then follow your curiosity and build across disciplines: CAD, circuits, robots, games and music.

Pi panes name their model, offer Change model…, and survive a switch before the first chat (#1369)

lingrd90a8ffafcf88
diff --git a/cli/src/engines/__fixtures__/launch-argv.golden.json b/cli/src/engines/__fixtures__/launch-argv.golden.json
index da9d0a714..7424b0faf 100644
--- a/cli/src/engines/__fixtures__/launch-argv.golden.json
+++ b/cli/src/engines/__fixtures__/launch-argv.golden.json
@@ -777,11 +777,11 @@
"opencode · restart · zsh · tmux": {"argv":["/usr/bin/env","DISABLE_AUTO_UPDATE=true","/bin/zsh","-lic",". '<data>/launch/<one-time>.sh'","harness-engine","/work/my project's folder","opencode","--auto","--session","sess-0001","-c","model_providers.grid.base_url=\"https://grid.example/relay/v1\"","-m","gpt-5"],"script":"578f9c4700068ef7","command":8},
"pi · new · zsh · tmux": {"argv":["/usr/bin/env","DISABLE_AUTO_UPDATE=true","/bin/zsh","-lic",". '<data>/launch/<one-time>.sh'","harness-engine","pi"],"script":"aabc05c226876113","command":1},
"pi · new, approving · zsh · tmux": {"argv":["/usr/bin/env","DISABLE_AUTO_UPDATE=true","/bin/zsh","-lic",". '<data>/launch/<one-time>.sh'","harness-engine","pi"],"script":"aabc05c226876113","command":1},
- "pi · resume · zsh · tmux": {"argv":["/usr/bin/env","DISABLE_AUTO_UPDATE=true","/bin/zsh","-lic",". '<data>/launch/<one-time>.sh'","harness-engine","pi","--session","sess-0001"],"script":"aabc05c226876113","command":3},
+ "pi · resume · zsh · tmux": {"argv":["/usr/bin/env","DISABLE_AUTO_UPDATE=true","/bin/zsh","-lic",". '<data>/launch/<one-time>.sh'","harness-engine","pi","--session-id","sess-0001"],"script":"aabc05c226876113","command":3},
"pi · fork · zsh · tmux": {"argv":["/usr/bin/env","DISABLE_AUTO_UPDATE=true","/bin/zsh","-lic",". '<data>/launch/<one-time>.sh'","harness-engine","pi"],"script":"aabc05c226876113","command":1},
"pi · create · zsh · tmux": {"argv":["/usr/bin/env","DISABLE_AUTO_UPDATE=true","/bin/zsh","-lic",". '<data>/launch/<one-time>.sh'","harness-engine","/work/my project's folder","pi","-c","model_providers.grid.base_url=\"https://grid.example/relay/v1\"","-m","gpt-5"],"script":"81dbfa544ec924e5","command":5},
- "pi · adopt, waiting out the turn · zsh · tmux": {"argv":["/usr/bin/env","DISABLE_AUTO_UPDATE=true","/bin/zsh","-lic",". '<data>/launch/<one-time>.sh'","harness-engine","/work/my project's folder","pi","--session","sess-0001"],"script":"8c065d59be24b86e","command":3},
- "pi · restart · zsh · tmux": {"argv":["/usr/bin/env","DISABLE_AUTO_UPDATE=true","/bin/zsh","-lic",". '<data>/launch/<one-time>.sh'","harness-engine","/work/my project's folder","pi","--session","sess-0001","-c","model_providers.grid.base_url=\"https://grid.example/relay/v1\"","-m","gpt-5"],"script":"3f8dc832a7ec0472","command":7},
+ "pi · adopt, waiting out the turn · zsh · tmux": {"argv":["/usr/bin/env","DISABLE_AUTO_UPDATE=true","/bin/zsh","-lic",". '<data>/launch/<one-time>.sh'","harness-engine","/work/my project's folder","pi","--session-id","sess-0001"],"script":"8c065d59be24b86e","command":3},
+ "pi · restart · zsh · tmux": {"argv":["/usr/bin/env","DISABLE_AUTO_UPDATE=true","/bin/zsh","-lic",". '<data>/launch/<one-time>.sh'","harness-engine","/work/my project's folder","pi","--session-id","sess-0001","-c","model_providers.grid.base_url=\"https://grid.example/relay/v1\"","-m","gpt-5"],"script":"3f8dc832a7ec0472","command":7},
"hermes · new · zsh · tmux": {"argv":["/usr/bin/env","DISABLE_AUTO_UPDATE=true","/bin/zsh","-lic",". '<data>/launch/<one-time>.sh'","harness-engine","hermes"],"script":"000cf74715d831bc","command":1},
"hermes · new, approving · zsh · tmux": {"argv":["/usr/bin/env","DISABLE_AUTO_UPDATE=true","/bin/zsh","-lic",". '<data>/launch/<one-time>.sh'","harness-engine","hermes"],"script":"000cf74715d831bc","command":1},
"hermes · first prompt · zsh · tmux": {"argv":["/usr/bin/env","DISABLE_AUTO_UPDATE=true","/bin/zsh","-lic",". '<data>/launch/<one-time>.sh'","harness-engine","hermes","chat","-q","Fix the \"parser\" — it's broken; $HOME stays literal, as does `date` and a 'quote' ✓"],"script":"000cf74715d831bc","command":4},
@@ -1200,8 +1200,8 @@
"opencode · adopt, waiting out the turn · zsh · tmux": {"argv":["/usr/bin/env","DISABLE_AUTO_UPDATE=true","/bin/zsh","-lic",". '<data>/launch/<one-time>.sh'","harness-engine","/work/my project's folder","opencode","--auto","--session","sess-0001"],"script":"70ce40be6790ecb0","command":4},
"opencode · restart · zsh · tmux": {"argv":["/usr/bin/env","DISABLE_AUTO_UPDATE=true","/bin/zsh","-lic",". '<data>/launch/<one-time>.sh'","harness-engine","/work/my project's folder","opencode","--auto","--session","sess-0001","-c","model_providers.grid.base_url=\"https://grid.example/relay/v1\"","-m","gpt-5"],"script":"e097441cb952e6a2","command":8},
"pi · create · zsh · tmux": {"argv":["/usr/bin/env","DISABLE_AUTO_UPDATE=true","/bin/zsh","-lic",". '<data>/launch/<one-time>.sh'","harness-engine","/work/my project's folder","pi","-c","model_providers.grid.base_url=\"https://grid.example/relay/v1\"","-m","gpt-5"],"script":"7bfcfcfab392343b","command":5},
- "pi · adopt, waiting out the turn · zsh · tmux": {"argv":["/usr/bin/env","DISABLE_AUTO_UPDATE=true","/bin/zsh","-lic",". '<data>/launch/<one-time>.sh'","harness-engine","/work/my project's folder","pi","--session","sess-0001"],"script":"648272a5ee2aff4a","command":3},
- "pi · restart · zsh · tmux": {"argv":["/usr/bin/env","DISABLE_AUTO_UPDATE=true","/bin/zsh","-lic",". '<data>/launch/<one-time>.sh'","harness-engine","/work/my project's folder","pi","--session","sess-0001","-c","model_providers.grid.base_url=\"https://grid.example/relay/v1\"","-m","gpt-5"],"script":"d244b2cba1bf3254","command":7},
+ "pi · adopt, waiting out the turn · zsh · tmux": {"argv":["/usr/bin/env","DISABLE_AUTO_UPDATE=true","/bin/zsh","-lic",". '<data>/launch/<one-time>.sh'","harness-engine","/work/my project's folder","pi","--session-id","sess-0001"],"script":"648272a5ee2aff4a","command":3},
+ "pi · restart · zsh · tmux": {"argv":["/usr/bin/env","DISABLE_AUTO_UPDATE=true","/bin/zsh","-lic",". '<data>/launch/<one-time>.sh'","harness-engine","/work/my project's folder","pi","--session-id","sess-0001","-c","model_providers.grid.base_url=\"https://grid.example/relay/v1\"","-m","gpt-5"],"script":"d244b2cba1bf3254","command":7},
"hermes · create · zsh · tmux": {"argv":["/usr/bin/env","DISABLE_AUTO_UPDATE=true","/bin/zsh","-lic",". '<data>/launch/<one-time>.sh'","harness-engine","/work/my project's folder","hermes","-c","model_providers.grid.base_url=\"https://grid.example/relay/v1\"","-m","gpt-5","chat","-q","Fix the \"parser\" — it's broken; $HOME stays literal, as does `date` and a 'quote' ✓"],"script":"dbb3a422a9417091","command":8},
"hermes · adopt, waiting out the turn · zsh · tmux": {"argv":["/usr/bin/env","DISABLE_AUTO_UPDATE=true","/bin/zsh","-lic",". '<data>/launch/<one-time>.sh'","harness-engine","/work/my project's folder","hermes","--resume","sess-0001"],"script":"e1484571ebd3fc46","command":3},
"hermes · restart · zsh · tmux": {"argv":["/usr/bin/env","DISABLE_AUTO_UPDATE=true","/bin/zsh","-lic",". '<data>/launch/<one-time>.sh'","harness-engine","/work/my project's folder","hermes","--resume","sess-0001","-c","model_providers.grid.base_url=\"https://grid.example/relay/v1\"","-m","gpt-5"],"script":"1312b34d1a68c9b4","command":7},
diff --git a/cli/src/engines/__fixtures__/native-launch-compatibility.golden.json b/cli/src/engines/__fixtures__/native-launch-compatibility.golden.json
index 87249db47..ffe09429a 100644
--- a/cli/src/engines/__fixtures__/native-launch-compatibility.golden.json
+++ b/cli/src/engines/__fixtures__/native-launch-compatibility.golden.json
@@ -105,7 +105,7 @@
],
"pi resume": [
"pi",
- "--session",
+ "--session-id",
"fixture-conversation"
],
"pi fork": [
diff --git a/cli/src/engines/__fixtures__/other-runtime.golden.json b/cli/src/engines/__fixtures__/other-runtime.golden.json
index c7e24295f..ad810a023 100644
--- a/cli/src/engines/__fixtures__/other-runtime.golden.json
+++ b/cli/src/engines/__fixtures__/other-runtime.golden.json
@@ -339,6 +339,23 @@
"provider model context max-out thinking images",
"vibe minimax/minimax-m3 500K 65.5K yes no ",
"openai gpt-5.6 400K 100K no yes ",
+ "the Pi 1.0 footer",
+ "Qwen/Qwen3.8-27B",
+ "DeepSeek-V4-Flash-0731",
+ "────────────────────────────────────────────────────────────────────────────────",
+ "~/Workspace/aptis-notes",
+ "🔌 MCP: 2 servers enabled",
+ "reads the model a catalog has",
+ "────────────────────────────────────────────────────────────────────────────────\n~/Workspace/aptis-notes\n0.0%/256k (auto) Qwen/Qwen3.8-27B\n🔌 MCP: 2 servers enabled",
+ "0.0%/256k (auto) Qwen/Qwen3.8-27B",
+ "────────────────────────────────────────────────────────────────────────────────\n~/Workspace/aptis-notes\n↑14M ↓289k R21M CH0.0% 51.4%/256k (auto) DeepSeek-V4-Flash-0731\n🔌 MCP: 2 servers enabled",
+ "↑14M ↓289k R21M CH0.0% 51.4%/256k (auto) DeepSeek-V4-Flash-0731",
+ "takes no clipped name, and no name the catalog does not have",
+ "────────────────────────────────────────────────────────────────────────────────\n~/Workspace/aptis-notes\n↑59M ↓1.4M R126M CH97.2% 25.7%/256k (auto) DeepSeek-V4-Fla\n🔌 MCP: 2 servers enabled",
+ "↑59M ↓1.4M R126M CH97.2% 25.7%/256k (auto) DeepSeek-V4-Fla",
+ "────────────────────────────────────────────────────────────────────────────────\n~/Workspace/aptis-notes\n0.0%/256k (auto) Some-Other-Model\n🔌 MCP: 2 servers enabled",
+ "0.0%/256k (auto) Some-Other-Model",
+ "no usage line here",
"pi model catalog",
"reads provider, model and the thinking column",
"vibe/minimax/minimax-m3",
@@ -702,6 +719,15 @@
"\u001b[38;2;255;255;255mswitch me please",
" ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄\n \u001b[38;2;240;246;252m❯ hi\u001b[39m\n ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀\n ● Hi! What would you like to work on?\n \u001b[38;2;145;152;161m~/Downloads/20260907\u001b[39m\n\u001b[38;2;129;139;152m╻\u001b[38;2;20;27;34m▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄\n\u001b[38;2;129;139;152m┃\u001b[39m\u001b[48;2;20;27;34m\u001b[38;2;255;255;255mfix the parser\u001b[38;2;128;128;128m ⏎ send\n\u001b[38;2;129;139;152m\u001b[49m╹\u001b[38;2;20;27;34m▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀\n\u001b[39m ← open sidebar · / commands · ? help · tab next tab",
"\u001b[38;2;255;255;255mfix the parser\u001b[38;2;128;128;128m ⏎ send",
+ "reads OpenCode 2's lighter grey placeholder as a placeholder, not a draft",
+ "\u001b[48;2;25;25;25m",
+ "\u001b[38;2;180;180;180m",
+ " \u001b[38;2;178;148;187m┃\u001b[38;2;255;255;255m\u001b[48;2;30;30;30m \u001b[2m\u001b[1m›\u001b[0m\u001b[2m \u001b[2mAsk Codex to do anything\u001b[0m\u001b[38;2;255;255;255m \u001b[49m\n \u001b[38;2;178;148;187m┃\u001b[38;2;255;255;255m\u001b[48;2;30;30;30m \u001b[38;2;178;148;187mBuild\u001b[38;2;255;255;255m \u001b[38;2;180;180;180m·\u001b[38;2;255;255;255m DeepSeek-V4-Flash-0731\u001b[49m\n \u001b[38;2;178;148;187m╹\u001b[38;2;25;25;25m▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀",
+ " \u001b[38;2;178;148;187m┃\u001b[38;2;255;255;255m\u001b[48;2;30;30;30m \u001b[2m\u001b[1m›\u001b[0m\u001b[2m \u001b[2mAsk Codex to do anything\u001b[0m\u001b[38;2;255;255;255m \u001b[49m",
+ " \u001b[38;2;178;148;187m┃\u001b[38;2;255;255;255m\u001b[48;2;30;30;30m \u001b[38;2;178;148;187mBuild\u001b[38;2;255;255;255m \u001b[38;2;180;180;180m·\u001b[38;2;255;255;255m DeepSeek-V4-Flash-0731\u001b[49m",
+ " \u001b[38;2;178;148;187m╹\u001b[38;2;25;25;25m▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀",
+ " ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄\n \u001b[38;2;240;246;252m❯ hi\u001b[39m\n ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀\n ● Hi! What would you like to work on?\n \u001b[38;2;145;152;161m~/Downloads/20260907\u001b[39m\n\u001b[38;2;129;139;152m╻\u001b[38;2;20;27;34m▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄\n\u001b[38;2;129;139;152m┃\u001b[39m\u001b[48;2;20;27;34m\u001b[38;2;180;180;180mAsk anything… \"Fix a TODO in the codebase\"\n\u001b[38;2;129;139;152m\u001b[49m╹\u001b[38;2;20;27;34m▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀\n\u001b[39m ← open sidebar · / commands · ? help · tab next tab",
+ "\u001b[38;2;180;180;180mAsk anything… \"Fix a TODO in the codebase\"",
"reads copilot, whose composer carries no marker while its sent messages do",
" ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄\n \u001b[38;2;240;246;252m❯ hi\u001b[39m\n ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀\n ● Hi! What would you like to work on?\n \u001b[38;2;145;152;161m~/Downloads/20260907\u001b[39m\n\u001b[38;2;129;139;152m╻\u001b[38;2;20;27;34m▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄\n\u001b[38;2;129;139;152m┃\u001b[39m\u001b[48;2;20;27;34m\u001b[2m\u001b[1m›\u001b[0m\u001b[2m \u001b[2mAsk Codex to do anything\u001b[0m\n\u001b[38;2;129;139;152m\u001b[49m╹\u001b[38;2;20;27;34m▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀\n\u001b[39m ← open sidebar · / commands · ? help · tab next tab",
" ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄",
@@ -934,7 +960,7 @@
"supportsControl",
"MiniMax M3"
],
- "lib/runtimeProfileManager.spec.ts": [
+ "lib/runtimeProfileState.spec.ts": [
"node:fs",
"node:os",
"node:path",
@@ -942,10 +968,12 @@
"../config/env.js",
"../engines/claude/runtimeProfile.js",
"./registry.js",
- "./runtimeProfileManager.js",
+ "./runtimeProfileState.js",
"./runtimeProfile.js",
"./runtimeProfileWire.js",
"../engines/inProcess.js",
+ "../engines/facets/inlineRuntime.js",
+ "../core/terminals/control.js",
"__fixtures__",
"utf8",
"engine",
@@ -956,6 +984,12 @@
"/tmp",
"/tmp/profile-recording.jsonl",
"another engine whose code could not be loaded",
+ "contains a missing or throwing reader factory while core confirmation and cleanup still work",
+ "warn",
+ "broken facet",
+ "cursor",
+ "Auto · 10%",
+ "high",
"reads nothing of its panes, config files or catalog, and leaves its chips as they were",
"devin",
"hermes",
@@ -967,6 +1001,65 @@
"any pane",
"muse",
"amp",
+ "late optional profile observations",
+ "binding",
+ "process",
+ "route",
+ "confirmation",
+ "forget",
+ "unchanged",
+ "fences a pane through the promise handoff to its profile consumer: %s",
+ "claude",
+ "tmux",
+ "before",
+ "succeeded",
+ "captured-model",
+ "new-conversation",
+ "after",
+ "does not capture for an unbound or detached profile, or ingest an empty pane",
+ "explicit read",
+ "does not let a queued refresh supersede a newer %s",
+ "low",
+ "model",
+ "cancel",
+ "finish",
+ "does not revive a forgotten state when late control cleanup calls %s",
+ "optional cleanup failed",
+ "keeps newer control flags even when neither a value nor the control object changes",
+ "target",
+ "new-model",
+ "{\"confirm\":true}",
+ "invalidates config and hydration across a complete control %s cycle",
+ "{\"type\":\"assistant\",\"message\":{\"model\":\"staged-model\"}}",
+ "assistant",
+ "staged-model",
+ "treats a repeated confirmation as newer authority than a pending config or transcript stage",
+ "Date",
+ "keeps a same-value pane observation ahead of a pending config answer",
+ "same evidence",
+ "finishes core waiters and every optional cleanup despite a throwing reader",
+ "broken cleanup",
+ "wanted",
+ "cannot commit a staged transcript after forget or newer live evidence",
+ "codex",
+ "turn_context",
+ "{\"type\":\"turn_context\",\"payload\":{\"model\":\"first\",\"reasoning_effort\":\"high\"}}",
+ "first",
+ "{\"type\":\"turn_context\",\"payload\":{\"model\":\"old-history\",\"reasoning_effort\":\"high\"}}",
+ "old-history",
+ "{\"type\":\"turn_context\",\"payload\":{\"model\":\"latest\",\"reasoning_effort\":\"high\"}}",
+ "latest",
+ "keeps the session version and control confirmation private until a stage commits",
+ "staged-version",
+ "runtime-v1:conversation:claude:staged-model@high",
+ "cannot recreate state when its module finishes loading after forget",
+ "late-model",
+ "does not replace a confirmed effort with a config read started earlier",
+ "does not notify for a read completed after the session was forgotten",
+ "discards a config answer for a different native home on the same mutable row",
+ "old-home-model",
+ "/tmp/first-profile",
+ "/tmp/replacement-profile",
"runtime profiles without the pilot implementations",
"amp-session.jsonl",
"amp-session-queued.jsonl",
@@ -982,12 +1075,27 @@
"{\"type\":\"thinking_level_change\",\"id\":\"1da16955\",\"parentId\":\"45215278\",\"level\":\"medium\"}",
"0.0%/500k (auto) minimax/minimax-m3 • high",
"minimax/minimax-m3",
- "high",
"{\"type\":\"message\",\"message\":{\"role\":\"assistant\",\"content\":[{\"type\":\"text\",\"text\":\"Set model to Opus 5\\nSet effort level to low\"}]}}",
"message",
- "assistant",
"text",
"Set model to Opus 5\nSet effort level to low",
+ "reads Pi 1.0 model and thinking level from its session, never from the clipped footer",
+ "{\"type\":\"session\",\"version\":3,\"id\":\"s1\",\"timestamp\":\"2026-10-15T03:00:00.000Z\",\"cwd\":\"/tmp/pi\"}",
+ "{\"type\":\"model_change\",\"id\":\"m1\",\"parentId\":null,\"timestamp\":\"2026-10-15T03:00:01.000Z\",\"provider\":\"autonomous-ai\",\"modelId\":\"DeepSeek-V4-Flash-0731\"}",
+ "{\"type\":\"thinking_level_change\",\"id\":\"t1\",\"parentId\":\"m1\",\"timestamp\":\"2026-10-15T03:00:01.000Z\",\"thinkingLevel\":\"off\"}",
+ "DeepSeek-V4-Flash-0731",
+ "off",
+ "↑14M ↓289k R21M CH0.0% 51.4%/256k (auto) DeepSeek-V4-Fla",
+ "{\"type\":\"message\",\"message\":{\"role\":\"assistant\",\"provider\":\"autonomous-ai\",\"model\":\"Qwen/Qwen3.8-27B\",\"content\":[{\"type\":\"text\",\"text\":\"ok\"}]}}",
+ "autonomous-ai",
+ "Qwen/Qwen3.8-27B",
+ "{\"type\":\"message\",\"message\":{\"role\":\"user\",\"model\":\"other\",\"content\":[]}}",
+ "user",
+ "other",
+ "confirms a Pi switch from the model_change its /model writes",
+ "{\"type\":\"model_change\",\"provider\":\"autonomous-ai\",\"modelId\":\"DeepSeek-V4-Flash-0731\"}",
+ "auto",
+ "{\"type\":\"model_change\",\"provider\":\"autonomous-ai\",\"modelId\":\"Qwen/Qwen3.8-27B\"}",
"terminal",
"does not interpret Claude UI quoted in a %s pane",
"Claude Code v2.1.212\nOpus 5 with high effort · Claude Max\nplan mode on",
@@ -1000,14 +1108,21 @@
"session.json",
"{\"agentMode\":\"medium\"}",
"medium",
- "auto",
"still reads the captured agy footer and the registry-supplied CLI version",
"permission-agy.txt",
- "gemini-3.7-flash-high"
+ "gemini-3.7-flash-high",
+ "native evidence recovery",
+ "configured effort",
+ "optional config",
+ "pane",
+ "rejects a deferred %s after a complete hold/recovery cycle",
+ "stale-model",
+ "incomplete",
+ "held-model"
]
},
"cases": {
- "opencode panes": "7acacee90b90e18e25f7",
+ "opencode panes": "6fb3c67c52bc7a093c11",
"opencode transcript: lib/__fixtures__/agy-session.jsonl": "75fb94294849f1378a16",
"opencode transcript: lib/__fixtures__/amp-session-queued.jsonl": "570c99b3f3956b025567",
"opencode transcript: lib/__fixtures__/amp-session.jsonl": "9c9cec21f716a0927c48",
@@ -1033,7 +1148,7 @@
"opencode transcript: engines/muse/normalizer.spec.ts#cdc1c45e4378": "01a89b866f339f9ca63f",
"opencode transcript: engines/pi/normalizer.spec.ts#74a8b245d519": "9c9cec21f716a0927c48",
"opencode switch": "a5ff8a8d4c7b2b9f2c20",
- "cursor panes": "917e520a3ed9dd31ae9a",
+ "cursor panes": "e5b21636df420ed58c7b",
"cursor transcript: lib/__fixtures__/agy-session.jsonl": "75fb94294849f1378a16",
"cursor transcript: lib/__fixtures__/amp-session-queued.jsonl": "570c99b3f3956b025567",
"cursor transcript: lib/__fixtures__/amp-session.jsonl": "9c9cec21f716a0927c48",
@@ -1059,7 +1174,7 @@
"cursor transcript: engines/muse/normalizer.spec.ts#cdc1c45e4378": "01a89b866f339f9ca63f",
"cursor transcript: engines/pi/normalizer.spec.ts#74a8b245d519": "db9e473dd8d5918e73ea",
"cursor switch": "a5ff8a8d4c7b2b9f2c20",
- "kilo panes": "10a4fa3919037b67f4f2",
+ "kilo panes": "82efb56293cd41c2ccf6",
"kilo transcript: lib/__fixtures__/agy-session.jsonl": "75fb94294849f1378a16",
"kilo transcript: lib/__fixtures__/amp-session-queued.jsonl": "570c99b3f3956b025567",
"kilo transcript: lib/__fixtures__/amp-session.jsonl": "9c9cec21f716a0927c48",
@@ -1085,7 +1200,7 @@
"kilo transcript: engines/muse/normalizer.spec.ts#cdc1c45e4378": "01a89b866f339f9ca63f",
"kilo transcript: engines/pi/normalizer.spec.ts#74a8b245d519": "9c9cec21f716a0927c48",
"kilo switch": "a5ff8a8d4c7b2b9f2c20",
- "devin panes": "10a4fa3919037b67f4f2",
+ "devin panes": "82efb56293cd41c2ccf6",
"devin transcript: lib/__fixtures__/agy-session.jsonl": "75fb94294849f1378a16",
"devin transcript: lib/__fixtures__/amp-session-queued.jsonl": "570c99b3f3956b025567",
"devin transcript: lib/__fixtures__/amp-session.jsonl": "9c9cec21f716a0927c48",
@@ -1111,7 +1226,7 @@
"devin transcript: engines/muse/normalizer.spec.ts#cdc1c45e4378": "01a89b866f339f9ca63f",
"devin transcript: engines/pi/normalizer.spec.ts#74a8b245d519": "9c9cec21f716a0927c48",
"devin switch": "a5ff8a8d4c7b2b9f2c20",
- "hermes panes": "8e332a7aa0ea09e55cd5",
+ "hermes panes": "3eec4631c486e37d4908",
"hermes transcript: lib/__fixtures__/agy-session.jsonl": "75fb94294849f1378a16",
"hermes transcript: lib/__fixtures__/amp-session-queued.jsonl": "570c99b3f3956b025567",
"hermes transcript: lib/__fixtures__/amp-session.jsonl": "9c9cec21f716a0927c48",
@@ -1137,7 +1252,7 @@
"hermes transcript: engines/muse/normalizer.spec.ts#cdc1c45e4378": "01a89b866f339f9ca63f",
"hermes transcript: engines/pi/normalizer.spec.ts#74a8b245d519": "9c9cec21f716a0927c48",
"hermes switch": "a5ff8a8d4c7b2b9f2c20",
- "amp panes": "10a4fa3919037b67f4f2",
+ "amp panes": "82efb56293cd41c2ccf6",
"amp transcript: lib/__fixtures__/agy-session.jsonl": "75fb94294849f1378a16",
"amp transcript: lib/__fixtures__/amp-session-queued.jsonl": "570c99b3f3956b025567",
"amp transcript: lib/__fixtures__/amp-session.jsonl": "9c9cec21f716a0927c48",
@@ -1163,7 +1278,7 @@
"amp transcript: engines/muse/normalizer.spec.ts#cdc1c45e4378": "01a89b866f339f9ca63f",
"amp transcript: engines/pi/normalizer.spec.ts#74a8b245d519": "9c9cec21f716a0927c48",
"amp switch": "a5ff8a8d4c7b2b9f2c20",
- "agy panes": "bdcfead0940bfc525994",
+ "agy panes": "368f98a2bfed8b47c9f6",
"agy transcript: lib/__fixtures__/agy-session.jsonl": "75fb94294849f1378a16",
"agy transcript: lib/__fixtures__/amp-session-queued.jsonl": "570c99b3f3956b025567",
"agy transcript: lib/__fixtures__/amp-session.jsonl": "9c9cec21f716a0927c48",
@@ -1189,7 +1304,7 @@
"agy transcript: engines/muse/normalizer.spec.ts#cdc1c45e4378": "01a89b866f339f9ca63f",
"agy transcript: engines/pi/normalizer.spec.ts#74a8b245d519": "9c9cec21f716a0927c48",
"agy switch": "a5ff8a8d4c7b2b9f2c20",
- "grok panes": "b6ae70ee3abbe0cdb93c",
+ "grok panes": "4ed4ba9310962d3d14de",
"grok transcript: lib/__fixtures__/agy-session.jsonl": "75fb94294849f1378a16",
"grok transcript: lib/__fixtures__/amp-session-queued.jsonl": "570c99b3f3956b025567",
"grok transcript: lib/__fixtures__/amp-session.jsonl": "9c9cec21f716a0927c48",
@@ -1215,7 +1330,7 @@
"grok transcript: engines/muse/normalizer.spec.ts#cdc1c45e4378": "01a89b866f339f9ca63f",
"grok transcript: engines/pi/normalizer.spec.ts#74a8b245d519": "9c9cec21f716a0927c48",
"grok switch": "a5ff8a8d4c7b2b9f2c20",
- "copilot panes": "10a4fa3919037b67f4f2",
+ "copilot panes": "82efb56293cd41c2ccf6",
"copilot transcript: lib/__fixtures__/agy-session.jsonl": "75fb94294849f1378a16",
"copilot transcript: lib/__fixtures__/amp-session-queued.jsonl": "570c99b3f3956b025567",
"copilot transcript: lib/__fixtures__/amp-session.jsonl": "9c9cec21f716a0927c48",
@@ -1241,7 +1356,7 @@
"copilot transcript: engines/muse/normalizer.spec.ts#cdc1c45e4378": "01a89b866f339f9ca63f",
"copilot transcript: engines/pi/normalizer.spec.ts#74a8b245d519": "9c9cec21f716a0927c48",
"copilot switch": "a5ff8a8d4c7b2b9f2c20",
- "commandcode panes": "fdb25cdd0d66b61c2435",
+ "commandcode panes": "da9f420370f4c7c40ddf",
"commandcode transcript: lib/__fixtures__/agy-session.jsonl": "75fb94294849f1378a16",
"commandcode transcript: lib/__fixtures__/amp-session-queued.jsonl": "570c99b3f3956b025567",
"commandcode transcript: lib/__fixtures__/amp-session.jsonl": "9c9cec21f716a0927c48",
@@ -1267,7 +1382,7 @@
"commandcode transcript: engines/muse/normalizer.spec.ts#cdc1c45e4378": "01a89b866f339f9ca63f",
"commandcode transcript: engines/pi/normalizer.spec.ts#74a8b245d519": "6cfd51fd6186b776feb1",
"commandcode switch": "a5ff8a8d4c7b2b9f2c20",
- "muse panes": "10a4fa3919037b67f4f2",
+ "muse panes": "82efb56293cd41c2ccf6",
"muse transcript: lib/__fixtures__/agy-session.jsonl": "75fb94294849f1378a16",
"muse transcript: lib/__fixtures__/amp-session-queued.jsonl": "570c99b3f3956b025567",
"muse transcript: lib/__fixtures__/amp-session.jsonl": "9c9cec21f716a0927c48",
@@ -1293,7 +1408,7 @@
"muse transcript: engines/muse/normalizer.spec.ts#cdc1c45e4378": "01a89b866f339f9ca63f",
"muse transcript: engines/pi/normalizer.spec.ts#74a8b245d519": "9c9cec21f716a0927c48",
"muse switch": "a5ff8a8d4c7b2b9f2c20",
- "pi panes": "35b331ddd26ee9f986c6",
+ "pi panes": "d3f289eff09b1848860f",
"pi transcript: lib/__fixtures__/agy-session.jsonl": "75fb94294849f1378a16",
"pi transcript: lib/__fixtures__/amp-session-queued.jsonl": "570c99b3f3956b025567",
"pi transcript: lib/__fixtures__/amp-session.jsonl": "9c9cec21f716a0927c48",
@@ -1317,12 +1432,12 @@
"pi transcript: engines/muse/normalizer.spec.ts#a2c3f58d3c15": "7e7c685f1f1e2e94a0d6",
"pi transcript: engines/muse/normalizer.spec.ts#c7fde11095ca": "7e7c685f1f1e2e94a0d6",
"pi transcript: engines/muse/normalizer.spec.ts#cdc1c45e4378": "01a89b866f339f9ca63f",
- "pi transcript: engines/pi/normalizer.spec.ts#74a8b245d519": "9c9cec21f716a0927c48",
+ "pi transcript: engines/pi/normalizer.spec.ts#74a8b245d519": "67be3d1d8c6c83e2edb6",
"pi switch": "a5ff8a8d4c7b2b9f2c20",
- "hermes config": "27d692b96d6c23b60ffe",
- "muse config": "b8c8f032f30f57741436",
- "amp config": "d5c3b8013090a7dc126c",
- "commandcode config": "28aca2a05b3be7549f22",
+ "hermes config": "60268cb7a3134660d6e1",
+ "muse config": "8654adc7647a9dc291f3",
+ "amp config": "06d8565f0af3f34cbea2",
+ "commandcode config": "791f0528150519e87405",
"opencode catalog #0: none": "f1caf45cac5732aea084",
"opencode catalog #1: a9127f3d3436": "f1caf45cac5732aea084",
"opencode catalog #2: 9dc81d7015f7": "f1caf45cac5732aea084",
diff --git a/cli/src/engines/pi/profileReader.ts b/cli/src/engines/pi/profileReader.ts
index 31ec927e2..df3ac376a 100644
--- a/cli/src/engines/pi/profileReader.ts
+++ b/cli/src/engines/pi/profileReader.ts
@@ -1,6 +1,6 @@
import type { InlineRuntimeContext, InlineRuntimeReader } from '../facets/inlineRuntime.js'
import type { RuntimeModelOption } from '../facets/runtime.js'
-import { addOption } from '../kit/runtime.js'
+import { addOption, record, text } from '../kit/runtime.js'
import { confirmObserved } from '../kit/runtimeReader.js'
import { env } from '../../config/env.js'
import { execFile } from 'node:child_process'
@@ -13,7 +13,8 @@ const CATALOG_TTL_MS = 5 * 60_000
class ProfileReader {
readonly engine = 'pi' as const
- private piCatalogCache: { key: string; expiresAt: number; entries: ReturnType<typeof parsePiModelsOutput> } | null = null
+ private piCatalogCache: { key: string; expiresAt: number; entries: ReturnType<typeof parsePiModelsOutput>; names: ReadonlySet<string> } | null = null
+ private piCatalogReading: Promise<ReturnType<typeof parsePiModelsOutput>> | null = null
pane(context: InlineRuntimeContext, paneText: string): void | false {
const { state, control } = context
@@ -24,6 +25,46 @@ class ProfileReader {
state.effort = footer.effort
state.observedAt = Date.now()
confirmObserved(control, footer.model, footer.effort)
+ return
+ }
+ // Pi 1.0: the model alone, and only a name the catalog has (see `parsePi1FooterModel`).
+ const known = this.knownModels()
+ const model = known && pi.parsePi1FooterModel(paneText, known)
+ if (!model) return
+ state.model = model
+ state.observedAt = Date.now()
+ if (control && control.target.model === model) control.modelConfirmed = true
+ }
+
+ /** The catalog's model names, as last read; a read starts here when there is none or it is old. */
+ private knownModels(): ReadonlySet<string> | null {
+ const cache = this.piCatalogCache
+ if (!cache || cache.key !== env.PI_HOME || cache.expiresAt <= Date.now()) void this.piCatalog()
+ return cache?.key === env.PI_HOME ? cache.names : null
+ }
+
+ /**
+ * Pi's session file says which model answers and how deep it thinks: a `model_change` when `/model`
+ * moves it, every assistant message's `model`, and a `thinking_level_change`. Pi 1.0 no longer prints
+ * `model • level` in its footer (its right edge clips a long model name, and a footer extension can
+ * replace it), so without this no pi harness had a model and a switch could never be confirmed.
+ */
+ transcript(context: InlineRuntimeContext, raw: Record<string, unknown>): void {
+ const { state, control } = context
+ const message = record(raw.message)
+ // Pi 1.0 writes `modelId`/`thinkingLevel`; 0.82 wrote `model`/`level`.
+ const model = raw.type === 'model_change' ? text(raw.modelId) || text(raw.model)
+ : raw.type === 'message' && message?.role === 'assistant' ? text(message.model) : null
+ const effort = raw.type === 'thinking_level_change' ? text(raw.thinkingLevel) || text(raw.level) : null
+ if (model) {
+ state.model = model
+ state.observedAt = Date.now()
+ if (control && control.target.model === model) control.modelConfirmed = true
+ }
+ if (effort && pi.PI_EFFORTS.has(effort)) {
+ state.effort = effort
+ state.observedAt = Date.now()
+ if (control && control.target.effort === effort) control.effortConfirmed = true
}
}
@@ -52,19 +93,23 @@ class ProfileReader {
if (this.piCatalogCache?.key === key && this.piCatalogCache.expiresAt > Date.now()) {
return this.piCatalogCache.entries
}
- let entries: ReturnType<typeof parsePiModelsOutput> = []
- try {
- const result = await execFileAsync('pi', ['--list-models'], {
- env: process.env,
- timeout: 10_000,
- maxBuffer: 1024 * 1024,
- })
- entries = pi.parsePiModelsOutput(result.stdout)
- } catch (err) {
- console.warn('[runtime-profile] Pi model catalog failed:', err instanceof Error ? err.message : err)
- }
- this.piCatalogCache = { key, entries, expiresAt: Date.now() + CATALOG_TTL_MS }
- return entries
+ // One read at a time: every pane read asks for the names until the first one answers.
+ this.piCatalogReading ??= (async () => {
+ let entries: ReturnType<typeof parsePiModelsOutput> = []
+ try {
+ const result = await execFileAsync('pi', ['--list-models'], {
+ env: process.env,
+ timeout: 10_000,
+ maxBuffer: 1024 * 1024,
+ })
+ entries = pi.parsePiModelsOutput(result.stdout)
+ } catch (err) {
+ console.warn('[runtime-profile] Pi model catalog failed:', err instanceof Error ? err.message : err)
+ }
+ this.piCatalogCache = { key, entries, expiresAt: Date.now() + CATALOG_TTL_MS, names: new Set(entries.map(entry => entry.model)) }
+ return entries
+ })().finally(() => { this.piCatalogReading = null })
+ return this.piCatalogReading
}
}
diff --git a/cli/src/engines/pi/runtimeProfile.spec.ts b/cli/src/engines/pi/runtimeProfile.spec.ts
index ea9ceaed9..8e375da5a 100644
--- a/cli/src/engines/pi/runtimeProfile.spec.ts
+++ b/cli/src/engines/pi/runtimeProfile.spec.ts
@@ -1,5 +1,6 @@
import { describe, expect, it } from 'vitest'
import {
+ parsePi1FooterModel,
parsePiFooterProfile,
parsePiModelsOutput,
parsePiThinkingSelection,
@@ -14,6 +15,31 @@ const OUTPUT = [
'openai gpt-5.6 400K 100K no yes ',
].join('\n')
+// Pi 1.0.0's footer (2026-10-15): the usage line ends with the model, with no thinking level, and the
+// window's edge clips a long name. A footer extension adds lines of its own around it.
+describe('the Pi 1.0 footer', () => {
+ const known = new Set(['Qwen/Qwen3.8-27B', 'DeepSeek-V4-Flash-0731'])
+ const footer = (usage: string) => [
+ '────────────────────────────────────────────────────────────────────────────────',
+ '~/Workspace/aptis-notes',
+ usage,
+ '🔌 MCP: 2 servers enabled',
+ ].join('\n')
+
+ it('reads the model a catalog has', () => {
+ expect(parsePi1FooterModel(footer('0.0%/256k (auto) Qwen/Qwen3.8-27B'), known))
+ .toBe('Qwen/Qwen3.8-27B')
+ expect(parsePi1FooterModel(footer('↑14M ↓289k R21M CH0.0% 51.4%/256k (auto) DeepSeek-V4-Flash-0731'), known))
+ .toBe('DeepSeek-V4-Flash-0731')
+ })
+
+ it('takes no clipped name, and no name the catalog does not have', () => {
+ expect(parsePi1FooterModel(footer('↑59M ↓1.4M R126M CH97.2% 25.7%/256k (auto) DeepSeek-V4-Fla'), known)).toBeNull()
+ expect(parsePi1FooterModel(footer('0.0%/256k (auto) Some-Other-Model'), known)).toBeNull()
+ expect(parsePi1FooterModel('no usage line here', known)).toBeNull()
+ })
+})
+
describe('pi model catalog', () => {
it('reads provider, model and the thinking column', () => {
expect(parsePiModelsOutput(OUTPUT)).toEqual([
diff --git a/cli/src/engines/pi/runtimeProfile.ts b/cli/src/engines/pi/runtimeProfile.ts
index 91821fdb0..ded960a48 100644
--- a/cli/src/engines/pi/runtimeProfile.ts
+++ b/cli/src/engines/pi/runtimeProfile.ts
@@ -75,6 +75,21 @@ export function parsePiFooterProfile(capture: string): { model: string; effort:
return null
}
+/**
+ * The model at the right of Pi 1.0's usage line (`0.0%/256k (auto) Qwen/Qwen3.8-27B`), which no
+ * longer says the thinking level. The window's edge clips a long name (`DeepSeek-V4-Fla`), so only a name
+ * that is exactly one of [known] (the `pi --list-models` catalog) is taken: a clipped one is no model at
+ * all. A Pi that has not answered yet has no session record to say it, so this is all there is then.
+ */
+export function parsePi1FooterModel(capture: string, known: ReadonlySet<string>): string | null {
+ const lines = capture.split('\n')
+ for (let i = lines.length - 1; i >= 0; i--) {
+ const match = /\d%\/\d+(?:\.\d+)?[kKmM]\b.*?\s{2,}(\S+)\s*$/.exec(lines[i])
+ if (match) return known.has(match[1]) ? match[1] : null
+ }
+ return null
+}
+
/**
* Steps to walk pi's "Thinking Level" list from one level to another: positive means Down. Null when
* either end is not on the ladder, which the caller must treat as "do not drive the list blind".
diff --git a/cli/src/lib/engineLaunch.spec.ts b/cli/src/lib/engineLaunch.spec.ts
index 89b785ec1..be5964063 100644
--- a/cli/src/lib/engineLaunch.spec.ts
+++ b/cli/src/lib/engineLaunch.spec.ts
@@ -51,6 +51,7 @@ import { DSH_SESSION_ENV, harnessEnvToClear } from '../dsh/launch.js'
import { launchScriptOf } from '../testing/launchScript.js'
import { buildGridEngineLaunch, gridConflictingEnvToClear } from './gridLaunch.js'
import { TmuxBackend } from './tmuxBackend.js'
+import { resumeSessionId } from './tmux.js'
// What these cases test is what real shells make of the scripts this module writes: sh, dash, bash and
// zsh run each one, and nothing here could be faked without faking the subject. Each run carries its own
@@ -728,6 +729,13 @@ printf '%s %s' "$harness_status" "$resumed"`], { encoding: 'utf8', stdio: ['igno
.toEqual([engineBin('opencode'), '--session', 'ses_1'])
})
+ it('reopens a Pi by its exact id, which Pi creates when nothing was written to it yet', () => {
+ // `pi --session <id>` exits with "No session found matching" until the first reply writes the file.
+ const id = '019a2b3c-4d5e-7f60-8a9b-0c1d2e3f4a5b'
+ expect(buildEngineCommandArgv('pi', { resumeSessionId: id })).toEqual([engineBin('pi'), '--session-id', id])
+ expect(resumeSessionId('pi', `pi --session-id ${id}`)).toBe(id)
+ })
+
it('puts a subcommand-style resume FIRST, ahead of any other flag', () => {
expect(buildEngineCommandArgv('codex', { resumeSessionId: 'abc-123' }))
.toEqual([engineBin('codex'), 'resume', 'abc-123', ...CODEX_SCREEN])
diff --git a/cli/src/lib/engineLaunch.ts b/cli/src/lib/engineLaunch.ts
index 0205eef39..a12bf0b86 100644
--- a/cli/src/lib/engineLaunch.ts
+++ b/cli/src/lib/engineLaunch.ts
@@ -312,7 +312,11 @@ export const LAUNCH_RESUME_FLAG: Readonly<Partial<Record<AgentEngine, string[]>>
cursor: ['--resume'],
opencode: ['--session'],
kilo: ['--session'],
- pi: ['--session'],
+ // Not `--session`: Pi writes a session's file only once its first reply lands, and `--session <id>`
+ // with no file answers "No session found matching" and exits, so a Pi nobody had written to yet died
+ // on a model switch or a restart. `--session-id` opens that project's session when it exists and
+ // creates it under the same id when it does not (Pi 1.0 `createSessionManager`).
+ pi: ['--session-id'],
hermes: ['--resume'],
commandcode: ['--resume'],
muse: ['resume'],
diff --git a/cli/src/lib/runtimeProfileState.spec.ts b/cli/src/lib/runtimeProfileState.spec.ts
index 620d09738..ce4c3b308 100644
--- a/cli/src/lib/runtimeProfileState.spec.ts
+++ b/cli/src/lib/runtimeProfileState.spec.ts
@@ -383,6 +383,39 @@ describe('runtime profiles without the pilot implementations', () => {
expect(manager.getState(agent.sessionId)).toEqual(before)
})
+ // Pi 1.0 prints no `model • level` in its footer: the right edge clips the model's name and a footer
+ // extension can replace the line. Its session file still says both (shapes from a Pi 1.0.0 session,
+ // 2026-10-15; the values are invented).
+ it('reads Pi 1.0 model and thinking level from its session, never from the clipped footer', () => {
+ const manager = new RuntimeProfileState(() => undefined)
+ const agent = session('pi')
+ manager.hydrate(agent, [
+ '{"type":"session","version":3,"id":"s1","timestamp":"2026-10-15T03:00:00.000Z","cwd":"/tmp/pi"}',
+ '{"type":"model_change","id":"m1","parentId":null,"timestamp":"2026-10-15T03:00:01.000Z","provider":"autonomous-ai","modelId":"DeepSeek-V4-Flash-0731"}',
+ '{"type":"thinking_level_change","id":"t1","parentId":"m1","timestamp":"2026-10-15T03:00:01.000Z","thinkingLevel":"off"}',
+ ])
+ expect(parseRuntimeProfile(manager.selectedModel(agent))).toMatchObject({ engine: 'pi', model: 'DeepSeek-V4-Flash-0731', effort: 'off' })
+ expect(manager.ingestPane(agent, '↑14M ↓289k R21M CH0.0% 51.4%/256k (auto) DeepSeek-V4-Fla', true)).toBe(false)
+ expect(parseRuntimeProfile(manager.selectedModel(agent))?.model).toBe('DeepSeek-V4-Flash-0731')
+ // Every answer names the model that gave it.
+ expect(manager.ingest(agent, JSON.stringify({ type: 'message', message: {
+ role: 'assistant', provider: 'autonomous-ai', model: 'Qwen/Qwen3.8-27B', content: [{ type: 'text', text: 'ok' }],
+ } }), true)).toBe(true)
+ expect(parseRuntimeProfile(manager.selectedModel(agent))?.model).toBe('Qwen/Qwen3.8-27B')
+ // A person's message names none.
+ expect(manager.ingest(agent, JSON.stringify({ type: 'message', message: { role: 'user', model: 'other', content: [] } }), true)).toBe(false)
+ })
+
+ it('confirms a Pi switch from the model_change its /model writes', async () => {
+ const manager = new RuntimeProfileState(() => undefined)
+ const agent = session('pi')
+ manager.hydrate(agent, ['{"type":"model_change","provider":"autonomous-ai","modelId":"DeepSeek-V4-Flash-0731"}'])
+ manager.beginControl(agent, { id: 'target', sessionId: agent.sessionId, engine: agent.engine, model: 'Qwen/Qwen3.8-27B', effort: 'auto' })
+ const waiting = manager.waitForModel(agent.sessionId, 1000)
+ manager.ingest(agent, '{"type":"model_change","provider":"autonomous-ai","modelId":"Qwen/Qwen3.8-27B"}', true)
+ expect(await waiting).toBe(true)
+ })
+
it.each(['amp', 'muse', 'copilot', 'terminal'] as const)('does not interpret Claude UI quoted in a %s pane', engine => {
// Apply the same boundary in explicit inline mode. Supplying a Claude facet must not make it a
// fallback for engines whose profile source is their own config or registration.
diff --git a/desktop/lib/widgets/grid_model_picker.dart b/desktop/lib/widgets/grid_model_picker.dart
index 517464348..e151a0ca9 100644
--- a/desktop/lib/widgets/grid_model_picker.dart
+++ b/desktop/lib/widgets/grid_model_picker.dart
@@ -28,13 +28,14 @@ import 'resting_section.dart';
/// Named here rather than derived from the daemon's `localModelEngines`, because the two answer
/// different questions. That list is which engines a Local model *can* be handed to — a launch
/// contract exists for seven of them. This is the narrower question of which ones a person is
-/// OFFERED the switch on, and it is the three whose switching has been driven end to end: Claude
-/// Code and Codex move by environment, and OpenCode by a config file plus its own `/models` picker.
+/// OFFERED the switch on, and it is the four whose switching has been driven end to end: Claude
+/// Code and Codex move by environment, OpenCode by a config file plus its own `/models` picker, and
+/// Pi by its own home re-pointed at the grid, settings and conversation kept (#1318).
///
/// The rest keep the header they had. A picker on an engine whose move has never been watched work
/// is a menu that looks like a choice and may not be one, and the cost of finding out is an agent
/// answering on a model nobody asked for.
-const Set<String> kModelPickerEngines = {'claude', 'codex', 'opencode'};
+const Set<String> kModelPickerEngines = {'claude', 'codex', 'opencode', 'pi'};
/// Whether [engine] gets a picker. Unknown or absent is NO — a header offers nothing it cannot back.
bool modelPickerSupports(String? engine) =>
diff --git a/desktop/test/grid_model_picker_test.dart b/desktop/test/grid_model_picker_test.dart
index 1e9663e14..4117b0906 100644
--- a/desktop/test/grid_model_picker_test.dart
+++ b/desktop/test/grid_model_picker_test.dart
@@ -932,13 +932,14 @@ void main() {
});
group('which engines are offered a picker at all', () {
- test('the three whose switching has been driven end to end', () {
+ test('the four whose switching has been driven end to end', () {
// Not the daemon's `localModelEngines`, which is the wider "could a Local model be handed to
// this engine" — seven carry a launch contract. This is which ones a person is OFFERED the
- // switch on, and it is the three that have been watched work: Claude Code and Codex move by
- // environment, OpenCode by a config file plus its own `/models` picker.
- expect(kModelPickerEngines, {'claude', 'codex', 'opencode'});
- for (final engine in ['claude', 'codex', 'opencode']) {
+ // switch on, and it is the four that have been watched work: Claude Code and Codex move by
+ // environment, OpenCode by a config file plus its own `/models` picker, Pi by its own home
+ // re-pointed at the grid.
+ expect(kModelPickerEngines, {'claude', 'codex', 'opencode', 'pi'});
+ for (final engine in ['claude', 'codex', 'opencode', 'pi']) {
expect(modelPickerSupports(engine), isTrue, reason: engine);
}
});
@@ -951,7 +952,6 @@ void main() {
'cursor',
'hermes',
'grok',
- 'pi',
'kilo',
'amp',
'devin',
diff --git a/tui/Cargo.lock b/tui/Cargo.lock
index a061bf828..7b31a03c9 100644
--- a/tui/Cargo.lock
+++ b/tui/Cargo.lock
@@ -654,7 +654,7 @@ dependencies = [
[[package]]
name = "harness-tui"
-version = "0.1.32"
+version = "0.1.33"
dependencies = [
"alacritty_terminal",
"base64",
diff --git a/tui/Cargo.toml b/tui/Cargo.toml
index ad593b2f5..f3b15a643 100644
--- a/tui/Cargo.toml
+++ b/tui/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "harness-tui"
-version = "0.1.32"
+version = "0.1.33"
edition = "2024"
[dependencies]
diff --git a/tui/src/models.rs b/tui/src/models.rs
index 0775e6aa5..006269764 100644
--- a/tui/src/models.rs
+++ b/tui/src/models.rs
@@ -560,12 +560,13 @@ fn due(last: Option<&Instant>, every: Duration, now: Instant) -> bool { last.is_
#[derive(Clone, Debug)]
pub struct Target { pub machine: String, pub agent: String, pub engine: String, pub grid_model: String, pub base_url: String }
-/// The desktop offers pane model switches for these verified engines. Other engines keep
-/// their own in-terminal controls; the global Models view still manages local models.
+/// The desktop offers pane model switches for these verified engines (Pi since its move onto a grid
+/// keeps its home, #1318). Other engines keep their own in-terminal controls; the global Models view
+/// still manages local models.
pub fn pane_supports(app: &App, pane: u64) -> bool {
let Some(p) = app.panes.get(&pane) else { return false };
app.fleet.machine(&p.machine_id).is_some_and(|m| !m.shared)
- && app.fleet.agent(&p.machine_id, &p.agent_id).is_some_and(|a| a.status != "stopped" && ["codex", "claude", "opencode"].contains(&a.engine.as_str()))
+ && app.fleet.agent(&p.machine_id, &p.agent_id).is_some_and(|a| a.status != "stopped" && ["codex", "claude", "opencode", "pi"].contains(&a.engine.as_str()))
}
/// The model the pane's harness runs, as its title names it: Grid's, or what the engine reported.
@@ -2692,6 +2693,17 @@ mod tests {
/// A harness just opened reads as its terminal until the daemon sees the engine in it (OpenCode:
/// ~7 s). Models opened in that window takes the engine once it is seen — the same pane, never
/// another — instead of saying "focus a harness" until it is closed and opened again.
+ /// "Change model…" on a pane: the engines whose move has been watched work, Pi among them.
+ #[test]
+ fn a_pi_pane_offers_change_model_and_an_unverified_engine_does_not() {
+ let mut app = app();
+ app.panes.insert(1, crate::pane::Pane::new(1, "local", "t1", 75, 40));
+ for (engine, offered) in [("pi", true), ("opencode", true), ("claude", true), ("cursor", false), ("terminal", false)] {
+ app.fleet.agents.insert(("local".into(), "t1".into()), crate::fleet::agent_from("local", &json!({ "id": "t1", "name": "a", "engine": engine }), None));
+ assert_eq!(pane_supports(&app, 1), offered, "{engine}");
+ }
+ }
+
#[test]
fn models_opened_while_a_harness_starts_takes_it_once_its_engine_is_seen() {
let mut app = app();