Files
orca/src/main/codex/codex-session-migration-recent-exits.test.ts
T
NeilandOrca a639bd355e [perf-remote] perf(codex): skip migration scans for nonshared reattaches (#13654)
* perf(codex): skip migration scans for nonshared reattaches

* fix(codex): require provenance to skip migration scans and bound ignored launches

Drops the exit-match escape hatch that skipped a scan without route provenance, and ages out ignored reattach launches on the existing 60s/256 lease policy so a lost exit can no longer pin an active launch (and its completion marker) for the process lifetime.

Co-authored-by: Orca <help@stably.ai>

---------

Co-authored-by: Orca <help@stably.ai>
2026-08-11 00:33:17 -07:00

18 lines
615 B
TypeScript

import { describe, expect, it } from 'vitest'
import { CodexSessionMigrationRecentExits } from './codex-session-migration-recent-exits'
describe('CodexSessionMigrationRecentExits', () => {
it('refreshes a rerecorded ID before evicting the oldest entry', () => {
const exits = new CodexSessionMigrationRecentExits()
for (let index = 0; index < 256; index += 1) {
exits.record(`pty-${index}`, index + 1)
}
exits.record('pty-0', 500)
exits.record('pty-overflow', 501)
expect(exits.matchesAfter('pty-0', 499)).toBe(true)
expect(exits.matchesAfter('pty-1', 0)).toBe(false)
})
})