Skip to content

feat(agent-core): make compaction notes capture a forward plan, not just the next step - #1342

Merged
RealKai42 merged 1 commit into
mainfrom
kaiyi/dar-es-salaam
Jul 3, 2026
Merged

feat(agent-core): make compaction notes capture a forward plan, not just the next step#1342
RealKai42 merged 1 commit into
mainfrom
kaiyi/dar-es-salaam

Conversation

@RealKai42

Copy link
Copy Markdown
Collaborator

What

The context-compaction handoff note now records a forward plan for the remaining work — the upcoming steps, decisions already settled, foreseeable obstacles and how to handle them, and any work that can be pre-committed (the exact patch/query/final-answer shape) — instead of only the immediate next command.

Why

Compaction runs at the moment the model holds the most context it will ever have for this task; the next turn resumes with less. Spending that peak-context moment on a fuller forward plan (not just the next step) lets the agent continue more coherently after auto-compaction and cuts down re-investigation and re-deliberation on resume.

Changes

  • packages/agent-core/src/agent/compaction/compaction-instruction.md: reshape the single-step "next action" bullet into a "forward plan" directive framed around the max-context moment.
  • Update the affected compaction inline snapshots and one hardcoded input-token assertion (the instruction is ~163 tokens longer).

Testing

  • Full agent-core suite: 215 files / 3429 tests passing, 0 failures.

Changeset

  • @moonshot-ai/kimi-code: patch.

…ust the next step

Compaction runs at the point of maximum context for the task, and the next
turn resumes with less. So the handoff note now records the plan for the
remaining work — upcoming steps, settled decisions, and foreseeable obstacles,
plus any work that can be pre-committed — instead of only the immediate next
command. Update the affected compaction snapshots and one hardcoded
input-token assertion (the instruction is ~163 tokens longer).
@changeset-bot

changeset-bot Bot commented Jul 3, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 1fe8fd1

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

This PR includes changesets to release 1 package
Name Type
@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 Jul 3, 2026

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

commit: 1fe8fd1

@RealKai42
RealKai42 merged commit 84d8d5b into main Jul 3, 2026
10 checks passed
@RealKai42
RealKai42 deleted the kaiyi/dar-es-salaam branch July 3, 2026 05:38
@github-actions github-actions Bot mentioned this pull request Jul 3, 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