* 处理 token 使用信息
(usage: CodexEvent['usage'])
| 393 | return [{ type: 'edit', path }]; |
| 394 | }); |
| 395 | |
| 396 | const summary = fileChanges.length > 0 |
| 397 | ? fileChanges |
| 398 | .map((c) => ('path' in c ? `${c.type}: ${c.path}` : `${c.type}: ${c.from} → ${c.to}`)) |
| 399 | .join('\n') |
| 400 | : 'File changes'; |
| 401 | |
| 402 | const entry = createToolUse('apply_patch', summary, 'file_edit', item.id, item.id); |
| 403 | this.upsertItemEntry(item.id, { |
| 404 | ...entry, |
| 405 | metadata: { |
| 406 | ...entry.metadata, |
| 407 | status: this.getMcpToolStatus(item), |
| 408 | ...(fileChanges.length > 0 ? { fileChanges } : {}), |
| 409 | }, |
| 410 | }); |
no test coverage detected