mirror of
https://github.com/stablyai/orca.git
synced 2026-10-19 16:03:26 +00:00
test(terminal): close final review coverage gaps
This commit is contained in:
@@ -76,6 +76,7 @@ export const MAX_PENDING_PTY_SIDE_EFFECTS = 512
|
||||
// Why: agent status is last-wins store state, but payloads can carry KB-scale prompt/tool strings;
|
||||
// carry only the newest few through eviction so a status flood cannot re-grow what it evicted.
|
||||
export const MAX_EVICTED_AGENT_STATUS_PAYLOAD_CARRY = 16
|
||||
const MAX_EVICTED_AGENT_TITLE_TRANSITION_CARRY = 3
|
||||
|
||||
type PtyOutputCallbacks = Parameters<PtyTransport['connect']>[0]['callbacks']
|
||||
|
||||
@@ -218,7 +219,7 @@ export function createPtyOutputProcessor({
|
||||
continue
|
||||
}
|
||||
evictedAgentTitleTransitions.push({ phase, title })
|
||||
if (evictedAgentTitleTransitions.length > 3) {
|
||||
if (evictedAgentTitleTransitions.length > MAX_EVICTED_AGENT_TITLE_TRANSITION_CARRY) {
|
||||
evictedAgentTitleTransitions.shift()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,6 +56,21 @@ describe('selectEvictionExemptTerminalTabLayoutKey', () => {
|
||||
)
|
||||
})
|
||||
|
||||
it('is stable across leaf-map insertion order', () => {
|
||||
const first = layoutState({
|
||||
[LEAF_ID]: PTY_ID,
|
||||
[SECOND_LEAF_ID]: 'pty-local-detached'
|
||||
})
|
||||
const reversed = layoutState({
|
||||
[SECOND_LEAF_ID]: 'pty-local-detached',
|
||||
[LEAF_ID]: PTY_ID
|
||||
})
|
||||
|
||||
expect(selectEvictionExemptTerminalTabLayoutKey(first, TABS)).toBe(
|
||||
selectEvictionExemptTerminalTabLayoutKey(reversed, TABS)
|
||||
)
|
||||
})
|
||||
|
||||
it('tolerates tabs with no persisted layout', () => {
|
||||
expect(selectEvictionExemptTerminalTabLayoutKey({ terminalLayoutsByTabId: {} }, TABS)).toBe(
|
||||
JSON.stringify([[TAB_ID, []]])
|
||||
|
||||
Reference in New Issue
Block a user