fix(compact): stamp summarization session ids
This commit is contained in:
@@ -291,6 +291,7 @@ export class BasicCompactService extends CompactService {
|
|||||||
}],
|
}],
|
||||||
system: SUMMARIZE_SYSTEM_PROMPT,
|
system: SUMMARIZE_SYSTEM_PROMPT,
|
||||||
maxTokens: this.config.maxTokens,
|
maxTokens: this.config.maxTokens,
|
||||||
|
sessionId: agent.session.id,
|
||||||
}
|
}
|
||||||
// exactOptionalPropertyTypes: only set `signal` when present — assigning
|
// exactOptionalPropertyTypes: only set `signal` when present — assigning
|
||||||
// `undefined` to an optional `signal?: AbortSignal` is a type error.
|
// `undefined` to an optional `signal?: AbortSignal` is a type error.
|
||||||
@@ -512,8 +513,6 @@ export class BasicCompactService extends CompactService {
|
|||||||
|
|
||||||
// ---- Internal helpers ----
|
// ---- Internal helpers ----
|
||||||
|
|
||||||
/**
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Frame the raw summary blocks into the content that lands on the surface:
|
* Frame the raw summary blocks into the content that lands on the surface:
|
||||||
* a checkpoint preamble (so a resuming model reads it as a checkpoint, not a
|
* a checkpoint preamble (so a resuming model reads it as a checkpoint, not a
|
||||||
|
|||||||
@@ -975,6 +975,7 @@ describe('BasicCompactService.summarize (real ctx.llm.stream)', () => {
|
|||||||
expect(adapter.lastOptions!.system).toContain('compaction engine')
|
expect(adapter.lastOptions!.system).toContain('compaction engine')
|
||||||
expect(adapter.lastOptions!.system).toContain('## Next Step')
|
expect(adapter.lastOptions!.system).toContain('## Next Step')
|
||||||
expect(adapter.lastOptions!.maxTokens).toBe(512)
|
expect(adapter.lastOptions!.maxTokens).toBe(512)
|
||||||
|
expect(adapter.lastOptions!.sessionId).toBe(SessionId('summary'))
|
||||||
expect(adapter.lastOptions!.messages[0]!.content[0]).toMatchObject({ type: 'text' })
|
expect(adapter.lastOptions!.messages[0]!.content[0]).toMatchObject({ type: 'text' })
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user