[codex] Hide view image tool prompts#92
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 91f474cad6
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| _NO_CONTENT_PLACEHOLDER = "(no content)" | ||
| _INTERRUPTED_TEXT = "[Request interrupted by user for tool use]" | ||
| _INTERNAL_TOOL_NAMES = {"update_plan"} | ||
| _INTERNAL_TOOL_NAMES = {"update_plan", "view_image", "viewimage"} |
There was a problem hiding this comment.
Hide orphaned view_image outputs
When the bot starts or restarts after the view_image function_call has already been consumed but before its function_call_output is read, the in-memory pending-tool map in session_monitor is empty, and the output entry only carries a call_id with no tool name. In that case _is_internal_tool_name(tool_name) sees None, so the parser emits the JSON output containing data:image/png;base64,... as a persistent Telegram tool-result bubble instead of hiding it. Adding view_image to the internal-name set only hides outputs while the matching call is still pending; the output shape should also be detected or the hidden call IDs persisted/reconstructed.
Useful? React with 👍 / 👎.
Summary
view_image/viewimagetool use and tool result bubbles by treating them as internal transcript tools.view_imagefunction call/output pairs so base64 image payloads stay out of Telegram history and realtime notifications.Validation
TELEGRAM_CODEX_BOT_SHOW_BASH_TOOL_CALLS=true timeout 180s uv run --extra dev pytest tests/telegram_codex_bot/test_transcript_parser.pytimeout 120s uv run --extra dev ruff check src/telegram_codex_bot/transcript_parser.py tests/telegram_codex_bot/test_transcript_parser.pyNote: an initial local pytest run inherited
TELEGRAM_CODEX_BOT_SHOW_BASH_TOOL_CALLS=falsefrom this VPS runtime environment and failed two existing Bash visibility expectations; rerunning with the test default made the target suite pass.