File tree Expand file tree Collapse file tree
client-runtime/src/work-log Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -118,6 +118,8 @@ function workEntryToolName(
118118) : string | undefined {
119119 const item = entry . structuredPayload ;
120120 if ( item ?. type === "dynamic_tool" && item . toolName ) return item . toolName ;
121+ // A command approval's label is the agent's free-text reason, never a tool name.
122+ if ( item ?. type === "approval_request" && item . requestKind === "command" ) return undefined ;
121123 const data = asRecord ( entry . toolData ) ;
122124 if ( typeof data ?. server === "string" && typeof data . tool === "string" ) {
123125 return `${ data . server } .${ data . tool } ` ;
Original file line number Diff line number Diff line change @@ -398,10 +398,8 @@ interface PendingPiPrompt {
398398 readonly turnItem : OrchestrationV2TurnItem ;
399399}
400400
401- const PI_TOOL_GATE_TITLE = / ^ A l l o w ( \S + ) \? $ / ;
402-
403401function piApprovalRequestKind ( title : string ) : "command" | "file-change" {
404- const toolName = PI_TOOL_GATE_TITLE . exec ( title ) ?. [ 1 ] ;
402+ const toolName = / ^ A l l o w ( \S + ) \? $ / . exec ( title ) ?. [ 1 ] ;
405403 return toolName !== undefined &&
406404 ( PI_FILE_CHANGE_TOOLS as ReadonlyArray < string > ) . includes ( toolName )
407405 ? "file-change"
@@ -1326,8 +1324,8 @@ export const makePiAdapterV2 = Effect.fn("makePiAdapterV2")(function* (
13261324 method === "confirm"
13271325 ? {
13281326 ...itemBase ,
1329- // The tool gate's "Allow bash?" restates the card ; other confirms keep their question .
1330- title : PI_TOOL_GATE_TITLE . test ( title ) ? null : title ,
1327+ // The bash gate's prompt is the command itself ; other tools need their name .
1328+ title : title === "Allow bash?" ? null : title ,
13311329 type : "approval_request" ,
13321330 requestId,
13331331 requestKind : piApprovalRequestKind ( title ) ,
You can’t perform that action at this time.
0 commit comments