Repository navigation
fix(chat): Show what a permission ask is actually asking - #694
Merged
Merged
Conversation
The consent row built itself from a tool call's kind and title and dropped the rest, so `other: Question from MCP server` was the whole of what a user had to decide on. `acp_wire.rs` now forwards the call's content, arguments and locations, and `chat-ask.js` decides what the row says: the question first, the arguments when there is none, the paths and the kind last, a sentence when there is genuinely nothing. All of it untrusted, all of it still written with `textContent`. Closes #678. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
DETAIL_LIMIT clamped the question but not the kind and paths drawn after it, so a row could reach 975 characters against a 600 budget; the title had no bound of its own and a verbose one spent all 600 before the question arrived. Fixes #678's own failure mode from a chatty server. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This was referenced Sep 14, 2026
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.
Why
A permission ask showed the tool call's kind and title and nothing else. A real ask on macOS read, in full:
The question was never forwarded. The user is asked to Allow or Deny with the subject withheld — and
otherisToolKind::Other, the least informative field available, given top billing.This is the one place the product asks the user to make a security decision, and it was the place that said least. Four buttons with the subject hidden is how people learn to click Allow reflexively.
permission_askbuiltPermissionAskfrom exactlytool_call.fields.titleand.kind. ACP'sToolCallUpdateFieldsalso carriescontent,raw_inputandlocations— all dropped on the floor. The question lived incontent.What changed
PermissionAsknow carriescontent,inputandlocations, and a newsrc/chat-ask.jsdecides what the row says:raw_inputis the fallback and never appears alongside content.kindrides last, andotheris dropped entirely — it is noise, not information.locationsrender, so an ask that would touch a path says which.(untitled)or a bare kind.src/chat.jsassigns the result withtextContent.innerHTMLappears nowhere insrc/*.js— verified by grep before and after — which matters becausecontentandraw_inputare untrusted: they come from a Harness and can be steered by an MCP server.The tool
nameis not used, and cannot be. The issue proposed it as better thanother, butpub namesits behind#[cfg(feature = "unstable_tool_call_name")]inagent-client-protocol-schema-1.7.0and this workspace is on default features (confirmed withcargo tree). That is recorded in thepermission_askdoc rather than left as a silent omission.How to verify
cargo test -p ai-buddy cargo clippy --workspace --all-targets -- -D warnings node --test tests/424 Rust tests, 124 node tests, clippy clean.
Rust tests cover the forwarding;
tests/chat-ask.test.jscovers what the row says. Both halves were mutation-tested and the failures observed, not assumed:ContentBlock::Textarman_ask_forwards_the_question_the_arguments_and_the_pathsand the harness integration test both FAILuntrusted text cannot forge a line of its ownFAILSthe kind and the paths are inside the budget, not after itFAILSa verbose title cannot crowd out the questionFAILSAdversarial payloads (
<img src=x onerror=alert(1)>,<script>alert(1)</script>, ajavascript:value) come back as literal characters; no markup is produced anywhere in the module.Notes
·separator can forge fields — but only fields the same server already controls, andlocationsis advisory, so the forgery buys nothing the honest field does not; the proposed fix (stripping commas from paths) would corrupt legitimate macOS paths. AndArray.isArray()guards were declined becausePermissionAskis#[derive(Serialize)]only, with noDeserialize— it is built in Rust and serialized outward, never round-tripped, so a non-array is unrepresentable and the guards would be dead code.main.rsis.inner_size(420.0, 560.0), so 420 is the width.request/title/kindonly, and does not gain the arguments..logoverflow and autoscroll behaviour, not on an observed screenshot.textContentand deliberately does not interpret the content as Markdown. feat(chat): Render Markdown in a reply instead of its source #677 is adding a Markdown renderer to the same surface; whether a consent row should ever render formatted content is a separate question, and the safe default until then is that it does not.Closes #678
— Claude Code agent, on @omesser's behalf.
🤖 Generated with Claude Code