-
Notifications
You must be signed in to change notification settings - Fork 827
feat: add session context export/import slash commands with shell utilities and tests #1317
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
Merged
Merged
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
0eb6f93
feat: add /export and /import commands for session context management
RealKai42 82470e0
Merge branch 'main' into kaiyi/export-import-cmd
RealKai42 1c2fdc6
docs: update docs
RealKai42 a4d41a5
feat: enhance import/export commands with directory error handling an…
RealKai42 f8a65ce
Merge branch 'main' into kaiyi/export-import-cmd
RealKai42 31381bf
Merge branch 'main' into kaiyi/export-import-cmd
RealKai42 8fa9402
feat: refactor export/import commands for improved error handling and…
RealKai42 c1a3853
refactor: rename export and import helper functions for clarity
RealKai42 988af95
feat: add wire markers for session replay during context import
RealKai42 bde82b9
feat: add file size limit for import and corresponding error handling…
RealKai42 1d2b878
feat: add test for handling oversized session content in resolve_impo…
RealKai42 0c69bab
feat: update export output display to use shortened home path and adj…
RealKai42 f48098a
feat: add warnings for sensitive information in export and import pro…
RealKai42 5995252
feat: update .env file handling to check filename instead of extensio…
RealKai42 16cbc6f
feat: add is_sensitive_file utility to identify sensitive filenames a…
RealKai42 f3b2bec
feat: remove unused wire markers in import context and update related…
RealKai42 c5219c1
feat: add file type check for sensitive file warnings in import context
RealKai42 8c2430f
Merge branch 'main' into kaiyi/export-import-cmd
RealKai42 a4d333e
feat: integrate estimate_text_tokens for accurate token counting in i…
RealKai42 9d24c0f
feat: support relative paths in perform_export and resolve_import_sou…
RealKai42 79c87d2
feat: refactor import functionality to use perform_import and enhance…
RealKai42 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
🟡 Soul-level
/importhandler missing wire_file writes, breaking session replayThe shell-level
/importhandler inexport_import.py:97-101explicitly writesTurnBeginandTurnEndtosoul.wire_fileso the import appears in session replay. However, the soul-level/importhandler insoul/slash.py:205-243does not write towire_file. When/importis invoked through the wire protocol (non-shell UIs), the import action will not be recorded in the session's wire file and won't appear during session replay.Root Cause
The shell handler at
src/kimi_cli/ui/shell/export_import.py:97-101writes wire markers:But the soul-level handler at
src/kimi_cli/soul/slash.py:205-243only useswire_send()(which sends events over the live wire protocol) and never writes towire_file(which persists events for session replay).KimiSoul.run()atsrc/kimi_cli/soul/kimisoul.py:241does callwire_send(TurnBegin(...))but this only sends events to the wire transport — it does not write to the wire_file for replay.Impact: When using
/importin wire mode (or any non-shell UI), the import won't be visible if the session is later replayed or resumed.Was this helpful? React with 👍 or 👎 to provide feedback.