mirror of
https://github.com/deepseek-ai/deepseek-harness
synced 2026-08-15 21:04:50 +00:00
fix(compact): address PR 110 review findings
Honor cancellation and disposal around async pre-step setup before the loop can open a step or call the model. Route compaction summarization through agent/request so router agents can select the model, and remove the stale model argument from agent/pre-step. Document serial events and the approximate convergence bound, regenerate the Cordis catalog, and add regression coverage for router compaction, HMR cleanup, and assembly/pre-step interruption.
This commit is contained in:
@@ -43,14 +43,17 @@ describe.skipIf(!process.env.DEEPSEEK_API_KEY)('compaction: a long session compa
|
||||
// Tiny window so a couple of steps crosses the threshold. The convergence
|
||||
// invariant requires summarizationMaxTokens + retainTokens to be strictly
|
||||
// BELOW the threshold = floor(contextWindow * thresholdRatio) =
|
||||
// floor(2400 * 0.5) = 1200; 300 + 500 = 800 < 1200.
|
||||
// floor(2400 * 0.5) = 1200; 600 + 500 = 1100 < 1200. The summary cap
|
||||
// stays high enough for the live model to emit the required checkpoint
|
||||
// sections; a truncated checkpoint fails closed and leaves no summary.
|
||||
ctx = await codingHarness(workdir, {
|
||||
compact: {
|
||||
contextWindow: 2400,
|
||||
thresholdRatio: 0.5,
|
||||
retainTokens: 500,
|
||||
summarizationMaxTokens: 300,
|
||||
summarizationMaxTokens: 600,
|
||||
},
|
||||
persistenceRoot: './.sessions',
|
||||
})
|
||||
const agent = ctx.agentLoop.create(AgentId('e2e-compaction'), {
|
||||
model: 'deepseek-v4-flash',
|
||||
|
||||
Reference in New Issue
Block a user