test(terminal): pin one real OMP turn to two committed patches

Drives 30 working frames as Orca's injected extension emits them plus the
idle transition, and asserts what survives the churn gate. Before the fix
every frame alternated "⠋ Pi"/"⠋ OMP" and each one committed — ~12 store
patches per second on a working tab.

Co-authored-by: Seongho.Bak <49228032+psh4607@users.noreply.github.com>
This commit is contained in:
Neil
2026-08-25 01:02:29 -07:00
co-authored by Seongho.Bak
parent 50b1d96b5e
commit 2f50a80cea
@@ -191,3 +191,33 @@ describe('the state separator does not fire on ordinary titles', () => {
expect(detectAgentStatusFromTitle(title)).toBeNull()
})
})
describe('one real OMP turn', () => {
// Why: the reported symptom was ~12 committed store patches per second on a working OMP tab.
// This drives a full turn of the frames Orca's injected extension actually emits and counts
// what survives the churn gate. Before the fix each frame alternated "⠋ Pi"/"⠋ OMP" and every
// one of them committed.
it('commits twice across 30 working frames plus the idle transition', () => {
const frames = Array.from(
{ length: 30 },
(_, index) => `${FRAMES[index % FRAMES.length]} π - fixing the sidebar - orca`
)
frames.push('π - fixing the sidebar - orca')
const committed: string[] = []
let previous: string | null = null
for (const frame of frames) {
const normalized = normalizeTerminalTitle(frame)
if (previous !== null && isDecorativeAgentTitleFrameChange(previous, normalized)) {
continue
}
if (normalized === previous) {
continue
}
committed.push(normalized)
previous = normalized
}
expect(committed).toEqual(['⠋ π - fixing the sidebar - orca', 'π - fixing the sidebar - orca'])
})
})