Skip to content

fix(one line fix): use max output size for compaction budget#478

Open
qkunio wants to merge 1 commit into
MoonshotAI:mainfrom
qkunio:fix/compaction-max-output-size
Open

fix(one line fix): use max output size for compaction budget#478
qkunio wants to merge 1 commit into
MoonshotAI:mainfrom
qkunio:fix/compaction-max-output-size

Conversation

@qkunio
Copy link
Copy Markdown
Contributor

@qkunio qkunio commented Jun 5, 2026

Related Issue

Resolve #476

Problem

/compact 会走一条单独的 provider 请求路径。#365 已经让普通对话使用模型配置里的 max_output_size 作为 completion token cap,但 compaction 路径里仍然只把 reservedContextSize 传给 resolveCompletionBudget

这会让 OpenAI-compatible provider 在 compaction 时把模型的 context size 当成 output token cap 发送,最终触发 APIContextOverflowError

What changed

代码只增加一行,解决报错。

在 compaction 的 completion budget 解析里传入 this.agent.config.maxOutputSize,让 /compact 优先使用模型配置的输出上限。

Checklist

  • I have read the CONTRIBUTING document.
  • I have linked a related issue, or explained the problem above.
  • I have added tests that prove my feature works.
  • Ran gen-changesets skill, or this PR needs no changeset.
  • Ran gen-docs skill, or this PR needs no doc update.

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Jun 5, 2026

⚠️ No Changeset found

Latest commit: 61c9040

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Jun 5, 2026

pnpm dlx https://pkg.pr.new/@moonshot-ai/kimi-code@61c9040
npx https://pkg.pr.new/@moonshot-ai/kimi-code@61c9040

commit: 61c9040

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Compaction Fails with APIContextOverflow due to sending the wrong context length

1 participant