Dodaios is an open-source agent OS for your desktop: it runs your coding agents, browser and apps by voice or chat, on your own machine. Formerly Personal Jarvis.
Python agent-orchestrationai-agentai-coding-assistantclaude-codecoding-agentcomputer-usedesktop-applocal-firstmcppersonal-jarvisvoice-assistantvoice-coding
feat(ide): raise the workspace limit from 8 to 16 coding agents
rubenluetke10-beep7b11e9f41594
diff --git a/docs/igentic-workspaces.md b/docs/igentic-workspaces.mdindex f6223b9f92..bafaad491a 100644--- a/docs/igentic-workspaces.md+++ b/docs/igentic-workspaces.md@@ -2,7 +2,7 @@The IDE is organized as **Project > Workspace > Coding Agent session**. Aproject is a connected folder in the existing project library. A workspace is-an independently named group of up to eight coding sessions in that project.+an independently named group of up to sixteen coding sessions in that project.Multiple workspaces may use the same folder; independent sessions do not implyisolated source checkouts. Users who need separate files connect a worktree asanother project.@@ -15,9 +15,12 @@ shows open and saved workspaces, their session counts, and active selection.Selecting an open workspace changes the visible group and active runtime ID;it does not stop background agents. Restoring a closed workspace is explicit.-The grid uses at most four columns and two rows on a sufficiently wide display.-Narrow screens retain at most two rows and scroll horizontally when necessary,-rather than shrinking the user's terminal font. Dragging a card header or using+The grid uses at most four columns and four rows. The automatic even grid+keeps one or two rows for up to eight sessions and adds a row per four sessions+beyond that (nine is 3 x 3, sixteen is 4 x 4). Screens too small for every pane's+minimum size scroll rather than shrinking the user's terminal font. The limit is+`MAX_TERMINALS` in `jarvis/agentic_ide/session.py`; the frontend reads it from+the state's `max_terminals`. Dragging a card header or usingAlt+Arrow reorders stable session IDs. Reordering does not recreate the CLIprocess. Each tile uses the existingPTY adapter, output replay, reconnect budget, and terminal appearance tokens.@@ -26,7 +29,7 @@ Project IDs come from the canonical folder identity. Workspace IDs surviverestore. A coding session is addressed as `pane:<history_id>`; its display nameand grid position are not execution identities. Additive snapshot migrationretains older project-less workspaces and keeps sibling workspaces in the same-folder distinct. Older snapshots above the eight-session limit are retained+folder distinct. Older snapshots above the session limit are retainedbut cannot be restored into the new grid unchanged.## Live integrationdiff --git a/jarvis/agentic_ide/session.py b/jarvis/agentic_ide/session.pyindex 3cce25cb8b..b742626900 100644--- a/jarvis/agentic_ide/session.py+++ b/jarvis/agentic_ide/session.py@@ -217,8 +217,30 @@ def _unavailable(agent: str) -> str:return f"{pretty} cannot open: this machine has no shell Jarvis can start."-# One workspace fits at most four columns and two rows of coding sessions.-MAX_TERMINALS = 8+# How many coding sessions one workspace may hold. Every pane is a full CLI+# process with its own pseudo-terminal and socket, so this is a resource+# ceiling, not a layout rule. It matches the largest grid the workspace draws+# (MAX_GRID_COLUMNS x MAX_GRID_ROWS); past it, a second workspace tab is the+# better home. Voice call-signs cover it (see `names._NUMBER_WORDS`). Mirrored+# by the frontend's `workspaceDocking.ts`, which reads the count from the state.+MAX_GRID_COLUMNS = 4+MAX_GRID_ROWS = 4+MAX_TERMINALS = MAX_GRID_COLUMNS * MAX_GRID_ROWS+++def balanced_columns(count: int) -> int:+ """Columns of the even grid ``count`` panes are dealt into, row by row.++ Two panes read best side by side; three to eight form two rows (six is+ 3 x 2); beyond that the grid grows a row per four panes, never wider than+ MAX_GRID_COLUMNS. Mirrored by `balancedLayout` in ``workspaceDocking.ts``.+ """+ if count <= 2:+ return max(1, count)+ rows = 2 if count <= 2 * MAX_GRID_COLUMNS else -(-count // MAX_GRID_COLUMNS)+ return min(MAX_GRID_COLUMNS, -(-count // rows))++# How deep a wizard-opened column is filled before the next one is started.## The workspace is exactly one screenful, so its columns share the window's@@ -2657,10 +2679,7 @@ class Registry:"""Keep legacy geometry consistent with the persistent terminal order."""# Rebuild the legacy split tree from the new order. Old geometry# must never sort the terminals back into their previous positions.- count = len(session.terminals)- # Two panes read best side by side. From three onward, balance the- # group into at most two rows and four columns (six becomes 3 x 2).- columns = 2 if count == 2 else min(4, (count + 1) // 2)+ columns = balanced_columns(len(session.terminals))rows = [layout_tree.normalize(layout_tree.Split(@@ -5973,6 +5992,8 @@ __all__ = ["AGENT_BINARIES","AGENT_DISPLAY","MAX_PROMPT_CHARS",+ "MAX_GRID_COLUMNS",+ "MAX_GRID_ROWS","MAX_TERMINALS","MAX_WORKSPACES","PLAIN_TERMINAL",diff --git a/jarvis/ui/web/frontend/src/components/agentic/AgenticTerminal.tsx b/jarvis/ui/web/frontend/src/components/agentic/AgenticTerminal.tsxindex e64d551787..528236ec16 100644--- a/jarvis/ui/web/frontend/src/components/agentic/AgenticTerminal.tsx+++ b/jarvis/ui/web/frontend/src/components/agentic/AgenticTerminal.tsx@@ -855,11 +855,11 @@ export function AgenticTerminal({// module exists to prevent.fontFamily: TERMINAL_FONT_STACK,fontSize: fontSizeRef.current,- // A dense console line height, like a standalone terminal: at 1.3 a pane- // showed far fewer rows than the same window in a native terminal, which- // read as "zoomed in". Kept integral-friendly: fractional cell heights- // round differently per row and make a redrawn TUI box look ragged.- lineHeight: 1.2,+ // Roomier than a console default — the single biggest readability win for+ // an agent that prints prose, diffs and file trees rather than log lines.+ // Kept integral-friendly: fractional cell heights round differently per+ // row and make a redrawn TUI box look ragged.+ lineHeight: 1.3,// Zero, not 0.2: extra tracking is added per cell, so a box-drawing frame// and the text under it accumulate different sub-pixel offsets and the// frame visibly bends. Monospace legibility comes from the line height.diff --git a/jarvis/ui/web/frontend/src/components/agentic/WorkspaceOptionsDialog.test.tsx b/jarvis/ui/web/frontend/src/components/agentic/WorkspaceOptionsDialog.test.tsxindex a284606a56..c44d1d80c6 100644--- a/jarvis/ui/web/frontend/src/components/agentic/WorkspaceOptionsDialog.test.tsx+++ b/jarvis/ui/web/frontend/src/components/agentic/WorkspaceOptionsDialog.test.tsx@@ -5,7 +5,7 @@ import { WorkspaceOptionsDialog } from "./WorkspaceOptionsDialog";afterEach(cleanup);const setup = () => ({open: true, onOpenChange: vi.fn(), workspace: "Installer", count: 6, busy: false, canAdd: true,- onAdd: vi.fn(), onBalance: vi.fn(), onRename: vi.fn(), onClose: vi.fn(),+ maxPanes: 16, onAdd: vi.fn(), onBalance: vi.fn(), onRename: vi.fn(), onClose: vi.fn(),appearance: null, onAppearance: vi.fn(),});@@ -21,9 +21,9 @@ it("keeps arrangement and display controls accessible without a main toolbar", (expect(props.onBalance).toHaveBeenCalledOnce();});-it("disables adding a ninth session and closes with Escape", () => {+it("disables adding past the workspace limit and closes with Escape", () => {const props = setup();- render(<WorkspaceOptionsDialog {...props} count={8} />);+ render(<WorkspaceOptionsDialog {...props} count={16} maxPanes={16} />);expect((screen.getByRole("button", { name: "Add coding agent" }) as HTMLButtonElement).disabled).toBe(true);fireEvent.keyDown(document, { key: "Escape" });expect(props.onOpenChange).toHaveBeenCalledWith(false);diff --git a/jarvis/ui/web/frontend/src/components/agentic/WorkspaceOptionsDialog.tsx b/jarvis/ui/web/frontend/src/components/agentic/WorkspaceOptionsDialog.tsxindex 18d0b3bd73..1aa84b0cd3 100644--- a/jarvis/ui/web/frontend/src/components/agentic/WorkspaceOptionsDialog.tsx+++ b/jarvis/ui/web/frontend/src/components/agentic/WorkspaceOptionsDialog.tsx@@ -7,6 +7,8 @@ interface Props {onOpenChange: (open: boolean) => void;workspace: string;count: number;+ /** The server's per-workspace pane limit (`max_terminals`). */+ maxPanes: number;busy: boolean;canAdd: boolean;onAdd: () => void;@@ -45,7 +47,7 @@ export function WorkspaceOptionsDialog(props: Props) {</div></section><div className="border-t border-border pt-2">- <button type="button" disabled={props.busy || !props.canAdd || props.count >= 8} onClick={() => choose(props.onAdd)} className="block w-full rounded-lg px-2 py-2.5 text-left text-sm hover:bg-muted disabled:opacity-40">Add coding agent</button>+ <button type="button" disabled={props.busy || !props.canAdd || props.count >= props.maxPanes} onClick={() => choose(props.onAdd)} className="block w-full rounded-lg px-2 py-2.5 text-left text-sm hover:bg-muted disabled:opacity-40">Add coding agent</button><button type="button" disabled={props.busy} onClick={() => choose(props.onRename)} className="block w-full rounded-lg px-2 py-2.5 text-left text-sm hover:bg-muted disabled:opacity-40">Rename workspace</button><button type="button" disabled={props.busy} onClick={() => choose(props.onClose)} className="block w-full rounded-lg px-2 py-2.5 text-left text-sm text-destructive hover:bg-muted disabled:opacity-40">Close workspace</button></div>diff --git a/jarvis/ui/web/frontend/src/components/agentic/WorkspaceTerminalGrid.tsx b/jarvis/ui/web/frontend/src/components/agentic/WorkspaceTerminalGrid.tsxindex fade22180a..b8ee18497e 100644--- a/jarvis/ui/web/frontend/src/components/agentic/WorkspaceTerminalGrid.tsx+++ b/jarvis/ui/web/frontend/src/components/agentic/WorkspaceTerminalGrid.tsx@@ -8,7 +8,7 @@ import { useThemeValue } from "@/hooks/useTheme";import { useEventStore } from "@/store/events";import { cn } from "@/lib/utils";import { treeLayout, treeLeaves, type LayoutNode } from "./treeLayout";-import { DOCK_LABELS, dockPosition, fitsWorkspace, layoutSpan, paneStyle, previewDock, workspaceLayout } from "./workspaceDocking";+import { DOCK_LABELS, GRID_LIMIT_HINT, MAX_GRID_COLUMNS, MAX_GRID_ROWS, MAX_WORKSPACE_PANES, dockPosition, fitsWorkspace, layoutSpan, paneStyle, previewDock, workspaceLayout } from "./workspaceDocking";const GAP = 8;const MIN_WIDTH = 280;@@ -22,6 +22,8 @@ interface Props {onClose: (terminal: TerminalState) => void;onSelect: (name: string) => void;selected: string;+ /** The server's per-workspace pane limit; splitting stops there. */+ maxPanes?: number;fontSize: number;appearance: "light" | "dark" | null;disabled?: boolean;@@ -32,7 +34,7 @@ interface Props {interface DropTarget { id: string; position: PaneMovePosition; allowed: boolean }interface DragFeedback { id: string; target: DropTarget | null; x: number; y: number }-export function WorkspaceTerminalGrid({ session, onChanged, onAdd, onClose, onSelect, selected, fontSize, appearance, disabled = false, onMutationStart, onMutationEnd }: Props) {+export function WorkspaceTerminalGrid({ session, onChanged, onAdd, onClose, onSelect, selected, maxPanes = MAX_WORKSPACE_PANES, fontSize, appearance, disabled = false, onMutationStart, onMutationEnd }: Props) {const theme = useThemeValue();const pushToast = useEventStore((state) => state.pushToast);const frame = useRef<HTMLDivElement>(null);@@ -84,7 +86,7 @@ export function WorkspaceTerminalGrid({ session, onChanged, onAdd, onClose, onSeconst before = workspaceLayout(owner.layout, owner.terminals);if (!before || !source || !target) return;const next = previewDock(before, source.key, target.key, position);- if (!fitsWorkspace(next)) { setAnnouncement("Use at most four columns and two rows."); return; }+ if (!fitsWorkspace(next)) { setAnnouncement(GRID_LIMIT_HINT); return; }saveInFlight.current = true;latest.current.onMutationStart?.();setSaving(true);@@ -226,11 +228,11 @@ export function WorkspaceTerminalGrid({ session, onChanged, onAdd, onClose, onSeonClose={() => onClose(terminal)} onAttachError={(message) => pushToast("error", message)}onRename={(name) => rename(terminal, name)}restartToken={restarts[id] ?? 0} onRestart={() => setRestarts((current) => ({ ...current, [id]: (current[id] ?? 0) + 1 }))}- splitDisabled={tiles.length >= 8} onSplit={(direction) => onAdd(terminal.name, direction)} />+ splitDisabled={tiles.length >= maxPanes} onSplit={(direction) => onAdd(terminal.name, direction)} />{drag?.target?.id === id && <div aria-hidden="true" data-testid="dock-preview" data-position={drag.target.position}className={cn("pointer-events-none absolute z-20 flex items-center justify-center rounded-xl border-2 p-2", drag.target.allowed ? "border-ring/70 bg-accent/[0.15]" : "border-destructive bg-background/80",drag.target.position === "left" ? "inset-y-1 left-1 w-1/2" : drag.target.position === "right" ? "inset-y-1 right-1 w-1/2" : drag.target.position === "above" ? "inset-x-1 top-1 h-1/2" : drag.target.position === "below" ? "inset-x-1 bottom-1 h-1/2" : "inset-1")}>- <span className="rounded-md bg-popover px-3 py-2 text-center text-xs font-medium text-popover-foreground shadow-lg">{drag.target.allowed ? DOCK_LABELS[drag.target.position] : "Maximum 4 columns × 2 rows"}</span>+ <span className="rounded-md bg-popover px-3 py-2 text-center text-xs font-medium text-popover-foreground shadow-lg">{drag.target.allowed ? DOCK_LABELS[drag.target.position] : `Maximum ${MAX_GRID_COLUMNS} columns × ${MAX_GRID_ROWS} rows`}</span></div>}</div>;})}diff --git a/jarvis/ui/web/frontend/src/components/agentic/paneFont.ts b/jarvis/ui/web/frontend/src/components/agentic/paneFont.tsindex 9847ef5835..53bb2112a4 100644--- a/jarvis/ui/web/frontend/src/components/agentic/paneFont.ts+++ b/jarvis/ui/web/frontend/src/components/agentic/paneFont.ts@@ -45,11 +45,7 @@ export function storedFontSize(): number | null {}}-/**- * The size a pane opens at: always the default. The workspace terminals use- * one fixed, dense size (maintainer decision 2026-09-28), so a size stored by- * an older build is ignored.- */+/** The size a pane will actually open at — the stored one, or the default. */export function paneFontSize(): number {- return FONT_DEFAULT;+ return storedFontSize() ?? FONT_DEFAULT;}diff --git a/jarvis/ui/web/frontend/src/components/agentic/workspaceDocking.test.ts b/jarvis/ui/web/frontend/src/components/agentic/workspaceDocking.test.tsindex 650c3487bd..1b49f7cf57 100644--- a/jarvis/ui/web/frontend/src/components/agentic/workspaceDocking.test.ts+++ b/jarvis/ui/web/frontend/src/components/agentic/workspaceDocking.test.ts@@ -1,5 +1,5 @@import { describe, expect, it } from "vitest";-import { balancedLayout, dockPosition, fitsWorkspace, layoutSpan, previewDock, workspaceLayout } from "./workspaceDocking";+import { MAX_GRID_COLUMNS, MAX_GRID_ROWS, MAX_WORKSPACE_PANES, balancedColumns, balancedLayout, canSplitFit, dockPosition, fitsWorkspace, layoutSpan, previewDock, workspaceLayout } from "./workspaceDocking";import { treeLayout, treeLeaves } from "./treeLayout";describe("workspace docking geometry", () => {@@ -22,11 +22,35 @@ describe("workspace docking geometry", () => {expect(treeLeaves(row)).toEqual(["a", "b"]);});- it("rejects a third row or fifth column while allowing swaps in a full workspace", () => {- const full = balancedLayout(["a", "b", "c", "d", "e", "f", "g", "h"])!;- expect(fitsWorkspace(previewDock(full, "e", "b", "above"))).toBe(false);- expect(fitsWorkspace(previewDock(full, "e", "b", "left"))).toBe(false);- expect(fitsWorkspace(previewDock(full, "a", "h", "swap"))).toBe(true);+ it("grows past eight panes a row at a time, never wider than four columns", () => {+ // Same table as `test_an_even_grid_never_grows_wider_than_four_columns`.+ const expected: [number, number, number][] = [[1, 1, 1], [2, 2, 1], [6, 3, 2], [8, 4, 2], [9, 3, 3], [12, 4, 3], [16, 4, 4]];+ for (const [count, columns, rows] of expected) {+ expect(balancedColumns(count)).toBe(columns);+ const tree = balancedLayout(Array.from({ length: count }, (_, i) => String(i)));+ expect(layoutSpan(tree, "row")).toBe(columns);+ expect(layoutSpan(tree, "column")).toBe(rows);+ expect(fitsWorkspace(tree)).toBe(true);+ }+ expect(MAX_WORKSPACE_PANES).toBe(MAX_GRID_COLUMNS * MAX_GRID_ROWS);+ });++ it("allows a third row where eight panes used to be the end", () => {+ const eight = balancedLayout(["a", "b", "c", "d", "e", "f", "g", "h"])!;+ expect(fitsWorkspace(previewDock(eight, "e", "b", "above"))).toBe(true);+ const terminals = ["a", "b", "c", "d", "e", "f", "g", "h"].map((key) => ({ key }));+ expect(canSplitFit(eight, terminals, "a", "down")).toBe(true);+ });++ it("rejects a fifth row or fifth column while allowing swaps in a full workspace", () => {+ const keys = Array.from({ length: 16 }, (_, i) => `p${i}`);+ const full = balancedLayout(keys)!;+ expect(fitsWorkspace(previewDock(full, "p4", "p1", "above"))).toBe(false);+ expect(fitsWorkspace(previewDock(full, "p4", "p1", "left"))).toBe(false);+ expect(fitsWorkspace(previewDock(full, "p0", "p15", "swap"))).toBe(true);+ const terminals = keys.map((key) => ({ key }));+ expect(canSplitFit(full, terminals.slice(0, 15), "p0", "right", 16)).toBe(false);+ expect(canSplitFit(full, terminals, "p0", "down", 16)).toBe(false);});it("distinguishes the four edges from the center regardless of card aspect ratio", () => {diff --git a/jarvis/ui/web/frontend/src/components/agentic/workspaceDocking.ts b/jarvis/ui/web/frontend/src/components/agentic/workspaceDocking.tsindex ea6809f9e3..5c02905589 100644--- a/jarvis/ui/web/frontend/src/components/agentic/workspaceDocking.ts+++ b/jarvis/ui/web/frontend/src/components/agentic/workspaceDocking.ts@@ -6,10 +6,30 @@ export const DOCK_LABELS: Record<PaneMovePosition, string> = {above: "Place above", below: "Place below",};-/** Balanced defaults: two panes share a row; three to eight use two rows. */+/**+ * The largest grid a workspace draws, and so how many agents it holds. Mirrors+ * `MAX_GRID_COLUMNS` / `MAX_GRID_ROWS` in `jarvis/agentic_ide/session.py`; the+ * live count limit comes from the server's `max_terminals`.+ */+export const MAX_GRID_COLUMNS = 4;+export const MAX_GRID_ROWS = 4;+export const MAX_WORKSPACE_PANES = MAX_GRID_COLUMNS * MAX_GRID_ROWS;+export const GRID_LIMIT_HINT = `A workspace holds at most ${MAX_GRID_COLUMNS} columns and ${MAX_GRID_ROWS} rows.`;++/**+ * Columns of the even grid: two panes share a row, three to eight use two+ * rows, beyond that one more row per four panes. Mirrors `balanced_columns`.+ */+export function balancedColumns(count: number): number {+ if (count <= 2) return Math.max(1, count);+ const rows = count <= 2 * MAX_GRID_COLUMNS ? 2 : Math.ceil(count / MAX_GRID_COLUMNS);+ return Math.min(MAX_GRID_COLUMNS, Math.ceil(count / rows));+}++/** The even grid for `keys`, dealt row by row. */export function balancedLayout(keys: readonly string[]): LayoutNode | null {if (!keys.length) return null;- const columns = keys.length <= 2 ? keys.length : Math.ceil(keys.length / 2);+ const columns = balancedColumns(keys.length);const split = (direction: "row" | "column", children: LayoutNode[]): LayoutNode =>children.length === 1 ? children[0] : { direction, children, weights: children.map(() => 1) };const rows: LayoutNode[] = [];@@ -32,7 +52,7 @@ export function layoutSpan(tree: LayoutNode | null, axis: "row" | "column"): num}export function fitsWorkspace(tree: LayoutNode | null): boolean {- return layoutSpan(tree, "row") <= 4 && layoutSpan(tree, "column") <= 2;+ return layoutSpan(tree, "row") <= MAX_GRID_COLUMNS && layoutSpan(tree, "column") <= MAX_GRID_ROWS;}export function isBalancedWorkspace(tree: LayoutNode | null | undefined, terminals: readonly Pick<TerminalState, "key" | "name">[]): boolean {@@ -90,14 +110,15 @@ export function previewSplit(return insert(tree);}-/** Check if splitting anchor in direction keeps the layout within 4 columns x 2 rows. */+/** Whether one more pane split off `anchorKey` stays within the pane limit and the grid. */export function canSplitFit(tree: LayoutNode | null | undefined,terminals: readonly Pick<TerminalState, "key">[],anchorKey: string | undefined,- direction: "right" | "down" | "left" | "above"+ direction: "right" | "down" | "left" | "above",+ maxPanes: number = MAX_WORKSPACE_PANES,): boolean {- if (terminals.length >= 8) return false;+ if (terminals.length >= maxPanes) return false;if (terminals.length === 0 || !anchorKey) return true;const current = workspaceLayout(tree, terminals);if (!current) return true;diff --git a/jarvis/ui/web/frontend/src/lib/agenticIdeApi.ts b/jarvis/ui/web/frontend/src/lib/agenticIdeApi.tsindex 4bc8cd00f9..ad398e9885 100644--- a/jarvis/ui/web/frontend/src/lib/agenticIdeApi.ts+++ b/jarvis/ui/web/frontend/src/lib/agenticIdeApi.ts@@ -1261,7 +1261,7 @@ export async function startIdeSession(const EMPTY_IDE_STATE: IdeState = {active: false,session: null,- max_terminals: 12,+ max_terminals: 16,workspaces: [],active_id: null,max_workspaces: 6,diff --git a/jarvis/ui/web/frontend/src/views/AgenticIdeView.test.tsx b/jarvis/ui/web/frontend/src/views/AgenticIdeView.test.tsxindex 2d79cb51ee..8a643bc300 100644--- a/jarvis/ui/web/frontend/src/views/AgenticIdeView.test.tsx+++ b/jarvis/ui/web/frontend/src/views/AgenticIdeView.test.tsx@@ -141,6 +141,20 @@ describe("Agentic IDE project flow", () => {expect(api.reorderIdeTerminals).not.toHaveBeenCalled();});+ it("shows the pane count and refuses a new agent once the workspace is full", async () => {+ const terminals = Array.from({ length: 16 }, (_, index) => ({ key: `t${index}`, history_id: `id${index}`, name: `T${index}`, display_name: "Codex" }));+ const session = { id: "w1", project_id: "p1", folder: "/code/app", name: "App work", created_at: 0,+ focus_mode: false, project: { name: "App" }, terminals, layout: balancedLayout(terminals.map((terminal) => terminal.key)) };+ api.fetchIdeState.mockResolvedValue({ ...emptyState, active: true, active_id: "w1", session, max_terminals: 16 });+ api.fetchIdeProjects.mockResolvedValue({ projects: [project], active_workspace_id: "w1" });+ render(<AgenticIdeView />);+ fireEvent.click(await screen.findByRole("button", { name: "Pane add" }));+ const dialog = screen.getByRole("dialog", { name: "Add coding agent" });+ expect(within(dialog).getByText(/16 of 16 agents/)).toBeTruthy();+ expect(within(dialog).getByRole("status").textContent).toContain("This workspace is full");+ expect((within(dialog).getByRole("button", { name: "Codex" }) as HTMLButtonElement).disabled).toBe(true);+ });+it("exposes compact workspace rename and close actions", async () => {const session = { id: "w1", project_id: "p1", folder: "/code/app", name: "App work", created_at: 0,focus_mode: false, project: { name: "App" }, terminals: [] };diff --git a/jarvis/ui/web/frontend/src/views/AgenticIdeView.tsx b/jarvis/ui/web/frontend/src/views/AgenticIdeView.tsxindex b8cd2bba24..dc008ee5e8 100644--- a/jarvis/ui/web/frontend/src/views/AgenticIdeView.tsx+++ b/jarvis/ui/web/frontend/src/views/AgenticIdeView.tsx@@ -5,9 +5,8 @@ import { VoiceBubble, storedVoiceBubbleOpen, storeVoiceBubbleOpen } from "@/compimport { WorkspaceTerminalGrid } from "@/components/agentic/WorkspaceTerminalGrid";import { WorkspaceAgentSetup } from "@/components/agentic/WorkspaceAgentSetup";import { WorkspaceOptionsDialog } from "@/components/agentic/WorkspaceOptionsDialog";-import { FONT_DEFAULT } from "@/components/agentic/paneFont";import { IdeSidePanelFrame } from "@/components/agentic/sidePanel/IdeSidePanel";-import { fitsWorkspace, isBalancedWorkspace, canSplitFit } from "@/components/agentic/workspaceDocking";+import { GRID_LIMIT_HINT, MAX_WORKSPACE_PANES, canSplitFit, fitsWorkspace, isBalancedWorkspace } from "@/components/agentic/workspaceDocking";import { AgentMark } from "@/components/agentic/AgentMark";import { SplitRightIcon, SplitBelowIcon, SplitLeftIcon, SplitAboveIcon } from "@/components/agentic/splitIcons";import type { PaneSplitDirection } from "@/components/agentic/WorkspaceTerminalHeader";@@ -22,6 +21,7 @@ import {type AgentStatus, type IdeProject, type IdeState, type TerminalState,} from "@/lib/agenticIdeApi";+const FONT_KEY = "jarvis.agenticIde.terminalFontSize";const APPEARANCE_KEY = "jarvis.agenticIde.terminalAppearance";const SPLIT_DIRECTION_KEY = "jarvis.agenticIde.splitDirection";@@ -78,9 +78,7 @@ export function AgenticIdeView({ onScreen = true }: AgenticIdeViewProps) {const [renameValue, setRenameValue] = useState("");const [busy, setBusy] = useState(false);const [voiceOpen, setVoiceOpen] = useState(storedVoiceBubbleOpen);- // One fixed, dense text size (the look of a standalone terminal); the- // maintainer does not want a per-user zoom for the workspace terminals.- const fontSize = FONT_DEFAULT;+ const [fontSize, setFontSize] = useState(() => Number(localStorage.getItem(FONT_KEY)) || 13);const [appearance, setAppearance] = useState<"light" | "dark" | null>(() => {const stored = localStorage.getItem(APPEARANCE_KEY);return stored === "light" || stored === "dark" ? stored : null;@@ -93,6 +91,7 @@ export function AgenticIdeView({ onScreen = true }: AgenticIdeViewProps) {const gridMutations = useRef(0);const normalizingLayout = useRef(false);const session = state?.session ?? null;+ const maxPanes = state?.max_terminals ?? MAX_WORKSPACE_PANES;const installed = agents.filter((agent) => agent.installed && agent.kind !== "shell" && agent.accepts_prompts !== false);const dialogOpen = projectDialog || workspaceProject !== null || renameOpen || agentPicker !== null;@@ -136,7 +135,7 @@ export function AgenticIdeView({ onScreen = true }: AgenticIdeViewProps) {}if (epoch !== refreshEpoch.current || pendingActivation.current || ((activationRunning.current || gridMutations.current > 0) && !allowDuringActivation) || nextState.active_id !== listing.active_workspace_id) return;const incoming = nextState.session;- if (incoming?.layout && incoming.terminals.length <= 8 && !fitsWorkspace(incoming.layout)) {+ if (incoming?.layout && incoming.terminals.length <= (nextState.max_terminals ?? MAX_WORKSPACE_PANES) && !fitsWorkspace(incoming.layout)) {// Older snapshots and terminals opened outside this view may exceed the// grid bounds. Persist the same balanced fallback the grid displays.normalizingLayout.current = true;@@ -310,6 +309,7 @@ export function AgenticIdeView({ onScreen = true }: AgenticIdeViewProps) {await closeTerminal(terminal.history_id ? `pane:${terminal.history_id}` : terminal.name, session.id);});+ const saveFont = (size: number) => { const next = Math.max(9, Math.min(22, size)); setFontSize(next); localStorage.setItem(FONT_KEY, String(next)); };const saveAppearance = (next: "light" | "dark" | null) => { setAppearance(next); if (next) localStorage.setItem(APPEARANCE_KEY, next); else localStorage.removeItem(APPEARANCE_KEY); };const balanceLayout = () => void run(async () => {if (!session) return;@@ -330,9 +330,10 @@ export function AgenticIdeView({ onScreen = true }: AgenticIdeViewProps) {}, [session, selected]);// The chosen direction when it fits; otherwise the first that does; null// when the anchor has no room at all (the agent then joins the even grid).+ const workspaceFull = Boolean(session && session.terminals.length >= maxPanes);const pickerAnchorKey = session?.terminals.find((terminal) => terminal.name === splitAnchor)?.key;const directionFits = (direction: PaneSplitDirection) =>- Boolean(session && pickerAnchorKey && canSplitFit(session.layout, session.terminals, pickerAnchorKey, direction));+ Boolean(session && pickerAnchorKey && canSplitFit(session.layout, session.terminals, pickerAnchorKey, direction, maxPanes));const effectiveDirection = !pickerAnchorKey ? null: directionFits(splitDirection) ? splitDirection: SPLIT_DIRECTIONS.find((item) => directionFits(item.id))?.id ?? null;@@ -363,15 +364,15 @@ export function AgenticIdeView({ onScreen = true }: AgenticIdeViewProps) {return <div className="relative flex h-full min-h-0 flex-col bg-background text-foreground" data-testid="igentic-ide"><WorkspaceOptionsDialog open={optionsOpen && !!session} onOpenChange={setOptionsOpen} workspace={session?.name ?? session?.project.name ?? ""}- count={session?.terminals.length ?? 0} busy={busy} canAdd={installed.length > 0}+ count={session?.terminals.length ?? 0} maxPanes={maxPanes} busy={busy} canAdd={installed.length > 0}onAdd={openAgentPicker} onBalance={balanceLayout} onRename={() => { setRenameValue(session?.name ?? session?.project.name ?? ""); setRenameOpen(true); }}- onClose={stopWorkspace} appearance={appearance} onAppearance={saveAppearance}+ onClose={stopWorkspace} fontSize={fontSize} onFontSize={saveFont} appearance={appearance} onAppearance={saveAppearance}/><main className="min-h-0 flex-1"><IdeSidePanelFrame>{session ? <WorkspaceTerminalGrid key={session.id} session={session} onChanged={(next) => setState((current) => current?.session?.id === next.id ? { ...current, session: next } : current)}- onAdd={openAgentPicker} onClose={closeAgent} onSelect={setSelected} selected={selected} fontSize={fontSize} appearance={appearance} disabled={busy}+ onAdd={openAgentPicker} onClose={closeAgent} onSelect={setSelected} selected={selected} maxPanes={maxPanes} fontSize={fontSize} appearance={appearance} disabled={busy}onMutationStart={beginGridMutation} onMutationEnd={endGridMutation} />: <div className="flex h-full flex-col items-center justify-center gap-3 px-6 text-center"><FolderPlus className="h-8 w-8 text-muted-foreground/70" />@@ -389,7 +390,7 @@ export function AgenticIdeView({ onScreen = true }: AgenticIdeViewProps) {<section data-ide-dialog tabIndex={-1} role="dialog" aria-modal="true" aria-label="Add coding agent"className="w-full max-w-lg rounded-2xl border border-border bg-card p-5 shadow-2xl"><div className="mb-4 flex items-center justify-between gap-3">- <div><h2 className="text-base font-semibold">Add coding agent</h2><p className="mt-1 text-xs text-muted-foreground">{agentPicker.name}</p></div>+ <div><h2 className="text-base font-semibold">Add coding agent</h2><p className="mt-1 text-xs text-muted-foreground">{agentPicker.name}{session && <> · {session.terminals.length} of {maxPanes} agents</>}</p></div><button type="button" aria-label="Close" onClick={() => setAgentPicker(null)} className="rounded-md p-1.5 hover:bg-muted"><X className="h-4 w-4" /></button></div>@@ -412,7 +413,7 @@ export function AgenticIdeView({ onScreen = true }: AgenticIdeViewProps) {const fits = directionFits(item.id);const checked = effectiveDirection === item.id;return <button key={item.id} type="button" role="radio" aria-checked={checked} aria-label={`Split ${item.label.toLowerCase()}`}- disabled={busy || !fits} title={fits ? item.hint : "No room: a workspace holds at most four columns and two rows."}+ disabled={busy || !fits} title={fits ? item.hint : `No room here. ${GRID_LIMIT_HINT}`}onClick={() => { setSplitDirection(item.id); storeSplitDirection(item.id); }}className={cn("flex flex-col items-center justify-center gap-1.5 rounded-lg border py-2 text-xs font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-40",checked ? "border-primary bg-primary/10 text-foreground ring-1 ring-primary/40" : "border-border bg-background text-muted-foreground hover:bg-muted hover:text-foreground")}>@@ -425,7 +426,9 @@ export function AgenticIdeView({ onScreen = true }: AgenticIdeViewProps) {})()}<div className="grid grid-cols-1 gap-2 sm:grid-cols-2">- {installed.map((agent) => <button key={agent.name} type="button" disabled={busy}+ {workspaceFull && <p role="status" className="col-span-full rounded-lg border border-border bg-muted/40 px-3 py-2 text-xs text-muted-foreground">+ This workspace is full ({maxPanes} agents). Close a pane, or open another workspace for more agents.</p>}+ {installed.map((agent) => <button key={agent.name} type="button" disabled={busy || workspaceFull}onClick={() => { const owner = agentPicker.id; setAgentPicker(null); addAgent(agent.name, owner, effectiveDirection ? splitAnchor : undefined, effectiveDirection ?? "down"); }}className="flex min-h-12 items-center gap-3 rounded-lg border border-border px-3 py-2 text-left text-sm font-medium hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"><AgentMark agent={agent.name} label={agent.display_name} logoUrl={agent.logo_url} variant="plain" />{agent.display_name}diff --git a/tests/unit/agentic_ide/test_many_terminals.py b/tests/unit/agentic_ide/test_many_terminals.pyindex 45a863ca5c..5f56d092c6 100644--- a/tests/unit/agentic_ide/test_many_terminals.py+++ b/tests/unit/agentic_ide/test_many_terminals.py@@ -205,3 +205,35 @@ async def test_the_snapshot_of_a_full_house_stays_a_sane_size(assert len(raw) < 100_000# And still valid JSON rather than something truncated.assert json.loads(raw)["workspaces"][0]["terminals"]+++# ------------------------------------------------------------- grid ceiling+def test_the_ceiling_is_the_largest_grid_the_workspace_draws() -> None:+ assert ide.MAX_TERMINALS == ide.MAX_GRID_COLUMNS * ide.MAX_GRID_ROWS+ assert ide.MAX_TERMINALS > 8, "eight panes was a layout rule, not a resource limit"+++ ("count", "columns", "rows"),+ [(1, 1, 1), (2, 2, 1), (6, 3, 2), (8, 4, 2), (9, 3, 3), (12, 4, 3), (16, 4, 4)],+)+def test_an_even_grid_never_grows_wider_than_four_columns(+ count: int, columns: int, rows: int+) -> None:+ assert ide.balanced_columns(count) == columns+ assert -(-count // columns) == rows <= ide.MAX_GRID_ROWS+++async def test_a_full_workspace_rebalances_into_four_by_four(+ registry: ide.Registry, tmp_path: Path+) -> None:+ await registry.start(str(tmp_path), [{"agent": "claude"} for _ in range(ide.MAX_TERMINALS)])+ session = registry.session+ assert session is not None+ await registry.reorder_terminals(session.id, [term.history_id for term in session.terminals])+ layout = session.layout+ assert isinstance(layout, ide.layout_tree.Split) and layout.direction == "column"+ assert len(layout.children) == ide.MAX_GRID_ROWS+ assert all(len(ide.layout_tree.leaves(row)) == ide.MAX_GRID_COLUMNS for row in layout.children)+ with pytest.raises(ide.SessionError):+ await registry.add_terminal(agent="claude")diff --git a/tests/unit/agentic_ide/test_quick_agent_catalog.py b/tests/unit/agentic_ide/test_quick_agent_catalog.pyindex d470204b99..96d1509fa6 100644--- a/tests/unit/agentic_ide/test_quick_agent_catalog.py+++ b/tests/unit/agentic_ide/test_quick_agent_catalog.py@@ -48,8 +48,8 @@ async def test_quick_catalog_resolves_off_loop_without_expensive_probes(result = await routes.get_agents(quick=True)assert resolved == ["example", "missing"]assert result.terminal_available is pty_available- assert result.max_terminals == 8- assert len(result.suggested_names) == 8+ assert result.max_terminals == routes.MAX_TERMINALS+ assert len(result.suggested_names) == routes.MAX_TERMINALSexample, missing = result.agentsassert example.installed is Trueassert missing.installed is Falsediff --git a/tests/unit/agentic_ide/test_workspace_graph.py b/tests/unit/agentic_ide/test_workspace_graph.pyindex 73d5903c69..8de8480a1e 100644--- a/tests/unit/agentic_ide/test_workspace_graph.py+++ b/tests/unit/agentic_ide/test_workspace_graph.py@@ -98,17 +98,18 @@ async def test_project_ownership_rejects_another_folder(registry, tmp_path):assert registry.sessions == []-async def test_eight_cap_applies_to_create_add_and_batch(registry, tmp_path):- with pytest.raises(session.SessionError, match="At most 8"):- await registry.start(str(tmp_path), [{"agent": "claude"}] * 9)- space = await registry.start(str(tmp_path), [{"agent": "claude"}] * 7)- with pytest.raises(session.SessionError, match="at most 8"):+async def test_pane_cap_applies_to_create_add_and_batch(registry, tmp_path):+ cap = session.MAX_TERMINALS+ with pytest.raises(session.SessionError, match=f"At most {cap}"):+ await registry.start(str(tmp_path), [{"agent": "claude"}] * (cap + 1))+ space = await registry.start(str(tmp_path), [{"agent": "claude"}] * (cap - 1))+ with pytest.raises(session.SessionError, match=f"at most {cap}"):await registry.add_terminals(2)- assert len(space.terminals) == 7+ assert len(space.terminals) == cap - 1await registry.add_terminal(agent="claude")- with pytest.raises(session.SessionError, match="maximum of 8"):+ with pytest.raises(session.SessionError, match=f"maximum of {cap}"):await registry.add_terminal(agent="claude")- assert len(space.terminals) == 8+ assert len(space.terminals) == cap@pytest.mark.parametrize(@@ -232,13 +233,13 @@ async def test_oversized_legacy_workspace_is_preserved_without_partial_restore(rfolder=str(tmp_path),terminals=[resume_store.SnapshotTerminal(key=f"t{i}", name=f"T{i}", agent="claude")- for i in range(9)+ for i in range(session.MAX_TERMINALS + 1)],)resume_store.save(resume_store.snapshot_now([saved]))- with pytest.raises(session.SessionError, match="limit is 8"):+ with pytest.raises(session.SessionError, match=f"limit is {session.MAX_TERMINALS}"):await registry.restore_workspace(saved.session_id)- assert len(resume_store.load().workspaces[0].terminals) == 9+ assert len(resume_store.load().workspaces[0].terminals) == session.MAX_TERMINALS + 1assert registry.sessions == []