Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions apps/server/src/provider/Layers/CodexAdapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -267,15 +267,22 @@ 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,
"text" in item ? item.text : undefined,
"path" in item ? item.path : undefined,
"prompt" in item ? item.prompt : undefined,
];

Comment thread
cursor[bot] marked this conversation as resolved.
for (const candidate of candidates) {
const trimmed = typeof candidate === "string" ? trimText(candidate) : undefined;
if (!trimmed) continue;
Expand Down Expand Up @@ -465,7 +472,7 @@ function mapItemLifecycle(
return undefined;
}

const detail = itemDetail(item);
const detail = itemDetail(itemType, item);
const status =
lifecycle === "item.started"
? "inProgress"
Expand Down Expand Up @@ -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 [];
}
Expand Down
Loading