Claude Code. Any Model. The most powerful AI coding agent now speaks every language.
fix(team): accept the agent-labelled input box rule at slot boot
Jack Rudenkocada488aaa63
diff --git a/ai-docs/architecture/pane-session.md b/ai-docs/architecture/pane-session.mdindex 01b8ed5c..1dc12e4e 100644--- a/ai-docs/architecture/pane-session.md+++ b/ai-docs/architecture/pane-session.md@@ -89,7 +89,10 @@ The follower polls on every frame (debounced 250 ms) and on a 1 s backstop.Boot is ready when the screen shows the REPL input box — a full-width `─` rule, a row starting`❯` + U+00A0, a second rule — with nothing typed, for 500 ms. Placeholder text in the box carries-magmux attribute 2 (faint) and does not count as typed. Measured spawn → empty box: 0.67–1.97 s+magmux attribute 2 (faint) and does not count as typed. Under `--agent` the top rule carries the+agent's name at its right end (`──── dev:reviewer ─`); `isBoxRule` accepts that one label, and+until 10.4.2 it did not, so every slot given an `agent` failed `boot_timeout` at 90 s with a ready+box on screen (fixture `repl-boot-agent`). Measured spawn → empty box: 0.67–1.97 swith catalog warm-up off; the ≈11 s of earlier research included claudish's 4–7 s catalog warm-up.What blocks boot is decided by **"no input box"**, and named by a closed list:diff --git a/packages/cli/src/pane/screen-classifier.test.ts b/packages/cli/src/pane/screen-classifier.test.tsindex 1599b3d9..5950e87e 100644--- a/packages/cli/src/pane/screen-classifier.test.ts+++ b/packages/cli/src/pane/screen-classifier.test.ts@@ -13,10 +13,11 @@ import {} from "./screen-classifier.js";import { loadScreen } from "./test-helpers/fixtures.js";-/** Every fixture screen, all real 2.1.290 captures (phase2-captures.md §3). */+/** Real 2.1.290 captures (phase2-captures.md §3), plus the 2.1.293 agent boot capture. */const REPL_SCREENS = ["repl-boot-empty","repl-boot-placeholder",+ "repl-boot-agent","repl-typed","repl-typed-multiline","menu-at-open",@@ -58,6 +59,12 @@ describe("readBoot", () => {expect(readBoot(s)).toEqual({ kind: "repl" });});+ test("the agent-labelled boot box reads repl with no typed text", () => {+ const s = loadScreen("repl-boot-agent");+ expect(readBoot(s)).toEqual({ kind: "repl" });+ expect(inputBox(s)?.text).toBe("");+ });+test("typed text is not an empty box", () => {expect(inputBox(loadScreen("repl-typed"))?.text).toBe("alpha");expect(inputBox(loadScreen("repl-typed-multiline"))?.text).toBe("alpha\nbeta");diff --git a/packages/cli/src/pane/screen-model.test.ts b/packages/cli/src/pane/screen-model.test.tsindex 66f5d0b2..c04e0321 100644--- a/packages/cli/src/pane/screen-model.test.ts+++ b/packages/cli/src/pane/screen-model.test.ts@@ -5,6 +5,7 @@ import {applyFrame,boxTopRow,emptyScreen,+ isBoxRule,} from "./screen-model.js";import { loadFrames, loadScreen } from "./test-helpers/fixtures.js";@@ -83,6 +84,40 @@ describe("screen-model over real magmux frames (phase-2 s01)", () => {});});+describe("isBoxRule", () => {+ test("accepts the agent-labelled top rule from the live capture", () => {+ const s = loadScreen("repl-boot-agent");+ expect(isBoxRule(s.lines[45], s.cols)).toBe(true);+ });++ test("rejects a labelled rule shorter than cols minus one", () => {+ const { cols } = loadScreen("repl-boot-agent");+ const tail = " Explore ─";+ const line = "─".repeat(cols - 2 - tail.length) + tail;+ expect(line.length).toBe(cols - 2);+ expect(isBoxRule(line, cols)).toBe(false);+ });++ test("rejects text without a trailing rule", () => {+ expect(isBoxRule("─".repeat(152) + " Explore", 160)).toBe(false);+ });++ test("rejects a line starting with text", () => {+ expect(isBoxRule("Explore " + "─".repeat(155), 160)).toBe(false);+ });++ test("rejects a rule with two labels", () => {+ expect(isBoxRule("─".repeat(150) + " Explore ─ Plan ─", 160)).toBe(false);+ });+});++describe("boxTopRow", () => {+ test("finds row 45 under --agent in the live capture", () => {+ const s = loadScreen("repl-boot-agent");+ expect(boxTopRow(s.lines, s.cols)).toBe(45);+ });+});+describe("aboveBoxChangedAt", () => {test("ignores the status rows under the box but moves for the working row above it", () => {let s = emptyScreen(160, 50);diff --git a/packages/cli/src/pane/screen-model.ts b/packages/cli/src/pane/screen-model.tsindex 3313f8d7..fd14ab76 100644--- a/packages/cli/src/pane/screen-model.ts+++ b/packages/cli/src/pane/screen-model.ts@@ -66,9 +66,13 @@ export function emptyScreen(cols: number, rows: number): ScreenState {};}-/** A full-width box rule: only `─`, at least 20 of them and at least cols−1 wide. */+/**+ * A full-width box rule: `─`, at least 20 cells and at least cols−1 wide. Under `--agent`,+ * Claude Code writes the agent's name into the top rule's right end (`──── dev:reviewer ─`),+ * so one ` label ─` tail is part of the rule.+ */export function isBoxRule(line: string | undefined, cols: number): boolean {- if (!line || !/^─+$/.test(line)) return false;+ if (!line || !/^─+(?: [^─]+ ─+)?$/.test(line)) return false;return line.length >= Math.max(20, Math.min(cols, 160) - 1);}diff --git a/packages/cli/src/pane/test-fixtures/screens/repl-boot-agent.json b/packages/cli/src/pane/test-fixtures/screens/repl-boot-agent.jsonnew file mode 100644index 00000000..387f771d--- /dev/null+++ b/packages/cli/src/pane/test-fixtures/screens/repl-boot-agent.json@@ -0,0 +1,169 @@+{+ "source": "live capture: claude --model haiku --agent Explore --dangerously-skip-permissions, headless magmux 160x50, boot screen, no prompt sent (claudish agent boot_timeout bug, 2026-10-08)",+ "claudeCode": "2.1.293",+ "magmux": "0.14.0",+ "rows": 50,+ "cols": 160,+ "alt": true,+ "cursor": {+ "x": 2,+ "y": 46+ },+ "lines": [+ "",+ " ▐▛███▛█ Claude Code v2.1.293",+ "▝▜██████▀ Haiku 5.5 · Claude Max",+ " ▝▝ ▝▝ @Explore · ~/mag/claudish/.claude/worktrees/team-session-start-error · /rc",+ "",+ "",+ "",+ "",+ "",+ "",+ "",+ "",+ "",+ "",+ "",+ "",+ "",+ "",+ "",+ "",+ "",+ "",+ "",+ "",+ "",+ "",+ "",+ "",+ "",+ "",+ "",+ "",+ "",+ "",+ "",+ "",+ "",+ "",+ "",+ "",+ "",+ "",+ "",+ "",+ " ◐ medium · /effort",+ "────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── Explore ─",+ "❯ Try \"how does cli.ts work?\"",+ "────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────",+ " * Haiku | →Explore | wt:team-session-start-error | I | $0.00 | 0s | 408M | ⎇ +6/-2 | ░░░░░░ 0% | █▄▄▄▄▄---- 5h:15% ↻2h16m 7d:64% ↻3d4h",+ " -- INSERT -- ⏵⏵ bypass permissions on (shift+tab to cycle) · ← 5 agents"+ ],+ "spans": [+ [],+ [[0, 2, 174, -1, 0], [2, 6, 174, 16, 0], [11, 11, -1, -1, 1], [23, 8, 241, -1, 0]],+ [[0, 2, 174, -1, 0], [2, 5, 174, 16, 0], [7, 2, 174, -1, 0], [11, 22, 241, -1, 0]],+ [[0, 9, 174, -1, 0], [11, 71, 241, -1, 0], [82, 3, 65, -1, 0]],+ [],+ [],+ [],+ [],+ [],+ [],+ [],+ [],+ [],+ [],+ [],+ [],+ [],+ [],+ [],+ [],+ [],+ [],+ [],+ [],+ [],+ [],+ [],+ [],+ [],+ [],+ [],+ [],+ [],+ [],+ [],+ [],+ [],+ [],+ [],+ [],+ [],+ [],+ [],+ [],+ [[140, 18, 241, -1, 0]],+ [[0, 160, 245, -1, 0]],+ [[2, 27, -1, -1, 2]],+ [[0, 160, 245, -1, 0]],+ [+ [2, 7, 30, -1, 1],+ [9, 1, 241, -1, 0],+ [10, 1, 245, -1, 0],+ [11, 1, 241, -1, 0],+ [12, 8, 30, -1, 0],+ [20, 1, 241, -1, 0],+ [21, 1, 245, -1, 0],+ [22, 1, 241, -1, 0],+ [23, 29, 238, 153, 1],+ [52, 1, 241, -1, 0],+ [53, 1, 245, -1, 0],+ [54, 1, 241, -1, 0],+ [55, 3, 238, 151, 1],+ [58, 1, 241, -1, 0],+ [59, 1, 245, -1, 0],+ [60, 1, 241, -1, 0],+ [61, 5, 130, -1, 0],+ [66, 1, 241, -1, 0],+ [67, 1, 245, -1, 0],+ [68, 1, 241, -1, 0],+ [69, 2, 96, -1, 0],+ [71, 1, 241, -1, 0],+ [72, 1, 245, -1, 0],+ [73, 1, 241, -1, 0],+ [74, 6, 30, -1, 0],+ [80, 1, 241, -1, 0],+ [81, 1, 245, -1, 0],+ [82, 1, 241, -1, 0],+ [83, 1, 130, -1, 0],+ [84, 1, 241, -1, 0],+ [85, 2, 65, -1, 0],+ [87, 1, 245, -1, 0],+ [88, 2, 160, -1, 0],+ [90, 1, 241, -1, 0],+ [91, 1, 245, -1, 0],+ [92, 1, 241, -1, 0],+ [93, 6, 245, -1, 0],+ [99, 1, 241, -1, 0],+ [100, 2, 65, -1, 0],+ [102, 1, 241, -1, 0],+ [103, 1, 245, -1, 0],+ [104, 1, 241, -1, 0],+ [105, 6, 32, -1, 0],+ [111, 4, 245, -1, 0],+ [115, 1, 241, -1, 0],+ [116, 6, 66, -1, 0],+ [122, 1, 241, -1, 0],+ [123, 6, 245, -1, 0],+ [129, 1, 241, -1, 0],+ [130, 6, 61, -1, 0],+ [136, 1, 241, -1, 0],+ [137, 5, 245, -1, 0]+ ],+ [[2, 12, 241, -1, 0], [15, 24, 131, -1, 0], [39, 34, 241, -1, 0]]+ ]+}