Fix Windows compatibility, Telegram encoding, and add session control#6
Open
mhamel wants to merge 3 commits intopolinom:mainfrom
Open
Fix Windows compatibility, Telegram encoding, and add session control#6mhamel wants to merge 3 commits intopolinom:mainfrom
mhamel wants to merge 3 commits intopolinom:mainfrom
Conversation
added 3 commits
January 8, 2026 13:31
This commit addresses three critical issues:
1. **Windows Compatibility**: Added explicit UTF-8 encoding to subprocess calls in
claude.py and codex.py to ensure proper execution on Windows systems where the
default encoding may differ.
2. **Telegram Special Characters**: Fixed encoding issues with special characters
(accents, emojis, etc.) in Telegram messages by:
- Adding UTF-8 encoding to subprocess calls
- Implementing fallback mechanism in telegram.py to retry without parse_mode
when markdown parsing fails with special characters
3. **Codex Session Control**: Added TELECODE_CODEX_PERSIST_SESSION configuration
option to control whether Codex sessions are persisted across messages:
- Default: enabled (1) - maintains backward compatibility
- Set to 0 to disable session persistence (fresh context each message)
- Added startup debug output to show current configuration
- Updated README.md and CLAUDE.md documentation
Breaking Changes: None - all changes are backward compatible.
Fixes issues with non-ASCII characters and provides better control over AI
session management.
The previous implementation used 'claude.cmd' on Windows, but the actual installed binary is 'claude.exe'. Simplifying to just 'claude' works across all platforms since Windows automatically resolves to .exe files in PATH.
- Added support for both /new (Codex) and /clear (Claude) commands - Both commands clear the current engine's session ID - Single menu entry shows '/clear or /new' to indicate both work - Provides user feedback confirming session reset
polinom
approved these changes
Jan 10, 2026
Owner
polinom
left a comment
There was a problem hiding this comment.
Thanks for fixing staff. I'd be happy to merge it in if you raise PR 👍
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 commit addresses three critical issues:
Windows Compatibility: Added explicit UTF-8 encoding to subprocess calls in claude.py and codex.py to ensure proper execution on Windows systems where the default encoding may differ.
Telegram Special Characters: Fixed encoding issues with special characters (accents, emojis, etc.) in Telegram messages by:
Codex Session Control: Added TELECODE_CODEX_PERSIST_SESSION configuration option to control whether Codex sessions are persisted across messages:
Breaking Changes: None - all changes are backward compatible.
Fixes issues with non-ASCII characters and provides better control over AI session management.