fix(compaction): preserve summary diagnostics on cancellation
This commit is contained in:
1 parent
debb4b9a9c
commit
73e10fb80c
2 files changed
+7
-1
No files matched your search
@@ -400,7 +400,7 @@ async function summarizeCompaction(
|
||||
summaryResult = await dependencies.summarize(prepared.input, agent, signal)
|
||||
break
|
||||
} catch (error: unknown) {
|
||||
signal?.throwIfAborted()
|
||||
if (signal?.aborted === true) throw error
|
||||
assertStable(dependencies, agent.session, prepared)
|
||||
if (!dependencies.recover(error, agent, prepared.shadowedSeqs, signal)) throw error
|
||||
prepared = prepareCompaction(dependencies, agent.session,
|
||||
|
||||
@@ -364,6 +364,12 @@ describe('compaction-image-offload', () => {
|
||||
await agent.whenIdle()
|
||||
expect(adapter.requests).toHaveLength(1)
|
||||
expect(decisions(agent.session)).toEqual([])
|
||||
expect(ctx.waterfall('compaction/summary-error', {
|
||||
session: agent.session,
|
||||
sourceEventSeqs: agent.session.surface.nodes,
|
||||
error: new LlmError('summary budget exceeded', IMAGE_OFFLOAD_REQUIRED_CODE, { offloadImages: 1 }),
|
||||
}, () => false)).toBe(false)
|
||||
expect(decisions(agent.session)).toEqual([])
|
||||
})
|
||||
|
||||
it('leaves every other failure to downstream recovery', async () => {
|
||||
|
||||
Reference in new issue
Block a user