refactor: Ensure only one chat session at a time#378
Merged
Conversation
Adds session cleanup before starting new chat sessions to prevent multiple concurrent sessions. Also enhances ToolExecutionCompletedEvent with request ID and timestamp for better tracking. Removes unnecessary debug logging and fixes auto-save concurrency issues.
ig-semantic-release-bot bot
pushed a commit
that referenced
this pull request
Jan 24, 2026
## [0.99.1](v0.99.0...v0.99.1) (2026-01-24) ### ♻️ Code Refactoring * Ensure only one chat session at a time ([#378](#378)) ([4ebea6d](4ebea6d)) ### 📚 Documentation * Revise README description for CLI functionality ([6f3702f](6f3702f)) ### 🧹 Maintenance * Update package dependencies to latest versions ([#377](#377)) ([43960ce](43960ce))
|
🎉 This PR is included in version 0.99.1 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
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
This PR refactors chat session management to ensure only one chat session runs at a time and improves tool execution event handling.
Changes
1. Session Management
StartChatSession()to end existing sessions before starting new ones2. Event Enhancement
ToolExecutionCompletedEventwithRequestIDandTimestampfields3. Bug Fixes
HandleComputerUseResumedEvent4. Code Cleanup
5. Testing
agent_test_additions.goTechnical Details
Key Changes:
internal/services/agent.go: Added session cleanup before starting new chat sessionsinternal/domain/ui_events.go: EnhancedToolExecutionCompletedEventstructinternal/services/conversation.go: Fixed auto-save concurrency by removing goroutinesinternal/handlers/chat_handler.go: Removed duplicate session cleanupinternal/services/agent_test_additions.go: New test file for event handlingFiles Modified:
Impact
Testing