(item: CodexToolItem)
| 204 | } |
| 205 | |
| 206 | function* openToolCall(item: CodexToolItem): Generator<StreamChunk> { |
| 207 | if (openedToolItems.has(item.id)) return |
| 208 | openedToolItems.add(item.id) |
| 209 | const toolCallName = toolNameForItem(item) |
| 210 | const input = toolArgsForItem(item) |
| 211 | const args = JSON.stringify(input) |
| 212 | yield { |
| 213 | type: EventType.TOOL_CALL_START, |
| 214 | toolCallId: item.id, |
| 215 | toolCallName, |
| 216 | toolName: toolCallName, |
| 217 | model, |
| 218 | timestamp: now(), |
| 219 | } |
| 220 | yield { |
| 221 | type: EventType.TOOL_CALL_ARGS, |
| 222 | toolCallId: item.id, |
| 223 | model, |
| 224 | timestamp: now(), |
| 225 | delta: args, |
| 226 | args, |
| 227 | } |
| 228 | yield { |
| 229 | type: EventType.TOOL_CALL_END, |
| 230 | toolCallId: item.id, |
| 231 | toolCallName, |
| 232 | toolName: toolCallName, |
| 233 | model, |
| 234 | timestamp: now(), |
| 235 | input, |
| 236 | } |
| 237 | unresolvedToolCalls.add(item.id) |
| 238 | } |
| 239 | |
| 240 | function* handleItemCompleted(item: CodexThreadItem): Generator<StreamChunk> { |
| 241 | if (item.type === 'agent_message') { |
no test coverage detected