mirror of
https://github.com/stablyai/orca.git
synced 2026-10-23 08:03:39 +00:00
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:
@@ -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'])
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user