Skip to content

fix(acp-server): include full bash command in permission requests - #3160

Open
jangjoe wants to merge 1 commit into
MoonshotAI:mainfrom
jangjoe:fix/bash-full-command-in-permission
Open

fix(acp-server): include full bash command in permission requests#3160
jangjoe wants to merge 1 commit into
MoonshotAI:mainfrom
jangjoe:fix/bash-full-command-in-permission

Conversation

@jangjoe

@jangjoe jangjoe commented Aug 21, 2026

Copy link
Copy Markdown

Resolve #3106

ACP session/request_permission for a Bash tool call used to show only
the first 50 characters of args.command (followed by an ellipsis when
longer), because displayBlockToAcpContent did not recognise the
command ToolInputDisplay kind and silently dropped
display.command.

Add a kind: 'command' branch in displayBlockToAcpContent that projects
block.command into a text content entry on the wire so clients see the
full command in the approval card. The 50-character action preview that
the engine packs into ApprovalRequest.action is unchanged.

Test plan

  • packages/acp-server/test/convert.test.ts — new describe('displayBlockToAcpContent') block covering diff / file_io (both / one-sided) / plan_review (empty / with path) / command (short and longer-than-50) / generic-null.
  • packages/acp-server/test/approval.test.tsbuildPermissionToolCallUpdate with a long command asserts the full command lands in content[0] and the 50-char preview stays in the trailing content.at(-1).
  • packages/acp-server/test/e2e-turn.test.ts — end-to-end scripted LLM issues a Bash call; the captured session/request_permission payload's toolCall.content[] contains the full command.

ACP session/request_permission for a Bash tool call used to show only
the first 50 characters of args.command (followed by an ellipsis when
longer), because displayBlockToAcpContent did not recognise the
`command` ToolInputDisplay kind and silently dropped display.command.

Add a `kind: 'command'` branch that projects block.command into a
text content entry on the wire so clients see the full command in
the approval card. The 50-character action preview is unchanged.

Resolve MoonshotAI#3106
@changeset-bot

changeset-bot Bot commented Aug 21, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 2594b7b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@moonshot-ai/kimi-code Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2594b7b8e1

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +296 to +297
if (block.kind === 'command') {
return { type: 'content', content: { type: 'text', text: block.command } };

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep command projection scoped to permission requests

When any Bash call reaches tool.call.started, this shared converter is also called by toolCallStartToSessionUpdate and toolCallStartedUpgradeToSessionUpdate in events-map.ts, so the ordinary tool card now receives the full command followed by the existing JSON-encoded arguments containing that same command; streamed calls can receive it again during the upgrade. This change is intended for session/request_permission, so add the command entry in buildPermissionToolCallUpdate rather than changing the converter used by normal tool-call notifications.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(acp-server): include full bash command in permission requests

1 participant