Skip to content

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.

fix(agentic-ide): show open terminal count

Ruben Lütked3bba79b55a9
diff --git a/jarvis/ui/web/frontend/src/components/agentic/WorkspaceBar.tsx b/jarvis/ui/web/frontend/src/components/agentic/WorkspaceBar.tsx
index 7dab6197e6..c6206ebc60 100644
--- a/jarvis/ui/web/frontend/src/components/agentic/WorkspaceBar.tsx
+++ b/jarvis/ui/web/frontend/src/components/agentic/WorkspaceBar.tsx
@@ -10,9 +10,9 @@
* Two things the tabs have to say out loud, because the alternative is a user
* guessing:
*
- * * **how many agents are alive in there.** A workspace you are not looking at
- * is still working (and still spending), so the count is the thing that keeps
- * "it runs until you close it" honest rather than hidden.
+ * * **how many terminal panes are open in there.** The number follows panes as
+ * they are added or closed; it is not a historical spawn total or a process
+ * health readout.
* * **which one is on screen.** With the panes of only one workspace visible at
* a time, an unmarked bar would make the grid look like it belongs to
* whichever tab the eye landed on.
@@ -259,13 +259,7 @@ export function WorkspaceBar({
);
}
-/**
- * "3" when every pane is running, "1/3" when they are not.
- *
- * The split form only appears when it carries information. A tab that always
- * read "3/3" would train the eye to skip the number, and the number is the
- * whole point on a workspace nobody is watching.
- */
+/** The number of terminal panes currently open in this workspace. */
function PaneCount({
workspace,
selected,
@@ -273,18 +267,10 @@ function PaneCount({
workspace: WorkspaceCard;
selected: boolean;
}) {
- const allLive = workspace.live_terminals === workspace.terminals;
- const label = allLive
- ? String(workspace.terminals)
- : `${workspace.live_terminals}/${workspace.terminals}`;
return (
<span
data-testid={`workspace-panes-${workspace.id}`}
- title={
- allLive
- ? `${workspace.terminals} agent${workspace.terminals === 1 ? "" : "s"} running`
- : `${workspace.live_terminals} of ${workspace.terminals} agents running`
- }
+ title={`${workspace.terminals} terminal${workspace.terminals === 1 ? "" : "s"} open`}
className={cn(
"shrink-0 rounded px-1.5 py-0.5 font-mono text-[10px]",
selected
@@ -292,7 +278,7 @@ function PaneCount({
: "bg-muted text-muted-foreground",
)}
>
- {label}
+ {workspace.terminals}
</span>
);
}
diff --git a/jarvis/ui/web/frontend/src/views/AgenticIdeView.test.tsx b/jarvis/ui/web/frontend/src/views/AgenticIdeView.test.tsx
index 18c7b6270d..219a8f14f6 100644
--- a/jarvis/ui/web/frontend/src/views/AgenticIdeView.test.tsx
+++ b/jarvis/ui/web/frontend/src/views/AgenticIdeView.test.tsx
@@ -718,13 +718,29 @@ describe("AgenticIdeView — the workspace bar", () => {
const front = screen.getByTestId("workspace-tab-ide_test");
expect(other.getAttribute("aria-selected")).toBe("false");
expect(front.getAttribute("aria-selected")).toBe("true");
- // A background workspace says how many of its agents are still running —
- // that is what keeps "it runs until you close it" honest.
+ // The badge is one number: open terminal panes, not running agents versus
+ // every pane ever placed in the workspace.
expect(screen.getByTestId("workspace-panes-ide_other").textContent).toBe(
- "2/3",
+ "3",
);
});
+ it("uses the active session count instead of a stale spawn total", async () => {
+ const active = sessionWith(["Mika", "Nova"]);
+ const state = stateWith(active);
+ state.workspaces[0] = {
+ ...state.workspaces[0],
+ terminals: 60,
+ live_terminals: 60,
+ };
+ vi.mocked(api.fetchIdeState).mockResolvedValue(state);
+ render(<AgenticIdeView />);
+
+ expect(
+ (await screen.findByTestId("workspace-panes-ide_test")).textContent,
+ ).toBe("2");
+ });
+
it("stays hidden while nothing is open", async () => {
render(<AgenticIdeView />);
await screen.findByText("Folder");
diff --git a/jarvis/ui/web/frontend/src/views/AgenticIdeView.tsx b/jarvis/ui/web/frontend/src/views/AgenticIdeView.tsx
index a0ee3e79d5..7341a4bbe8 100644
--- a/jarvis/ui/web/frontend/src/views/AgenticIdeView.tsx
+++ b/jarvis/ui/web/frontend/src/views/AgenticIdeView.tsx
@@ -543,10 +543,20 @@ export function AgenticIdeView() {
* — it is about which one you are in — so it stays put whether the grid or
* the wizard is below it. A bar that moved (or vanished while adding one)
* would leave the user without a way back to the workspaces still running.
+ *
+ * Pane actions return the updated session, while the compact workspace cards
+ * remain the snapshot from the last full-state request. Replace the active
+ * card's count from that live session so closing or adding a terminal updates
+ * the badge immediately instead of leaving the original spawn count behind.
*/
+ const barWorkspaces = workspaces.map((workspace) =>
+ session && workspace.id === session.id
+ ? { ...workspace, terminals: session.terminals.length }
+ : workspace,
+ );
const bar = (
<WorkspaceBar
- workspaces={workspaces}
+ workspaces={barWorkspaces}
activeId={session?.id ?? null}
addingNew={addingNew}
maxWorkspaces={maxWorkspaces}