diff --git a/tests/purge-strategy.test.mjs b/tests/purge-strategy.test.mjs index 211a11bf..4800fd6b 100644 --- a/tests/purge-strategy.test.mjs +++ b/tests/purge-strategy.test.mjs @@ -142,7 +142,10 @@ test('experimental prompt overhead still participates in the original complete-i } const { f, context } = setup(t, { sessionFactory: () => new ThresholdInput() }, '工程'.repeat(3900)); f.store.saveConfig({ contextLimit: 64000, maxOutputTokens: 256 }); const group = await prepare(f, context); await (await context.manager.start(f.session, group.id, group.fingerprint)).promise; - assert.equal(context.requests.length, 0); assert.equal(jobs(f)[0].requests.length, 0); assert.match(jobs(f)[0].error, /预算/); + // The overhead pushes the complete input past the context window, so the guard + // reports context_limit; the original budget wording belongs to the reservation branch. + assert.equal(context.requests.length, 0); assert.equal(jobs(f)[0].requests.length, 0); assert.match(jobs(f)[0].error, /上下文窗口可用容量/); + assert.equal(jobs(f)[0].inputRejections[0].limitingReason, 'context_limit'); assert.equal(f.store.core.task.get(group.children[0].taskId).usage.requests, 0); assert.ok(context.native[0].baselineEstimate <= 64000); assert.ok(context.native[0].experimentalEstimate > 64000); });