Fix the CI failures the merge left behind

- A merged import list named the same module twice, which the native code
  quality plugin fails on.
- A running turn is now reported by the host with no duration, so the settled
  map carries an explicit null for it; the hook test still expected the entry
  to be absent.
- main gave the older-page action a cursor with a head-trim guard, so the
  retention test's epoch-only action no longer typechecks; it now passes an
  unbounded sequence, which is what the old shape meant.
- The roster comparator moved into the extracted module, leaving its import
  unused in the reducer.
This commit is contained in:
Merge Sim
2026-09-10 11:28:11 -07:00
parent e27ca9b549
commit 2bfbae0683
3 changed files with 18 additions and 14 deletions
@@ -49,13 +49,15 @@ vi.mock('./use-structured-agent-session-outbox', () => ({
})
}))
import type { AgentJournalSubmission } from '../../../../shared/agent-session-journal-types'
import type {
AgentJournalRenderItem,
AgentJournalSubmission
} from '../../../../shared/agent-session-journal-types'
import {
applyNativeChatSessionOptionSettingsMutation,
resolveStructuredLaunchSeedOptions
} from '../../../../shared/native-chat-session-option-defaults'
import type { PersistedNativeChatSessionOptions } from '../../../../shared/native-chat-session-options'
import type { AgentJournalRenderItem } from '../../../../shared/agent-session-journal-types'
import { useStructuredAgentSession } from './use-structured-agent-session'
/** Replay every host mutation in order, exactly as the runtime does. */
@@ -598,8 +600,11 @@ describe('turn timing', () => {
)
expect(result.current.isWorking).toBe(true)
expect(result.current.workingStartedAt).toBe(50_000 - 300)
// t2 is still running, so the host has no duration for it: an explicit null
// that outranks whatever this client clocked locally.
expect([...result.current.settledTurns]).toEqual([
['u1', { startedAt: 9_000_000, workedSeconds: 4 }]
['u1', { startedAt: 9_000_000, workedSeconds: 4 }],
['u2', null]
])
vi.setSystemTime(80_000)
rerender()
@@ -3,14 +3,13 @@ import type {
AgentJournalRenderItem,
AgentJournalSubmission
} from './agent-session-journal-types'
import {
agentSessionBackgroundTasksEqual,
type AgentSessionBackgroundTaskState,
type AgentSessionSlashCommand,
type AgentSessionHandoffStatus,
type AgentSessionHistoryPage,
type AgentSessionSubscribeEvent,
type AgentSessionTurnActivity
import type {
AgentSessionBackgroundTaskState,
AgentSessionSlashCommand,
AgentSessionHandoffStatus,
AgentSessionHistoryPage,
AgentSessionSubscribeEvent,
AgentSessionTurnActivity
} from './agent-session-wire'
import { backgroundTaskStatesEqual } from './agent-session-background-task-state-equality'
import { agentJournalSubmissionKey } from './agent-session-journal-item-key'
@@ -73,7 +73,7 @@ function loadedHistory() {
for (const first of [129, 65, 1]) {
state = reduceStructuredAgentSession(state, {
type: 'older-page',
requestedEpoch: 'epoch',
requestedCursor: { epoch: 'epoch', sequence: Number.MAX_SAFE_INTEGER },
page: page(Array.from({ length: 64 }, (_, index) => index + first))
})
}
@@ -84,7 +84,7 @@ describe('durable turn attribution across paginated history', () => {
it('keeps an older page duration after the recent submission budget fills', () => {
const state = reduceStructuredAgentSession(loadedHistory(), {
type: 'older-page',
requestedEpoch: 'epoch',
requestedCursor: { epoch: 'epoch', sequence: Number.MAX_SAFE_INTEGER },
page: page([0])
})
expect(
@@ -125,7 +125,7 @@ describe('durable turn attribution across paginated history', () => {
it('drops an old alias once rewind removes its user item', () => {
const loaded = reduceStructuredAgentSession(loadedHistory(), {
type: 'older-page',
requestedEpoch: 'epoch',
requestedCursor: { epoch: 'epoch', sequence: Number.MAX_SAFE_INTEGER },
page: page([0])
})
const removed = reduceStructuredAgentSession(loaded, {