From a64d60b9cb23a3e99f4e3f326a38ee6cb46a13c5 Mon Sep 17 00:00:00 2001 From: Alex Newman Date: Wed, 6 May 2026 14:32:03 -0700 Subject: [PATCH] fix: address codex migration review feedback --- .../integrations/CodexCliInstaller.ts | 7 ++--- src/services/transcripts/config.ts | 27 ++++++++++++++++-- transcript-watch.example.json | 28 +++++++++++++++++-- 3 files changed, 53 insertions(+), 9 deletions(-) diff --git a/src/services/integrations/CodexCliInstaller.ts b/src/services/integrations/CodexCliInstaller.ts index bfee3634..3e6f4210 100644 --- a/src/services/integrations/CodexCliInstaller.ts +++ b/src/services/integrations/CodexCliInstaller.ts @@ -179,10 +179,7 @@ function isRecord(value: unknown): value is Record { } function isCodexTranscriptWatch(watch: Record): boolean { - if (watch.name === 'codex' || watch.schema === 'codex') return true; - return typeof watch.path === 'string' - && watch.path.includes('.codex') - && watch.path.includes('sessions'); + return watch.name === 'codex' || watch.schema === 'codex'; } function disableCodexTranscriptAgentsContext(): boolean { @@ -286,7 +283,7 @@ export function uninstallCodexCli(): number { } } catch (error) { const message = error instanceof Error ? error.message : String(error); - console.error(`\nLegacy AGENTS.md cleanup failed: ${message}`); + console.error(`\nLegacy context cleanup failed: ${message}`); failed = true; } diff --git a/src/services/transcripts/config.ts b/src/services/transcripts/config.ts index 5e239bbe..f821b9bc 100644 --- a/src/services/transcripts/config.ts +++ b/src/services/transcripts/config.ts @@ -47,7 +47,7 @@ const CODEX_SAMPLE_SCHEMA: TranscriptSchema = { }, { name: 'tool-use', - match: { path: 'payload.type', in: ['function_call', 'custom_tool_call', 'web_search_call', 'exec_command'] }, + match: { path: 'payload.type', in: ['function_call', 'custom_tool_call', 'web_search_call'] }, action: 'tool_use', fields: { toolId: 'payload.call_id', @@ -70,13 +70,36 @@ const CODEX_SAMPLE_SCHEMA: TranscriptSchema = { }, { name: 'tool-result', - match: { path: 'payload.type', in: ['function_call_output', 'custom_tool_call_output', 'exec_command_output'] }, + match: { path: 'payload.type', in: ['function_call_output', 'custom_tool_call_output'] }, action: 'tool_result', fields: { toolId: 'payload.call_id', toolResponse: 'payload.output' } }, + { + name: 'exec-command-end', + match: { path: 'payload.type', in: ['exec_command_end', 'exec_command_output'] }, + action: 'observation', + fields: { + toolUseId: 'payload.call_id', + toolName: { value: 'exec_command' }, + toolInput: { + coalesce: [ + 'payload.command', + 'payload.input' + ] + }, + toolResponse: { + coalesce: [ + 'payload.aggregated_output', + 'payload.output', + 'payload.stdout', + 'payload.stderr' + ] + } + } + }, { name: 'session-end', match: { path: 'payload.type', in: ['turn_aborted', 'turn_completed', 'task_complete'] }, diff --git a/transcript-watch.example.json b/transcript-watch.example.json index 56529d29..13f1e0e9 100644 --- a/transcript-watch.example.json +++ b/transcript-watch.example.json @@ -41,13 +41,14 @@ }, { "name": "tool-use", - "match": { "path": "payload.type", "in": ["function_call", "custom_tool_call", "web_search_call", "exec_command"] }, + "match": { "path": "payload.type", "in": ["function_call", "custom_tool_call", "web_search_call"] }, "action": "tool_use", "fields": { "toolId": "payload.call_id", "toolName": { "coalesce": [ "payload.name", + "payload.type", { "value": "web_search" } ] }, @@ -61,9 +62,32 @@ } } }, + { + "name": "exec-command-end", + "match": { "path": "payload.type", "in": ["exec_command_end", "exec_command_output"] }, + "action": "observation", + "fields": { + "toolUseId": "payload.call_id", + "toolName": { "value": "exec_command" }, + "toolInput": { + "coalesce": [ + "payload.command", + "payload.input" + ] + }, + "toolResponse": { + "coalesce": [ + "payload.aggregated_output", + "payload.output", + "payload.stdout", + "payload.stderr" + ] + } + } + }, { "name": "tool-result", - "match": { "path": "payload.type", "in": ["function_call_output", "custom_tool_call_output", "exec_command_output"] }, + "match": { "path": "payload.type", "in": ["function_call_output", "custom_tool_call_output"] }, "action": "tool_result", "fields": { "toolId": "payload.call_id",