The best way to control Claude Code, Codex and more from any computer or phone
fix(client-runtime): "Codex (hub)" badges read CH instead of C( (#22918)
Co-authored-by: chief-archivist <thecradlearchives@gmail.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Theo Browne committed
Oct 25, 2026 at 15:08 UTC
2fd28bf93804845403f8ed4947c09a3878b546d0
2 files changed
+17
-1
packages/client-runtime/src/state/providerInstanceDisplay.test.ts
+9
@@ -12,6 +12,15 @@ const codex = ProviderDriverKind.make("codex");
12
const acpRegistry = ProviderDriverKind.make("acpRegistry");
13
14
describe("providerInstanceInitials", () => {
15
+ it("treats punctuation as a word break but keeps apostrophes between letters", () => {
16
+ expect(providerInstanceInitials("Codex (hub)")).toBe("CH");
17
+ expect(providerInstanceInitials("work_codex")).toBe("WC");
18
+ expect(providerInstanceInitials("Theo's Codex")).toBe("TC");
19
+ expect(providerInstanceInitials("Codex 'hub'")).toBe("CH");
20
+ expect(providerInstanceInitials("‘hub’")).toBe("HU");
21
+ expect(providerInstanceInitials("(hub)")).toBe("HU");
22
+ });
23
+
24
it("keeps an emoji whole instead of splitting its surrogate pair", () => {
25
expect(providerInstanceInitials("😀 Work")).toBe("😀W");
26
expect(providerInstanceInitials("😀")).toBe("😀");
packages/client-runtime/src/state/providerInstanceDisplay.ts
+8
-1
@@ -27,7 +27,14 @@ export function resolveProviderInstanceDisplayName(
27
}
28
29
export function providerInstanceInitials(label: string): string {
30
- const words = label.replace(/[_-]+/g, " ").split(/\s+/u).filter(Boolean);
30
+ // Punctuation separates words so "Codex (hub)" reads CH, not C(. An apostrophe
31
+ // inside a word stays ("Theo's Codex" is TC); a quoting one does not
32
+ // ("Codex 'hub'" is CH).
33
+ const words = label
34
+ .replace(/[^\P{P}'’]+/gu, " ")
35
+ .split(/\s+/u)
36
+ .map((word) => word.replace(/^['’]+|['’]+$/gu, ""))
37
+ .filter(Boolean);
38
if (words.length === 0) return "";
39
if (words.length === 1) return Array.from(words[0]!).slice(0, 2).join("").toUpperCase();
40
return words