Skip to content

Shared task board where people and AI coding agents work as teammates. Source-available, self-hostable.

Go

fix(runtimes): stop surfacing agent CLI version branding in machine subtitle (#2752)

Jiayuan Zhang7c3dab695f5f
diff --git a/packages/views/runtimes/components/runtime-machines.test.ts b/packages/views/runtimes/components/runtime-machines.test.ts
index 93d84298ee..bc3a3624bf 100644
--- a/packages/views/runtimes/components/runtime-machines.test.ts
+++ b/packages/views/runtimes/components/runtime-machines.test.ts
@@ -75,6 +75,37 @@ describe("runtime machine grouping", () => {
expect(filterRuntimeMachines(machines, "", "issues")).toHaveLength(1);
});
+ it("does not surface agent CLI version branding as the machine subtitle", () => {
+ // Reproduces the bug where every machine row's subtitle read
+ // "Claude Code …" because compactDeviceInfo flipped the parenthetical
+ // of the version string "2.1.5 (Claude Code)" into the description.
+ const machines = buildRuntimeMachines(
+ [
+ makeRuntime({
+ id: "rt-claude",
+ provider: "claude",
+ name: "Claude (dev.local)",
+ device_info: "dev.local · 2.1.5 (Claude Code)",
+ }),
+ makeRuntime({
+ id: "rt-codex",
+ provider: "codex",
+ name: "Codex (dev.local)",
+ device_info: "dev.local · codex-cli 0.118.0",
+ }),
+ ],
+ { now: NOW, localDaemonId: "daemon-1" },
+ );
+
+ expect(machines).toHaveLength(1);
+ const subtitle = machines[0]?.subtitle ?? "";
+ expect(subtitle.toLowerCase()).not.toContain("claude code");
+ expect(subtitle.toLowerCase()).not.toContain("codex-cli");
+ // Falls back to the daemon-id descriptor — at minimum it must not be
+ // the runtime CLI's marketing string.
+ expect(subtitle).toMatch(/^daemon /);
+ });
+
it("keeps cloud runtimes as cloud workers when they have no daemon", () => {
const machines = buildRuntimeMachines(
[
diff --git a/packages/views/runtimes/components/runtime-machines.ts b/packages/views/runtimes/components/runtime-machines.ts
index 6bed9e6a56..7309f6640e 100644
--- a/packages/views/runtimes/components/runtime-machines.ts
+++ b/packages/views/runtimes/components/runtime-machines.ts
@@ -253,17 +253,31 @@ function compactDeviceInfo(
.split(" · ")
.map((part) => part.trim())
.filter(Boolean)
- .filter((part) => part !== title);
+ .filter((part) => part !== title)
+ .filter((part) => !isAgentVersionLike(part));
const primary = parts[0];
if (!primary) return null;
- const runtimeVersion = primary.match(/^(.+?)\s+\(([^)]+)\)$/);
- if (runtimeVersion?.[1] && runtimeVersion[2]) {
- return `${runtimeVersion[2]} ${runtimeVersion[1]}`;
+ // Reshape OS+arch produced by formatDeviceInfo (e.g. "macOS (x86_64)")
+ // into the more scannable "x86_64 macOS". Version strings — the only
+ // other shape that historically carried parens — are filtered out
+ // above so they can't pollute the per-machine subtitle.
+ const osArch = primary.match(/^(.+?)\s+\(([^)]+)\)$/);
+ if (osArch?.[1] && osArch[2]) {
+ return `${osArch[2]} ${osArch[1]}`;
}
return primary;
}
+// True for parts that carry an agent CLI version, not machine info —
+// e.g. "2.1.5 (Claude Code)", "codex-cli 0.118.0", "1.0.20", "claude 1.0.0".
+// Those describe a runtime, not the host, so they should never become a
+// machine's subtitle (otherwise every claude-equipped daemon's row reads
+// "Claude Code …", drowning out actual per-machine differences).
+function isAgentVersionLike(part: string): boolean {
+ return /(?:^|\s)v?\d+\.\d+\.\d+/.test(part);
+}
+
function latestLastSeenAt(runtimes: AgentRuntime[]): string | null {
let latest: string | null = null;
for (const runtime of runtimes) {