fix: address codex migration review feedback

This commit is contained in:
Alex Newman
2026-05-06 14:32:03 -07:00
parent 156062170d
commit a64d60b9cb
3 changed files with 53 additions and 9 deletions
@@ -179,10 +179,7 @@ function isRecord(value: unknown): value is Record<string, unknown> {
}
function isCodexTranscriptWatch(watch: Record<string, unknown>): 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;
}
+25 -2
View File
@@ -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'] },