恢复 Codex PlanList 并更新发布包

This commit is contained in:
shiyue
2026-09-29 09:58:18 +08:00
parent d70bbf08d9
commit 75989cb4de
7 changed files with 139 additions and 16 deletions

View File

@@ -152,6 +152,10 @@ function createCodexAppRuntime(deps = {}) {
return CODEX_APP_PLAN_TOOL_NAMES.has(name) || name.endsWith('_update_plan');
}
function isCcwebPlanItem(item) {
return item?.type === 'mcpToolCall' && item.server === 'ccweb' && item.tool === 'ccweb_update_plan';
}
function isPlanLikeItem(item) {
if (!item || typeof item !== 'object') return false;
if (CODEX_APP_PLAN_ITEM_TYPES.has(normalizeIdentifier(item.type))) return true;
@@ -248,7 +252,7 @@ function createCodexAppRuntime(deps = {}) {
})
.filter(Boolean);
return {
id: item.id || item.itemId || item.planId || 'codex-app-plan',
id: isCcwebPlanItem(item) ? 'ccweb-update-plan' : (item.id || item.itemId || item.planId || 'codex-app-plan'),
type: 'todo_list',
items,
progress: summarizeTodoListProgress(items),
@@ -587,7 +591,7 @@ function createCodexAppRuntime(deps = {}) {
return {
kind: 'todo_list',
title: 'Plan List',
subtitle: item.explanation || item.title || item.tool || '',
subtitle: item.explanation || item.title || (isCcwebPlanItem(item) ? '' : item.tool || ''),
status: todoListPlanStatus(item, todoList),
progress: todoList.progress,
};
@@ -698,7 +702,8 @@ function createCodexAppRuntime(deps = {}) {
function ensureToolCall(entry, item, sessionId) {
if (!item?.id) return null;
const kind = itemKind(item);
let toolCall = entry.toolCalls.find((tool) => tool.id === item.id);
const itemId = isCcwebPlanItem(item) ? 'ccweb-update-plan' : item.id;
let toolCall = entry.toolCalls.find((tool) => tool.id === itemId);
if (toolCall) {
toolCall.name = itemName(item);
toolCall.kind = kind;
@@ -738,7 +743,7 @@ function createCodexAppRuntime(deps = {}) {
toolCall = {
name: itemName(item),
id: item.id,
id: itemId,
kind,
meta: itemMeta(item),
input: itemInput(item),