authorgravatar for 46866023+GuilhermeVieiraDev@users.noreply.github.comGuilherme Vieira <46866023+GuilhermeVieiraDev@users.noreply.github.com> 2026-07-20 09:58:38+01:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2026-07-20 10:58:38+02:00
log33f1cb422461bf0f072b9f181734e9b654d1ca69
treef7ce054177211239fbed999a76fe916dfb88b212
parentd266c068d0e8b8cd168d38cd70b885a7a9e233e2
signature Signed by PGP key B5690EEEBB952194

fix(codex): show web search query and url in tool call details (#2093)

Co-authored-by: Julius Marminge <julius0216@outlook.com>

1 files changed, 10 insertions(+), 3 deletions(-)

apps/server/src/provider/Layers/CodexAdapter.ts+10-3
......@@ -267,8 +267,14 @@ function itemTitle(itemType: CanonicalItemType, item?: CodexLifecycleItem): stri
267267 }
268268}
269269
270function itemDetail(item: CodexLifecycleItem): string | undefined {
270function 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 : [];
271274 const candidates = [
275 ...(itemType === "web_search"
276 ? [itemRecord.query, action?.query, ...actionQueries, action?.pattern, action?.url]
277 : []),
272278 "command" in item ? item.command : undefined,
273279 "title" in item ? item.title : undefined,
274280 "summary" in item ? item.summary : undefined,
......@@ -276,6 +282,7 @@ function itemDetail(item: CodexLifecycleItem): string | undefined {
276282 "path" in item ? item.path : undefined,
277283 "prompt" in item ? item.prompt : undefined,
278284 ];
285
279286 for (const candidate of candidates) {
280287 const trimmed = typeof candidate === "string" ? trimText(candidate) : undefined;
281288 if (!trimmed) continue;
......@@ -465,7 +472,7 @@ function mapItemLifecycle(
465472 return undefined;
466473 }
467474
468 const detail = itemDetail(item);
475 const detail = itemDetail(itemType, item);
469476 const status =
470477 lifecycle === "item.started"
471478 ? "inProgress"
......@@ -839,7 +846,7 @@ function mapToRuntimeEvents(
839846 }
840847 const itemType = toCanonicalItemType(item.type);
841848 if (itemType === "plan") {
842 const detail = itemDetail(item);
849 const detail = itemDetail(itemType, item);
843850 if (!detail) {
844851 return [];
845852 }