fix: resolve potential UnboundLocalError and improve handler robustness#66
Merged
RichardAtCT merged 2 commits intoRichardAtCT:mainfrom Feb 23, 2026
Merged
Conversation
dc300b9 to
24186e8
Compare
24186e8 to
5079273
Compare
altdev0x
pushed a commit
to altdev0x/claude-code-telegram
that referenced
this pull request
Feb 23, 2026
…d bash checks; add skills to internal subdirs Upstream PRs merged: RichardAtCT#62 (replace ToolMonitor with can_use_tool), RichardAtCT#94 (session resume fallback), RichardAtCT#69 (bash chained command boundary), RichardAtCT#66 (handler robustness), RichardAtCT#83 (session ownership enforcement). Local change: add "skills" to _CLAUDE_INTERNAL_SUBDIRS so Claude Code can access symlinked skills under ~/.claude/skills/. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
Description
Richard's observation in Issue #63 regarding fragile bindings is addressed here. I initialized
promptat the function start to ensure it's always defined, preventing crashes during failed document processing.Structured logging replaces the previous
except: passblocks to make error tracking more transparent. Every handler now reports its failures to the project logger instead of dropping them.Errors are now passed through
escape_htmlbefore being sent to Telegram. I noticed that unescaped characters in raw exception strings were occasionally causing HTML parse errors, which this fix resolves.Related Issue
Fixes #63
Type of Change
Testing
Manual verification confirmed that uninitialized variables are no longer a risk and errors render correctly in Telegram.
Checklist