You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(approval): always render the full command in approval prompts
Both the Telegram and terminal approval surfaces could show the
command-to-approve incompletely, undermining the user's ability to make
an informed decision.
Telegram (internal/telegram/approver.go):
- When the model supplied a description, the command was hidden entirely
and only the description was shown — the user approved a command they
could not see. The full command is now always rendered in a fenced
code block, with the description shown as a separate "Why:" line.
- The command was byte-sliced to 200 chars (UTF-8 unsafe, silent). It is
now only truncated when the whole message would exceed Telegram's hard
4096-char limit, on a rune boundary, with an explicit "[truncated]"
marker.
- Command content inside the code fence was unescaped, so a backtick or
backslash could close the fence early and corrupt rendering. Added
escapeCodeBlock() to escape ` and \ for MarkdownV2 code blocks.
Terminal (internal/narrate/narrate.go):
- extractShell scanned for the first quote pair, so any command with an
embedded quote (git commit -m "msg", python -c "code") was cut at the
first inner quote. It now decodes the JSON args properly, with the old
scan kept only as a malformed-input fallback.
- The shell narration was byte-truncated at 50 chars; truncate() is now
rune-safe and the shell budget is raised to 120.
Adds tests covering full-command rendering, code-block escaping,
hard-limit truncation, embedded-quote extraction, and rune-safe cuts.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
0 commit comments