diff --git a/src/shared/omp-pi-semantic-title-preservation.test.ts b/src/shared/omp-pi-semantic-title-preservation.test.ts index 82543a9f174..b06c699cbb9 100644 --- a/src/shared/omp-pi-semantic-title-preservation.test.ts +++ b/src/shared/omp-pi-semantic-title-preservation.test.ts @@ -63,7 +63,10 @@ describe('detectAgentStatusFromTitle reads the π state separator', () => { ['π > fixing the sidebar', 'idle'], ['π ⠋ fixing the sidebar', 'working'], ['⠋ π - fixing the sidebar - orca', 'working'], - ['π: fixing the sidebar', 'idle'] + ['π: fixing the sidebar', 'idle'], + // Session names are free text; only the synthetic label means permission. + ['π - fix action required banner - orca', 'idle'], + ['OMP - fix action required banner - orca', 'idle'] ])('classifies %s as %s', (title, expected) => { expect(detectAgentStatusFromTitle(title)).toBe(expected) }) diff --git a/src/shared/pi-compatible-synthetic-title.ts b/src/shared/pi-compatible-synthetic-title.ts index 27f3a603853..b7fa1898b6b 100644 --- a/src/shared/pi-compatible-synthetic-title.ts +++ b/src/shared/pi-compatible-synthetic-title.ts @@ -12,7 +12,6 @@ const LEGACY_PI_COMPATIBLE_TITLE_RE = /^\s*(?:[\u2800-\u28ff]\s+)?\u03C0(?:\s*[- // A leading spinner needs Orca's ` - ` working frame, so Claude tasks like `⠂ OMP: fix` stay Claude's. const PI_COMPATIBLE_SEPARATOR_RE = /^\s*(?:[\u2800-\u28ff]\s+(?=\S+\s+-(?:\s|$)))?(\u03C0|Pi|OMP)(?::|\s+([!>:\-\u2800-\u28ff]))(?=\s|$)/u -const PI_COMPATIBLE_PERMISSION_TAIL_RE = /\baction required\b/i const PI_COMPATIBLE_LEADING_BRAND_RE = /^(\s*(?:[\u2800-\u28ff]\s+)?)(?:\u03C0|Pi|OMP)/u @@ -77,8 +76,8 @@ export function getPiCompatibleTitleSeparatorStatus( if (!match) { return null } - // Synthetic action-required labels also use hyphens; guard the exported parser independently of caller ordering. - if (PI_COMPATIBLE_PERMISSION_TAIL_RE.test(title)) { + // The synthetic `OMP - action required` label also uses a hyphen; match only that label, never session text. + if (getPiCompatibleSyntheticAgentStatus(title) === 'permission') { return 'permission' } return match[2] === '!' ? 'permission' : 'idle'