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 one Subscriptions row per signed-in account

rubenluetke10-beepac1971372707
diff --git a/jarvis/ui/web/frontend/src/components/agentic/sidePanel/subscriptions/SubscriptionsTab.test.tsx b/jarvis/ui/web/frontend/src/components/agentic/sidePanel/subscriptions/SubscriptionsTab.test.tsx
index 60604ddb57..cab7adb6c4 100644
--- a/jarvis/ui/web/frontend/src/components/agentic/sidePanel/subscriptions/SubscriptionsTab.test.tsx
+++ b/jarvis/ui/web/frontend/src/components/agentic/sidePanel/subscriptions/SubscriptionsTab.test.tsx
@@ -119,6 +119,23 @@ describe("SubscriptionsTab", () => {
expect(within(groups[0]).getByText("Seat c1 · Max 20x")).toBeTruthy();
});
+ it("names every seat on a subscription row shared by two seats", async () => {
+ const shared = {
+ platforms: [
+ {
+ ...ACCOUNTS.platforms[0],
+ accounts: [account("c1", "claude"), account("c2", "claude", { email: "[email protected]" })],
+ },
+ ],
+ };
+ vi.mocked(fetchAgentAccounts).mockResolvedValue(shared);
+ render(<SubscriptionsTab />);
+ const [group] = await screen.findAllByTestId("subscription-group");
+ const rows = within(group).getAllByTestId("subscription-row");
+ expect(rows.map((row) => row.dataset.account)).toEqual(["c2"]);
+ expect(within(group).getByText("Seat c1, Seat c2 · Max 20x")).toBeTruthy();
+ });
+
it("shows plan usage only after a row is expanded", async () => {
render(<SubscriptionsTab />);
const [row] = await screen.findAllByTestId("subscription-row");
@@ -156,6 +173,32 @@ describe("subscriptionsModel", () => {
expect(groupSubscriptions(null, [])).toEqual([]);
});
+ it("shows seats signed in as the same email as one subscription", () => {
+ const accounts = {
+ platforms: [
+ {
+ platform: "claude",
+ display_name: "Claude Code",
+ active_account: "c3",
+ accounts: [
+ account("c1", "claude", { email: "[email protected]" }),
+ account("c2", "claude"),
+ account("c3", "claude", { email: "[email protected]", warning: "same subscription" }),
+ account("c4", "claude", { email: null }),
+ account("c5", "claude", { email: null }),
+ ],
+ },
+ ],
+ };
+ const usage = [{ ...USAGE.accounts[0], account_id: "c3" }];
+ const [group] = groupSubscriptions(accounts, usage);
+ expect(group.rows.map((row) => row.account.id)).toEqual(["c3", "c2", "c4", "c5"]);
+ expect(group.rows[0].seats.map((seat) => seat.id)).toEqual(["c1", "c3"]);
+ expect(group.rows[0].active).toBe(true);
+ expect(group.rows[0].usage?.account_id).toBe("c3");
+ expect(group.rows[0].account.warning).toBe("same subscription");
+ });
+
it("words reset times as a countdown inside a day", () => {
const now = Date.parse("2026-10-05T12:00:00Z");
expect(resetText(null, now, "en")).toBeNull();
diff --git a/jarvis/ui/web/frontend/src/components/agentic/sidePanel/subscriptions/SubscriptionsTab.tsx b/jarvis/ui/web/frontend/src/components/agentic/sidePanel/subscriptions/SubscriptionsTab.tsx
index f9a55670d3..9702d6c251 100644
--- a/jarvis/ui/web/frontend/src/components/agentic/sidePanel/subscriptions/SubscriptionsTab.tsx
+++ b/jarvis/ui/web/frontend/src/components/agentic/sidePanel/subscriptions/SubscriptionsTab.tsx
@@ -198,7 +198,8 @@ function SubscriptionLine({ row, now }: { row: SubscriptionRow; now: number }) {
const { account } = row;
const title = account.email || account.label;
const plan = planName(row);
- const subtitle = [account.email ? account.label : "", plan].filter(Boolean).join(" · ");
+ const seats = account.email ? row.seats.map((seat) => seat.label).join(", ") : "";
+ const subtitle = [seats, plan].filter(Boolean).join(" · ");
const tightest = tightestWindow(row.usage);
return (
<li data-testid="subscription-row" data-account={account.id} data-active={row.active || undefined}>
diff --git a/jarvis/ui/web/frontend/src/components/agentic/sidePanel/subscriptions/subscriptionsModel.ts b/jarvis/ui/web/frontend/src/components/agentic/sidePanel/subscriptions/subscriptionsModel.ts
index f6ec0c7e53..4114fd5fbb 100644
--- a/jarvis/ui/web/frontend/src/components/agentic/sidePanel/subscriptions/subscriptionsModel.ts
+++ b/jarvis/ui/web/frontend/src/components/agentic/sidePanel/subscriptions/subscriptionsModel.ts
@@ -7,7 +7,10 @@ import type {
/** One signed-in subscription, ready to draw. */
export interface SubscriptionRow {
+ /** The seat the row speaks for: the active one when it is among them. */
account: AgentAccount;
+ /** Every seat signed in to this subscription, in the backend's order. */
+ seats: AgentAccount[];
/** Whether new terminals of this CLI start on this subscription. */
active: boolean;
usage: AccountUsage | null;
@@ -25,7 +28,9 @@ export interface SubscriptionGroup {
*
* A registered seat that never finished signing in is not a subscription the
* user has, so it is left to the settings dialog that manages seats. A CLI with
- * no signed-in seat gets no block at all. The backend's order is kept — both
+ * no signed-in seat gets no block at all. Seats signed in as the same email are
+ * one subscription with one usage meter, so they share one row that names every
+ * seat; seats without a readable email are never merged. The backend's order is kept — both
* for the blocks and inside them — so a row never jumps when another one
* becomes the active seat.
*/
@@ -35,13 +40,25 @@ export function groupSubscriptions(
): SubscriptionGroup[] {
const byId = new Map(usage.map((reading) => [reading.account_id, reading]));
return (accounts?.platforms ?? []).flatMap((group) => {
- const rows = (group.accounts ?? [])
- .filter((account) => account.connected)
- .map((account) => ({
- account,
- active: account.id === group.active_account,
- usage: byId.get(account.id) ?? null,
- }));
+ const rows: SubscriptionRow[] = [];
+ const byEmail = new Map<string, SubscriptionRow>();
+ for (const account of group.accounts ?? []) {
+ if (!account.connected) continue;
+ const active = account.id === group.active_account;
+ const usage = byId.get(account.id) ?? null;
+ const email = (account.email ?? "").trim().toLowerCase();
+ const same = email ? byEmail.get(email) : undefined;
+ if (same) {
+ same.seats.push(account);
+ if (active) Object.assign(same, { account, active: true, usage: usage ?? same.usage });
+ else if (!same.usage) same.usage = usage;
+ if (!same.account.warning && account.warning) same.account = { ...same.account, warning: account.warning };
+ continue;
+ }
+ const row: SubscriptionRow = { account, seats: [account], active, usage };
+ rows.push(row);
+ if (email) byEmail.set(email, row);
+ }
if (rows.length === 0) return [];
return [{ platform: group.platform, displayName: group.display_name || group.platform, rows }];
});