Unified · Split
| @@ -24,11 +24,12 @@ describe("deriveWorkLogEntries command output", () => { · 23 unmodified lines | ||
| 24 | 24 | makeCommandActivity("codex-command", { |
| 25 | 25 | itemType: "command_execution", |
| 26 | 26 | title: "Ran command", |
| 27 | − detail: "printf hello", | |
| 27 | + detail: "/bin/zsh -lc \"printf 'hello\\n'\"", | |
| 28 | 28 | data: { |
| 29 | 29 | item: { |
| 30 | 30 | type: "commandExecution", |
| 31 | − command: "printf hello", | |
| 31 | + command: "/bin/zsh -lc \"printf 'hello\\n'\"", | |
| 32 | + commandActions: [{ command: "printf 'hello\\n'", type: "unknown" }], | |
| 32 | 33 | aggregatedOutput: "hello\n<exited with exit code 0>", |
| 33 | 34 | status: "completed", |
| 34 | 35 | }, |
| @@ -37,7 +38,8 @@ describe("deriveWorkLogEntries command output", () => { · 2 unmodified lines | ||
| 37 | 38 | ]); |
| 38 | 39 | |
| 39 | 40 | expect(entry).toMatchObject({ |
| 40 | − command: "printf hello", | |
| 41 | + command: "printf 'hello\\n'", | |
| 42 | + rawCommand: "/bin/zsh -lc \"printf 'hello\\n'\"", | |
| 41 | 43 | detail: "hello", |
| 42 | 44 | }); |
| 43 | 45 | }); |
| @@ -1234,13 +1234,18 @@ function extractToolDetail( · 1233 unmodified lines | ||
| 1234 | 1234 | const normalizedHeading = normalizePreviewForComparison(heading); |
| 1235 | 1235 | const normalizedDetail = normalizePreviewForComparison(detail); |
| 1236 | 1236 | const commandTool = isCommandToolDetail(payload, heading); |
| 1237 | − const command = commandTool ? extractToolCommand(payload).command : null; | |
| 1237 | + const commandPreview = commandTool | |
| 1238 | + ? extractToolCommand(payload) | |
| 1239 | + : { command: null, rawCommand: null }; | |
| 1240 | + const command = commandPreview.command; | |
| 1238 | 1241 | const normalizedCommand = normalizePreviewForComparison(command); |
| 1242 | + const normalizedRawCommand = normalizePreviewForComparison(commandPreview.rawCommand); | |
| 1239 | 1243 | |
| 1240 | 1244 | if ( |
| 1241 | 1245 | detail && |
| 1242 | 1246 | normalizedHeading !== normalizedDetail && |
| 1243 | − (!commandTool || normalizedCommand !== normalizedDetail) | |
| 1247 | + (!commandTool || | |
| 1248 | + (normalizedCommand !== normalizedDetail && normalizedRawCommand !== normalizedDetail)) | |
| 1244 | 1249 | ) { |
| 1245 | 1250 | return detail; |
| 1246 | 1251 | } |