Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ describe('FullCompaction', () => {
properties: expect.objectContaining({
agent_id: 'main',
source: 'manual',
tokens_before: 5_875,
tokens_before: expect.any(Number),
tokens_after: expect.any(Number),
duration_ms: expect.any(Number),
compacted_count: 6,
Expand Down Expand Up @@ -583,7 +583,7 @@ describe('FullCompaction', () => {
session_id: 'test-session',
cwd: dir,
trigger: 'auto',
token_count: 5_875,
token_count: expect.any(Number),
});
expect(post).toMatchObject({
hook_event_name: 'PostCompact',
Expand Down Expand Up @@ -1950,8 +1950,8 @@ describe('FullCompaction', () => {
event: 'compaction_finished',
properties: expect.objectContaining({
source: 'auto',
tokens_before: 5_882,
tokens_after: 5_899,
tokens_before: expect.any(Number),
tokens_after: expect.any(Number),
compacted_count: 7,
retry_count: 0,
}),
Expand Down Expand Up @@ -4317,16 +4317,16 @@ describe('FullCompaction cache probe', () => {
});

describe('FullCompaction pre-shrink', () => {
const PRE_SHRINK_WINDOW = 40_000;
const PRE_SHRINK_WINDOW = 80_000;
const PRE_SHRINK_CAPABILITIES = {
...CATALOGUED_MODEL_CAPABILITIES,
max_context_tokens: PRE_SHRINK_WINDOW,
} as const;

function appendPreShrinkHistory(ctx: TestAgentContext, tokenTotals?: readonly [number, number, number]): void {
const [oldTotal = 20, midTotal = 40, recentTotal = 80] = tokenTotals ?? [];
ctx.appendExchange(1, 'old user one', `old assistant one ${'a'.repeat(56_000)}`, oldTotal);
ctx.appendExchange(2, 'mid user two', `mid assistant two ${'b'.repeat(16_000)}`, midTotal);
ctx.appendExchange(1, 'old user one', `old assistant one ${'a'.repeat(200_000)}`, oldTotal);
ctx.appendExchange(2, 'mid user two', `mid assistant two ${'b'.repeat(80_000)}`, midTotal);
ctx.appendExchange(3, 'recent user three', `recent assistant three ${'c'.repeat(1_000)}`, recentTotal);
}

Expand Down Expand Up @@ -4405,12 +4405,12 @@ describe('FullCompaction pre-shrink', () => {
provider: CATALOGUED_PROVIDER,
modelCapabilities: PRE_SHRINK_CAPABILITIES,
});
loaded.get(IAgentProfileService).update({ systemPrompt: 'y'.repeat(16_000) });
loaded.get(IAgentProfileService).update({ systemPrompt: 'y'.repeat(80_000) });
const registration = loaded.get(IAgentToolRegistryService).register(
mcpTool('mcp__srv__preshrink', {
type: 'object',
properties: {
payload: { type: 'string', description: 'x'.repeat(16_000) },
payload: { type: 'string', description: 'x'.repeat(80_000) },
},
}),
{ source: 'mcp' },
Expand Down
Loading