fix: address codex migration review feedback
This commit is contained in:
@@ -179,10 +179,7 @@ function isRecord(value: unknown): value is Record<string, unknown> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function isCodexTranscriptWatch(watch: Record<string, unknown>): boolean {
|
function isCodexTranscriptWatch(watch: Record<string, unknown>): boolean {
|
||||||
if (watch.name === 'codex' || watch.schema === 'codex') return true;
|
return watch.name === 'codex' || watch.schema === 'codex';
|
||||||
return typeof watch.path === 'string'
|
|
||||||
&& watch.path.includes('.codex')
|
|
||||||
&& watch.path.includes('sessions');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function disableCodexTranscriptAgentsContext(): boolean {
|
function disableCodexTranscriptAgentsContext(): boolean {
|
||||||
@@ -286,7 +283,7 @@ export function uninstallCodexCli(): number {
|
|||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
const message = error instanceof Error ? error.message : String(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;
|
failed = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ const CODEX_SAMPLE_SCHEMA: TranscriptSchema = {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'tool-use',
|
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',
|
action: 'tool_use',
|
||||||
fields: {
|
fields: {
|
||||||
toolId: 'payload.call_id',
|
toolId: 'payload.call_id',
|
||||||
@@ -70,13 +70,36 @@ const CODEX_SAMPLE_SCHEMA: TranscriptSchema = {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'tool-result',
|
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',
|
action: 'tool_result',
|
||||||
fields: {
|
fields: {
|
||||||
toolId: 'payload.call_id',
|
toolId: 'payload.call_id',
|
||||||
toolResponse: 'payload.output'
|
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',
|
name: 'session-end',
|
||||||
match: { path: 'payload.type', in: ['turn_aborted', 'turn_completed', 'task_complete'] },
|
match: { path: 'payload.type', in: ['turn_aborted', 'turn_completed', 'task_complete'] },
|
||||||
|
|||||||
@@ -41,13 +41,14 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "tool-use",
|
"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",
|
"action": "tool_use",
|
||||||
"fields": {
|
"fields": {
|
||||||
"toolId": "payload.call_id",
|
"toolId": "payload.call_id",
|
||||||
"toolName": {
|
"toolName": {
|
||||||
"coalesce": [
|
"coalesce": [
|
||||||
"payload.name",
|
"payload.name",
|
||||||
|
"payload.type",
|
||||||
{ "value": "web_search" }
|
{ "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",
|
"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",
|
"action": "tool_result",
|
||||||
"fields": {
|
"fields": {
|
||||||
"toolId": "payload.call_id",
|
"toolId": "payload.call_id",
|
||||||
|
|||||||
Reference in New Issue
Block a user