feat: parse execute tool commands and render them in the chat UI (#25478)

When the execute tool runs a chained shell command, the UI previously
rendered the raw string. Long chains like "cd /repo && git pull &&
git add . && git commit -m fix" were hard to scan.

A new ChatMessagePart.ParsedCommands [][]string field on tool-call
parts carries one entry per simple command, parsed in chatd from args
via mvdan.cc/sh/v3/syntax. The frontend renders the joined list ("cd,
git pull, git add, git commit") in place of the raw command, and falls
back to the raw command when the field is absent.

Closes CODAGT-446
This commit is contained in:
Mathias Fredriksson
2026-05-21 08:12:34 +00:00
committed by GitHub
parent ec1e861152
commit f1b772928d
24 changed files with 749 additions and 22 deletions
+10
View File
@@ -16824,6 +16824,16 @@ const docTemplate = `{
"name": {
"type": "string"
},
"parsed_commands": {
"description": "ParsedCommands holds parsed programs from an execute tool call's\nshell command, one entry per simple command in source order. Each\nentry is [program] or [program, arg] where arg is the first non-flag\npositional argument. Only populated when ToolName is \"execute\" and\nthe command parses successfully; nil otherwise.",
"type": "array",
"items": {
"type": "array",
"items": {
"type": "string"
}
}
},
"provider_executed": {
"description": "ProviderExecuted indicates the tool call was executed by\nthe provider (e.g. Anthropic computer use).",
"type": "boolean"