| ... | ... | @@ -267,8 +267,14 @@ function itemTitle(itemType: CanonicalItemType, item?: CodexLifecycleItem): stri |
| 267 | 267 | } |
| 268 | 268 | } |
| 269 | 269 | |
| 270 | | function itemDetail(item: CodexLifecycleItem): string | undefined { |
| 270 | function itemDetail(itemType: CanonicalItemType, item: CodexLifecycleItem): string | undefined { |
| 271 | const itemRecord = item as Record<string, unknown>; |
| 272 | const action = itemRecord.action as Record<string, unknown> | undefined; |
| 273 | const actionQueries = Array.isArray(action?.queries) ? action.queries : []; |
| 271 | 274 | const candidates = [ |
| 275 | ...(itemType === "web_search" |
| 276 | ? [itemRecord.query, action?.query, ...actionQueries, action?.pattern, action?.url] |
| 277 | : []), |
| 272 | 278 | "command" in item ? item.command : undefined, |
| 273 | 279 | "title" in item ? item.title : undefined, |
| 274 | 280 | "summary" in item ? item.summary : undefined, |
| ... | ... | @@ -276,6 +282,7 @@ function itemDetail(item: CodexLifecycleItem): string | undefined { |
| 276 | 282 | "path" in item ? item.path : undefined, |
| 277 | 283 | "prompt" in item ? item.prompt : undefined, |
| 278 | 284 | ]; |
| 285 | |
| 279 | 286 | for (const candidate of candidates) { |
| 280 | 287 | const trimmed = typeof candidate === "string" ? trimText(candidate) : undefined; |
| 281 | 288 | if (!trimmed) continue; |
| ... | ... | @@ -465,7 +472,7 @@ function mapItemLifecycle( |
| 465 | 472 | return undefined; |
| 466 | 473 | } |
| 467 | 474 | |
| 468 | | const detail = itemDetail(item); |
| 475 | const detail = itemDetail(itemType, item); |
| 469 | 476 | const status = |
| 470 | 477 | lifecycle === "item.started" |
| 471 | 478 | ? "inProgress" |
| ... | ... | @@ -839,7 +846,7 @@ function mapToRuntimeEvents( |
| 839 | 846 | } |
| 840 | 847 | const itemType = toCanonicalItemType(item.type); |
| 841 | 848 | if (itemType === "plan") { |
| 842 | | const detail = itemDetail(item); |
| 849 | const detail = itemDetail(itemType, item); |
| 843 | 850 | if (!detail) { |
| 844 | 851 | return []; |
| 845 | 852 | } |