From 2f50a80cead28833f30f9adfc0ca69e1f0ac595f Mon Sep 17 00:00:00 2001 From: Neil <4138956+nwparker@users.noreply.github.com> Date: Tue, 25 Aug 2026 00:55:14 -0700 Subject: [PATCH] test(terminal): pin one real OMP turn to two committed patches MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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> --- ...omp-pi-semantic-title-preservation.test.ts | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/src/shared/omp-pi-semantic-title-preservation.test.ts b/src/shared/omp-pi-semantic-title-preservation.test.ts index 994c4379558..3fb89390fc7 100644 --- a/src/shared/omp-pi-semantic-title-preservation.test.ts +++ b/src/shared/omp-pi-semantic-title-preservation.test.ts @@ -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']) + }) +})