feat: Auto-import sessions on first use#707
Merged
AlexMikhalev merged 4 commits intomainfrom Mar 24, 2026
Merged
Conversation
added 4 commits
March 23, 2026 12:00
This change implements Option 1 for removing the explicit import command: - SessionService now auto-imports when cache is empty on first query - Removed 'sessions import' and 'sessions import-from' CLI commands - Removed '/sessions import' REPL command - Updated help text to reflect new behavior - Added enable_auto_import/disable_auto_import methods for testing - Sessions are automatically imported on list, search, stats, and sessions_by_source Breaking changes: - 'terraphim-agent sessions import' command removed - 'terraphim-agent sessions import-from' command removed - '/sessions import' REPL command removed (shows deprecation message) Benefits: - Simpler UX - no manual import step needed - Transparent to users - sessions just work - Reduced cognitive load - one less command to learn
- Remove unnecessary return statement in commands.rs - Apply consistent import ordering and formatting
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Implements automatic session import on first use, eliminating the need for explicit
importcommands.Changes
SessionService (
terraphim_sessions)auto_importflag (enabled by default)auto_import_attemptedtracking to prevent redundant importsenable_auto_import(),disable_auto_import(),is_auto_import_enabled()list_sessions(),search(),statistics(),sessions_by_source()CLI (
terraphim_agent)SessionsSub::ImportvariantSessionsSub::ImportFromvariantREPL
SessionsSubcommand::Importvariant/sessions importcommandUser Experience
Before:
After:
terraphim-agent sessions list # Auto-imports if neededTesting
test_statistics_emptyto disable auto-import for isolated testing--features repl-sessionsBreaking Changes
terraphim-agent sessions import- REMOVEDterraphim-agent sessions import-from <source>- REMOVED/sessions import- Shows deprecation messageBenefits