diff --git a/.changeset/fix-compaction-max-output-size.md b/.changeset/fix-compaction-max-output-size.md new file mode 100644 index 000000000..cac5f917c --- /dev/null +++ b/.changeset/fix-compaction-max-output-size.md @@ -0,0 +1,5 @@ +--- +"@moonshot-ai/agent-core": patch +--- + +Pass `maxOutputSize` to `resolveCompletionBudget` in the compaction worker to prevent falling back to `max_context_size` as the completion token cap. \ No newline at end of file diff --git a/packages/agent-core/src/agent/compaction/full.ts b/packages/agent-core/src/agent/compaction/full.ts index 3c52043a9..4ed98874e 100644 --- a/packages/agent-core/src/agent/compaction/full.ts +++ b/packages/agent-core/src/agent/compaction/full.ts @@ -244,6 +244,7 @@ export class FullCompaction { const provider = applyCompletionBudget({ provider: this.agent.config.provider, budget: resolveCompletionBudget({ + maxOutputSize: this.agent.config.maxOutputSize, reservedContextSize: this.agent.kimiConfig?.loopControl?.reservedContextSize, }), capability: this.agent.config.modelCapabilities,