fix(agent-status): require spinner for working labels

This commit is contained in:
Brennan Benson
2026-08-24 11:26:25 -07:00
parent 014a4ef5e2
commit e025dfd9ea
2 changed files with 17 additions and 2 deletions
+12 -1
View File
@@ -195,6 +195,14 @@ describe('collectAgentTitleEvidence', () => {
expect(reasonFor(title)).toBe('anchored')
})
it.each(['Droid', 'Hermes', 'Devin'])(
'does not treat a bare working label as synthetic identity: %s',
(title) => {
expect(agentFor(title)).toBeNull()
expect(reasonFor(title)).toBe('free-text-only')
}
)
it.each([
'Claude Code ready',
'Claude thinking',
@@ -221,7 +229,10 @@ describe('collectAgentTitleEvidence', () => {
it.each([
['⠋ Cursor Agent', 'cursor'],
['⠋ Pi idle', 'pi'],
['⠋ OMP done', 'omp']
['⠋ OMP done', 'omp'],
['⠋ Droid', 'droid'],
['⠋ Hermes', 'hermes'],
['⠋ Devin', 'devin']
] as const)('recognizes the decorated identity frame %s', (title, agent) => {
expect(agentFor(title)).toBe(agent)
expect(reasonFor(title)).toBe('anchored')
+5 -1
View File
@@ -7,6 +7,7 @@ import {
GEMINI_SILENT_WORKING,
GEMINI_WORKING,
HERMES_AGENT_NAME_RE,
containsAgentSpinnerGlyph,
isClaudeIdentityFrameSegment,
isClaudeManagementTitle,
isCursorNativeAgentTitle,
@@ -196,7 +197,10 @@ function agentForSyntheticTitle(text: string): TuiAgent | null {
const profile = SYNTHETIC_AGENT_TITLE_PROFILES[agent]
const emittedLabels = [profile.permissionLabel, profile.idleLabel]
if (profile.synthesizeWorkingTitle !== false) {
emittedLabels.push(profile.workingLabel)
// Working labels are emitted only as spinner frames; a bare name is free text.
if (containsAgentSpinnerGlyph(trimmed) && normalized === profile.workingLabel.toLowerCase()) {
return agent
}
}
if (
profile.synthesizeTerminalTitle !== false &&