fix(agents): stop reading "action required" in a Pi/OMP session name as a permission prompt (#34294)

This commit is contained in:
Kelvin Amoaba
2026-10-27 07:19:37 +00:00
committed by GitHub
parent 1dec1ebc35
commit cbbaa2d763
2 changed files with 6 additions and 4 deletions
@@ -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)
})
+2 -3
View File
@@ -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'