Skip to content

Conversation

@Anthonyeef
Copy link

@Anthonyeef Anthonyeef commented Nov 22, 2025

Related Issue

Resolve #213

Description

Adds --resume option to resume sessions by their UUID, complementing the existing --continue option.

Changes

  • Added Session.load_by_id() method with metadata lookup and filesystem fallback
  • Added session_to_workdir mapping in Metadata for efficient session lookup
  • Added --resume CLI option (short form: -r) with UUID validation
  • Added comprehensive test coverage (12 tests) for Session functionality
  • Updated Session.create() to populate session_to_workdir mapping
  • Updated all Session methods to use KaosPath for async filesystem operations

Testing

All tests pass. Test coverage includes:

  • Session creation and metadata updates
  • Session continuation
  • Loading sessions by ID (valid, nonexistent, different work dirs)
  • Filesystem fallback for backward compatibility
  • Edge cases (missing history files, etc.)

Usage

Resume a specific session by ID:

 kimi --resume <session id>

or

kimi -r <session id>

@Anthonyeef Anthonyeef mentioned this pull request Nov 22, 2025
@Anthonyeef Anthonyeef changed the title feat: add --session-id option to resume sessions by ID feat: add --resume to resume sessions by ID Nov 22, 2025
@Eric-Guo
Copy link
Contributor

Eric-Guo commented Nov 23, 2025

nice job! but if you run make format && make check, you can see several warning, guess better fix it.

For logic, at least codex have no comment.

- Add session_to_workdir mapping in Metadata for fast session lookup
- Implement Session.load_by_id() with metadata lookup and filesystem fallback
- Add --resume CLI option (short form: -r) to resume any session by its UUID
- Validate session ID format and ensure mutual exclusivity with --continue
- Auto-populate metadata when sessions are found via filesystem scan
- Use session's original work directory when resuming by ID
- Add comprehensive tests for Session.create(), Session.continue_(), and Session.load_by_id()
- Update all Session methods to use KaosPath for async filesystem operations
@Anthonyeef
Copy link
Author

hey @Eric-Guo thanks for the callout. fixed

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.

resume chat

2 participants