Skip to content

fix: preserve thinking during compaction - #464

Merged
kermanx merged 1 commit into
mainfrom
xtr/preserve-compaction-thinking
Jun 5, 2026
Merged

kermanx merged 1 commit into
mainfrom
xtr/preserve-compaction-thinking

Conversation

@kermanx

@kermanx kermanx commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Related Issue

No linked issue. This fixes a focused compaction regression found during development.

Problem

Full-context compaction could rebuild a provider without the active thinking effort, so the summarization request for long conversations did not preserve the session's thinking setting.

What changed

The agent config provider getter now applies the resolved thinking effort at the point where providers are created. The main LLM path now consumes that normalized provider directly, and full compaction inherits the same provider state when retrying after context overflow. A regression test covers context-overflow compaction with thinking enabled and asserts every generate call keeps high thinking.

Verification

  • pnpm --filter @moonshot-ai/agent-core test -- test/agent/compaction/full.test.ts
  • pnpm --filter @moonshot-ai/agent-core typecheck
  • Read-only diff audit for context-specific internal identifiers: no issues found.

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

changeset-bot Bot commented Jun 5, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 6ef3428

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@moonshot-ai/agent-core Patch
@moonshot-ai/kimi-code Patch

Not sure what this means? Click here to learn what changesets are.

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

@pkg-pr-new

pkg-pr-new Bot commented Jun 5, 2026

Copy link
Copy Markdown
pnpm dlx https://pkg.pr.new/@moonshot-ai/kimi-code@6ef3428
npx https://pkg.pr.new/@moonshot-ai/kimi-code@6ef3428

commit: 6ef3428

@kermanx
kermanx merged commit 4f9977d into main Jun 5, 2026
9 checks passed
@kermanx
kermanx deleted the xtr/preserve-compaction-thinking branch June 5, 2026 06:25
@github-actions github-actions Bot mentioned this pull request Jun 5, 2026
RealKai42 added a commit that referenced this pull request Jun 5, 2026
Resolve overlap with #464 (preserve thinking during compaction): both sink
provider request config from Agent.llm into ConfigState.provider. #464 sinks
withThinking; this branch sinks the KIMI_MODEL_* sampling params and
thinking.keep alongside it. Net effect: compaction — which now carries
thinking via #464 — also carries temperature/top_p and (when thinking is on)
thinking.keep. Agent.llm now simply reads config.provider.
sailist pushed a commit that referenced this pull request Jun 9, 2026
7723qqq pushed a commit to 7723qqq/kimi-code that referenced this pull request Aug 15, 2026
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.

1 participant