Harden tmux session isolation, improve interactive pane capture reliability, and add /kill command#46
Open
Mage212 wants to merge 5 commits intosix-ddc:mainfrom
Open
Harden tmux session isolation, improve interactive pane capture reliability, and add /kill command#46Mage212 wants to merge 5 commits intosix-ddc:mainfrom
Mage212 wants to merge 5 commits intosix-ddc:mainfrom
Conversation
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.
This PR improves tmux session isolation, directory handling, interactive UI reliability, and topic lifecycle control in Telegram.
Key changes
Prevent leaking active bot venv into tmux Claude sessions
Claude launch now explicitly sanitizes inherited environment (VIRTUAL_ENV, UV_PROJECT, UV_WORKING_DIRECTORY) before starting the command in a new tmux window.
This prevents uv/Python tooling inside Claude from accidentally using the bot’s own environment/workspace.
Benefit: safer and more predictable execution context for project commands run by Claude.
Directory workflow from filesystem root (not bot project folder)
Session creation/browsing flow now starts from filesystem root context instead of being implicitly tied to the bot repo directory.
Also hardens working-directory isolation by forcing cd <selected_path> before Claude launch.
Benefit: users can reliably start sessions in any project on the host, independent of where the bot process is running.
tmux window hardening for more reliable interactive command detection
New windows are set to a fixed/manual size to reduce TUI wrapping variance and improve parser stability for interactive prompts.
Pane capture is more resilient and includes scrollback-aware behavior, so detection can still find prompts/command context when content is too large for the visible screen.
Benefit: significantly more stable detection of permission/input UIs and fewer missed controls in long outputs.
Implemented /kill command
Added dedicated /kill bot handler.
/kill now terminates the bound tmux window and unbinds the current topic (with proper cleanup behavior).
Added focused tests for /kill scenarios.
Benefit: explicit, user-driven session termination path that matches documented behavior.