-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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 2 commits
bb75ffd
bdeb5cf
49ca402
13313d9
158ad79
0b481be
3d9ff1a
672bc0c
24eb747
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 👍 / 👎.
Author
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. Addressed in commit |
||
| ); | ||
|
Comment on lines
+469
to
+474
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 👍 / 👎.
Author
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. Addressed in commit |
||
| 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 👍 / 👎.
Uh oh!
There was an error while loading. Please reload this page.
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.
Addressed in commit
158ad7928. AddednormalizePathForComparisoninrun-v2-print.ts, which case-folds paths on Windows (process.platform === 'win32' ? resolved.toLowerCase() : resolved) before equality comparison.