fix: improve codex tool call live updates
This commit is contained in:
@@ -334,6 +334,26 @@ function createAgentRuntime(deps) {
|
||||
break;
|
||||
}
|
||||
|
||||
case 'item.updated': {
|
||||
const item = event.item;
|
||||
if (!item || !item.id || item.type === 'agent_message') break;
|
||||
const tc = ensureCodexToolCall(entry, item);
|
||||
const resultText = codexToolResult(item).slice(0, 2000);
|
||||
tc.done = false;
|
||||
tc.result = resultText;
|
||||
|
||||
wsSend(entry.ws, {
|
||||
type: 'tool_update',
|
||||
toolUseId: item.id,
|
||||
name: tc.name,
|
||||
input: tc.input,
|
||||
result: resultText,
|
||||
kind: tc.kind,
|
||||
meta: tc.meta,
|
||||
});
|
||||
break;
|
||||
}
|
||||
|
||||
case 'item.completed': {
|
||||
const item = event.item;
|
||||
if (!item || !item.id) break;
|
||||
@@ -361,6 +381,7 @@ function createAgentRuntime(deps) {
|
||||
const resultText = codexToolResult(item).slice(0, 2000);
|
||||
tc.done = true;
|
||||
tc.result = resultText;
|
||||
|
||||
wsSend(entry.ws, {
|
||||
type: 'tool_end',
|
||||
toolUseId: item.id,
|
||||
|
||||
Reference in New Issue
Block a user