fix(bridges): headless tg_send wiring, PermissionRequest handling, /h…#118
Merged
Conversation
…elp output forwarding Issue #84 follow-up. Two user-visible bugs in headless/Docker deploys: 1. Telegram inline-keyboard approval prompts never appeared: - _start_headless_bridges never wired session_ctx.tg_send, so ask_input_interactive's `tg_send is not None` check failed and prompts fell through to invisible terminal input(). - _headless_run_query never promoted telegram_incoming → in_telegram_turn, so _is_in_tg_turn() returned False mid-run. - _headless_run_query ignored PermissionRequest events entirely, leaving event.granted=False so every approval-required tool was silently denied. 2. /help, /status, /model etc. only sent "✅ /cmd executed." — the actual menu (rendered via print()) went to docker logs instead of the chat. All three bridges (Telegram, Slack, WeChat) had the same shape. Fixed with a stdout/stderr Tee + ANSI strip; the Tee keeps writing to the original stream so docker logs are unaffected. Also fixed two callback edge cases in bridges/telegram.py: - Stale clicks on already-answered/timed-out prompts no longer paint a misleading "✓ Selected: y" confirmation onto the message. - Option values containing backticks/asterisks no longer break Markdown parsing in editMessageText (was failing silently). Tests: +9 regression tests pinning each fix. 118 bridge tests pass. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
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.
…elp output forwarding
Issue #84 follow-up. Two user-visible bugs in headless/Docker deploys:
Telegram inline-keyboard approval prompts never appeared:
tg_send is not Nonecheck failed and prompts fell through to invisible terminal input()./help, /status, /model etc. only sent "✅ /cmd executed." — the actual menu (rendered via print()) went to docker logs instead of the chat. All three bridges (Telegram, Slack, WeChat) had the same shape. Fixed with a stdout/stderr Tee + ANSI strip; the Tee keeps writing to the original stream so docker logs are unaffected.
Also fixed two callback edge cases in bridges/telegram.py:
Tests: +9 regression tests pinning each fix. 118 bridge tests pass.