Skip to content

fix: replay compaction records on resume#617

Merged
kermanx merged 4 commits into
mainfrom
xtr/replay-compaction-records
Jun 12, 2026
Merged

fix: replay compaction records on resume#617
kermanx merged 4 commits into
mainfrom
xtr/replay-compaction-records

Conversation

@kermanx

@kermanx kermanx commented Jun 10, 2026

Copy link
Copy Markdown
Collaborator

Related Issue

No linked issue.

Problem

Resumed TUI sessions did not show historical compaction activity because compaction state was not projected as a replay record. This made completed or cancelled compactions disappear from the transcript after resume.

What changed

  • Added compaction replay records for restored full-compaction lifecycle events.
  • Render replayed completed and cancelled compactions with the existing TUI compaction block.
  • Added resume replay coverage for completed and cancelled compactions in agent-core and TUI tests.
  • Added a patch changeset for the CLI-visible resume display fix.

Verification

  • pnpm vitest run packages/agent-core/test/agent/resume.test.ts
  • pnpm vitest run apps/kimi-code/test/tui/message-replay.test.ts
  • pnpm --filter @moonshot-ai/agent-core run typecheck
  • pnpm --filter @moonshot-ai/kimi-code run typecheck
  • pnpm exec oxlint --type-aware packages/agent-core/src/rpc/resumed.ts packages/agent-core/src/agent/compaction/full.ts packages/agent-core/src/agent/context/index.ts packages/agent-core/src/agent/replay/index.ts apps/kimi-code/src/tui/types.ts apps/kimi-code/src/tui/kimi-tui.ts apps/kimi-code/src/tui/controllers/session-replay.ts packages/agent-core/test/agent/resume.test.ts apps/kimi-code/test/tui/message-replay.test.ts
  • Read-only diff audit found no internal identifier issues.

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 10, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 191722d

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 10, 2026

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

commit: 191722d

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: dfa03dc29f

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread packages/agent-core/src/agent/replay/index.ts
@kermanx kermanx merged commit 911e7c3 into main Jun 12, 2026
8 checks passed
@kermanx kermanx deleted the xtr/replay-compaction-records branch June 12, 2026 03:10
@github-actions github-actions Bot mentioned this pull request Jun 12, 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