Skip to content

Commit d1c4943

Browse files
fix(codex): reuse canonical item type for details
1 parent 3342618 commit d1c4943

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

‎apps/server/src/provider/Layers/CodexAdapter.ts‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -249,8 +249,7 @@ function itemTitle(itemType: CanonicalItemType): string | undefined {
249249
}
250250
}
251251

252-
function itemDetail(item: CodexLifecycleItem): string | undefined {
253-
const itemType = toCanonicalItemType(item.type);
252+
function itemDetail(itemType: CanonicalItemType, item: CodexLifecycleItem): string | undefined {
254253
const itemRecord = item as Record<string, unknown>;
255254
const action = itemRecord.action as Record<string, unknown> | undefined;
256255
const candidates = [
@@ -452,7 +451,7 @@ function mapItemLifecycle(
452451
return undefined;
453452
}
454453

455-
const detail = itemDetail(item);
454+
const detail = itemDetail(itemType, item);
456455
const status =
457456
lifecycle === "item.started"
458457
? "inProgress"
@@ -826,7 +825,7 @@ function mapToRuntimeEvents(
826825
}
827826
const itemType = toCanonicalItemType(item.type);
828827
if (itemType === "plan") {
829-
const detail = itemDetail(item);
828+
const detail = itemDetail(itemType, item);
830829
if (!detail) {
831830
return [];
832831
}

0 commit comments

Comments
 (0)