kimi-code icon indicating copy to clipboard operation
kimi-code copied to clipboard

feat(cli): support direct global session resume across working directories

Open creatiVision opened this issue 3 months ago • 0 comments

Is your feature request related to a problem? Please describe.

Currently, running kimi -r <sessionId> from outside a session's original creation directory refuses to resume directly, printing a message instructing the user to manually cd "<workDir>" && kimi -r <sessionId>. Additionally, path resolution differences (such as symlinks, trailing slashes, or subdirectories) can trigger [session.not_found] errors during session operations and model switches.

Describe the solution you'd like

  1. Direct Global Session Resume: kimi -r <sessionId> should seamlessly resolve the session via session_index.jsonl regardless of the current working directory, automatically adopting the session's recorded workDir for execution context.
  2. Fallback Session Lookup: Session lookup methods in SessionStore, sessionLifecycleService, and handlerForSession should fall back to querying the global session_index.jsonl index when an explicit sessionId is provided.
  3. Canonical Path Normalization: Ensure realpath / areSameFsPath normalization is consistently applied when comparing session workDir entries to avoid [session.not_found] when using symlinked or relative directory paths.

creatiVision avatar Aug 05 '26 08:08 creatiVision