-
Notifications
You must be signed in to change notification settings - Fork 1.2k
fix(cli): resume older working-directory sessions in /sessions and --continue #2952
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "@moonshot-ai/kimi-code": patch | ||
| --- | ||
|
|
||
| Restore older working-directory sessions in `/sessions` and `kimi --continue`. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -448,7 +448,9 @@ async function resolveNativeSession( | |
|
|
||
| if (opts.continue) { | ||
| const page = await index.listRecent({}); | ||
| const previous = page.items.find((summary) => summary.cwd === workDir); | ||
| const previous = page.items.find( | ||
| (summary) => summary.cwd !== undefined && resolve(summary.cwd) === resolve(workDir), | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When a session was created through the SDK/API with a symlinked workDir (for example, Useful? React with 👍 / 👎. |
||
| ); | ||
|
Comment on lines
+451
to
+453
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When a persisted read-model row has all required summary fields but a malformed optional Useful? React with 👍 / 👎. |
||
| if (previous !== undefined) { | ||
| const session = await resumeById(previous.id); | ||
| const agentContext = await ensureMainAgent(session); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When the same Windows working directory is entered with different component casing (for example, a stored
C:/Users/Alice/Repoversus a currentC:/users/alice/repo),resolve()makes the paths absolute and normalizes their syntax but preserves that casing, so this equality still fails and--continuesilently starts a new session. Use the repository's Windows-aware workspace-root normalization, or otherwise case-fold Windows-shaped paths, before comparing them.Useful? React with 👍 / 👎.