Skip to content

feat: allow direct session resume across working directories - #118

Merged
kermanx merged 2 commits into
mainfrom
feat/resume-cross-workdir-sessions
May 29, 2026
Merged

feat: allow direct session resume across working directories#118
kermanx merged 2 commits into
mainfrom
feat/resume-cross-workdir-sessions

Conversation

@kermanx

@kermanx kermanx commented May 27, 2026

Copy link
Copy Markdown
Collaborator

Related Issue

N/A

Problem

Previously, users could not directly resume a session that belonged to a different working directory. The session list was scoped to the current workDir, making it impossible to discover or switch to sessions created elsewhere.

What changed

  • Extended SessionStore.list to support lookup by sessionId, workDir, or both, enabling cross-directory session discovery.
  • When no filters are provided, listSessions now returns all indexed sessions instead of requiring a workDir.
  • Changed the CLI behavior when resuming a session from a different working directory: instead of silently trying to resume, it now shows an error with the session's actual workDir and the exact cd && kimi -r command to switch to it.
  • Updated RPC core API, node-sdk types, and harness to propagate the new session lookup options.
  • Added unit tests for cross-workdir session listing and CLI resume behavior.

Migration notes

The previous implementation used a TUI cross-workdir-confirm state. That has been replaced with a simpler command-line prompt on both the TUI and headless prompt paths.

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 May 27, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: aec702b

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

This PR includes changesets to release 4 packages
Name Type
@moonshot-ai/agent-core Minor
@moonshot-ai/kimi-code-sdk Minor
@moonshot-ai/kimi-code Minor
@moonshot-ai/migration-legacy 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 May 27, 2026

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

commit: aec702b

@kermanx
kermanx force-pushed the feat/resume-cross-workdir-sessions branch from a0fbe70 to 14c2848 Compare May 29, 2026 03:30
- listSessions supports querying by sessionId, workDir, or both
- When no filters are provided, listSessions returns all indexed sessions
- CLI shows a helpful cd command when resuming a session from a different directory
@kermanx
kermanx force-pushed the feat/resume-cross-workdir-sessions branch 2 times, most recently from a0fbe70 to 49a391c Compare May 29, 2026 03:32

@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: aec702b39c

ℹ️ 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 apps/kimi-code/src/cli/run-prompt.ts
Comment thread apps/kimi-code/src/cli/run-prompt.ts
Comment thread apps/kimi-code/src/tui/kimi-tui.ts
@kermanx
kermanx merged commit 8913440 into main May 29, 2026
6 checks passed
@kermanx
kermanx deleted the feat/resume-cross-workdir-sessions branch May 29, 2026 07:11
@github-actions github-actions Bot mentioned this pull request May 29, 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