fix(codex): show web search query and url in tool call details (#2093)
Co-authored-by: Julius Marminge <[email protected]>
This commit is contained in:
1 parent
d266c068d0
commit
33f1cb4224
1 file changed
+10
-3
@@ -267,8 +267,14 @@ function itemTitle(itemType: CanonicalItemType, item?: CodexLifecycleItem): stri
|
||||
}
|
||||
}
|
||||
|
||||
function itemDetail(item: CodexLifecycleItem): string | undefined {
|
||||
function itemDetail(itemType: CanonicalItemType, item: CodexLifecycleItem): string | undefined {
|
||||
const itemRecord = item as Record<string, unknown>;
|
||||
const action = itemRecord.action as Record<string, unknown> | undefined;
|
||||
const actionQueries = Array.isArray(action?.queries) ? action.queries : [];
|
||||
const candidates = [
|
||||
...(itemType === "web_search"
|
||||
? [itemRecord.query, action?.query, ...actionQueries, action?.pattern, action?.url]
|
||||
: []),
|
||||
"command" in item ? item.command : undefined,
|
||||
"title" in item ? item.title : undefined,
|
||||
"summary" in item ? item.summary : undefined,
|
||||
@@ -276,6 +282,7 @@ function itemDetail(item: CodexLifecycleItem): string | undefined {
|
||||
"path" in item ? item.path : undefined,
|
||||
"prompt" in item ? item.prompt : undefined,
|
||||
];
|
||||
|
||||
for (const candidate of candidates) {
|
||||
const trimmed = typeof candidate === "string" ? trimText(candidate) : undefined;
|
||||
if (!trimmed) continue;
|
||||
@@ -465,7 +472,7 @@ function mapItemLifecycle(
|
||||
return undefined;
|
||||
}
|
||||
|
||||
const detail = itemDetail(item);
|
||||
const detail = itemDetail(itemType, item);
|
||||
const status =
|
||||
lifecycle === "item.started"
|
||||
? "inProgress"
|
||||
@@ -839,7 +846,7 @@ function mapToRuntimeEvents(
|
||||
}
|
||||
const itemType = toCanonicalItemType(item.type);
|
||||
if (itemType === "plan") {
|
||||
const detail = itemDetail(item);
|
||||
const detail = itemDetail(itemType, item);
|
||||
if (!detail) {
|
||||
return [];
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user