From 00675b93afd36e589348d2e8f99ec6e73c709889 Mon Sep 17 00:00:00 2001 From: Brennan Benson <79079362+brennanb2025@users.noreply.github.com> Date: Sun, 23 Aug 2026 16:31:59 -0700 Subject: [PATCH] fix(agent-status): limit emitted display evidence --- src/shared/agent-title-evidence.test.ts | 30 ++++++++++++++----------- src/shared/agent-title-evidence.ts | 16 ++++++++++--- 2 files changed, 30 insertions(+), 16 deletions(-) diff --git a/src/shared/agent-title-evidence.test.ts b/src/shared/agent-title-evidence.test.ts index 176937a500e..1c41a74bb61 100644 --- a/src/shared/agent-title-evidence.test.ts +++ b/src/shared/agent-title-evidence.test.ts @@ -1,6 +1,5 @@ import { describe, expect, it } from 'vitest' import { collectAgentTitleEvidence } from './agent-title-evidence' -import { ALL_TUI_AGENTS, TUI_AGENT_DISPLAY_NAMES } from './tui-agent-display-names' const agentFor = (title: string) => collectAgentTitleEvidence(title).agent const reasonFor = (title: string) => collectAgentTitleEvidence(title).reason @@ -113,27 +112,32 @@ describe('collectAgentTitleEvidence', () => { }) }) - it.each(ALL_TUI_AGENTS)('recognizes the canonical whole-title label for %s', (agent) => { - const title = TUI_AGENT_DISPLAY_NAMES[agent] - expect(collectAgentTitleEvidence(title)).toMatchObject({ - agent, - reason: 'anchored' - }) - }) - - it('does not treat an exact display name as free text', () => { - expect(collectAgentTitleEvidence('Grok').freeTextNames).toEqual([]) - }) - it.each([ ['Claude Code', 'claude'], ['Gemini CLI', 'gemini'], + ['Claude Agent Teams', 'claude-agent-teams'], + ['MiMo Code', 'mimo-code'], + ['Prime Agent', 'prime-agent'], + ['Command Code', 'command-code'], + ['GitHub Copilot', 'copilot'], ['Agent Teams', 'claude-agent-teams'] ] as const)('recognizes the emitted whole-title alias %s', (title, agent) => { expect(agentFor(title)).toBe(agent) expect(reasonFor(title)).toBe('anchored') }) + it.each(['Continue', 'Charm', 'Goose', 'Amp'])( + 'does not treat the UI-only display label %s as identity', + (title) => { + expect(agentFor(title)).toBeNull() + expect(reasonFor(title)).toBe('no-evidence') + } + ) + + it('does not treat an emitted label as free text', () => { + expect(collectAgentTitleEvidence('Prime Agent').freeTextNames).toEqual([]) + }) + it.each([ ['Codex ready', 'codex'], ['Codex - action required', 'codex'], diff --git a/src/shared/agent-title-evidence.ts b/src/shared/agent-title-evidence.ts index bcb5271522f..6221713e164 100644 --- a/src/shared/agent-title-evidence.ts +++ b/src/shared/agent-title-evidence.ts @@ -18,7 +18,7 @@ import { SYNTHETIC_AGENT_TITLE_PROFILES } from './synthetic-agent-title' import type { TuiAgent } from './tui-agent' -import { ALL_TUI_AGENTS, TUI_AGENT_DISPLAY_NAMES } from './tui-agent-display-names' +import { TUI_AGENT_DISPLAY_NAMES } from './tui-agent-display-names' /** * Order-independent identity evidence from a terminal title. @@ -78,9 +78,19 @@ const PATTERN_NAMES: readonly (readonly [RegExp, TuiAgent])[] = [ [HERMES_AGENT_NAME_RE, 'hermes'] ] -/** Exact whole-title labels are strong evidence even for agents unsafe to match in free text. */ +/** Catalog labels known to be emitted as terminal titles, not merely presented in Orca's UI. */ +const EMITTED_DISPLAY_LABEL_AGENTS = [ + 'claude-agent-teams', + 'mimo-code', + 'prime-agent', + 'command-code', + 'copilot' +] as const satisfies readonly TuiAgent[] + const DISPLAY_LABELS = [ - ...ALL_TUI_AGENTS.map((agent) => [TUI_AGENT_DISPLAY_NAMES[agent].toLowerCase(), agent] as const), + ...EMITTED_DISPLAY_LABEL_AGENTS.map( + (agent) => [TUI_AGENT_DISPLAY_NAMES[agent].toLowerCase(), agent] as const + ), ['claude code', 'claude'], ['gemini cli', 'gemini'], ['agent teams', 'claude-agent-teams']