Skip to content

Commit da4331f

Browse files
committed
test: align compaction failure fixtures
1 parent 8389f62 commit da4331f

4 files changed

Lines changed: 19 additions & 4 deletions

File tree

src/agents/agent-command.live-model-switch.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -869,7 +869,7 @@ describe("agentCommand – LiveSessionModelSwitchError retry", () => {
869869
pendingFinalDeliveryLastAttemptAt: 3,
870870
pendingFinalDeliveryAttemptCount: 4,
871871
pendingFinalDeliveryLastError: "previous failure",
872-
pendingFinalDeliveryContext: { source: "user-message" },
872+
pendingFinalDeliveryContext: { channel: "tui" },
873873
pendingFinalDeliveryIntentId: "intent-1",
874874
};
875875
state.sessionEntryMock = sessionEntry;

src/agents/command/attempt-callbacks.test.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@ import { createAgentAttemptLifecycleCallbacks } from "./attempt-callbacks.js";
33

44
describe("createAgentAttemptLifecycleCallbacks", () => {
55
it("tracks user-message persistence without closing over the agent command scope", () => {
6-
const state = { currentTurnUserMessagePersisted: false, lifecycleEnded: false };
6+
const state = {
7+
currentTurnUserMessagePersisted: false,
8+
lifecycleFinishing: false,
9+
lifecycleEnded: false,
10+
};
711
const callbacks = createAgentAttemptLifecycleCallbacks(state);
812

913
callbacks.onUserMessagePersisted?.({
@@ -17,7 +21,11 @@ describe("createAgentAttemptLifecycleCallbacks", () => {
1721
});
1822

1923
it("tracks terminal lifecycle phases", () => {
20-
const state = { currentTurnUserMessagePersisted: false, lifecycleEnded: false };
24+
const state = {
25+
currentTurnUserMessagePersisted: false,
26+
lifecycleFinishing: false,
27+
lifecycleEnded: false,
28+
};
2129
const callbacks = createAgentAttemptLifecycleCallbacks(state);
2230

2331
callbacks.onAgentEvent({ stream: "lifecycle", data: { phase: "start" } });

src/agents/command/cli-compaction.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,9 @@ describe("runCliTurnCompactionLifecycle", () => {
268268
compactAgentHarnessSession.mock.invocationCallOrder[0] ?? 0,
269269
);
270270
expect(compactAgentHarnessSession).toHaveBeenCalledTimes(1);
271-
expect(compactAgentHarnessSession.mock.calls[0]?.[0]).toMatchObject({
271+
const compactAgentHarnessSessionCalls = compactAgentHarnessSession.mock
272+
.calls as unknown as Array<[Record<string, unknown>]>;
273+
expect(compactAgentHarnessSessionCalls[0]?.[0]).toMatchObject({
272274
sessionId,
273275
sessionKey,
274276
sessionFile,

src/auto-reply/reply/agent-runner.misc.runreplyagent.test.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2467,6 +2467,11 @@ describe("runReplyAgent fallback reasoning tags", () => {
24672467
provider: "google-gemini-cli",
24682468
model: "gemini-3",
24692469
}));
2470+
compactState.compactEmbeddedPiSessionMock.mockResolvedValueOnce({
2471+
ok: true,
2472+
compacted: true,
2473+
result: { tokensAfter: 1_000_000 },
2474+
});
24702475

24712476
await createRun({
24722477
sessionEntry: {

0 commit comments

Comments
 (0)