diff --git a/docs/architecture/ai_handoff_index_cn.md b/docs/architecture/ai_handoff_index_cn.md index 1266cc8..244483d 100644 --- a/docs/architecture/ai_handoff_index_cn.md +++ b/docs/architecture/ai_handoff_index_cn.md @@ -158,6 +158,7 @@ - Heartbeat discovery 已能缓存 `model/list / skills/list / skills/extraRoots/set / hooks/list / plugin/list / app/list / modelProvider/capabilities/read / experimentalFeature/list / collaborationMode/list / permissionProfile/list / mcpServerStatus/list / account/read / account/rateLimits/read / config/read / configRequirements/read / externalAgentConfig/detect / thread/list / thread/loaded/list / thread/turns/list` 的能力摘要。`thread/turns/list` 固定使用 `itemsView=summary`,只额外提取最终 `agentMessage` 安全摘要,并合并进 `projectCandidates.recentAssistantMessages` 让 Codex Desktop 自己产生的新回复反向同步到 Boss APP;不保存用户正文、reasoning 原文、命令输出、原始 items、内部 prompt 或系统提示词。同批已补 `turn/steer` 活跃 turn 干预和 `POST /api/v1/projects/[projectId]/thread-collaboration` 服务端线程协作排队入口。 - 第十九批另补 `threadActionSummary` 线程操作能力摘要:设备详情页会显示 archive / unarchive / fork / compact / rollback / rename / metadata / steer / interrupt / shell / unsubscribe 等能力分组;该字段只读,不在 heartbeat 中调用任何会改变线程状态的 App Server API。 - 第二十九批另补 `threadCollaborationSummary` 线程协作口径:设备详情页会显示 Boss Broker、协作事件 handler、协作模式数量和“非原生私聊”状态。本机 0.136.0-alpha.2 生成 schema 已确认 `app/list`、`app/list/updated`、`configRequirements/read`、`mcpServerStatus/list` 和 `ThreadItem.contextCompaction`,但未声明 `collaborationMode/list`、`thread/turns/list` 或 `ThreadItem.collabToolCall`;因此当前产品层把线程间协作定义为 Boss 受控 Broker + App Server 注入/执行链路,不把它表述成 Codex 原生任意线程 P2P 聊天。 +- 同批新增 `protocolDriftSummary` 协议漂移摘要:设备详情页会显示兼容/告警、失败探针数、官方文档跟进项和 Boss Broker 兜底策略。该字段来自 discovery errors 的 method 级安全归一,不保存错误原文、线程 ID、用户正文或内部 prompt;后续 Codex Server 更新时优先看这个摘要决定是否需要补 runner 或前台展示。 - 第二十批另补 `pluginGovernanceSummary` 插件治理能力摘要:设备详情页会显示 install / uninstall / read / skill-read / share 等能力分组;该字段只读,不在 heartbeat 中调用任何插件安装、卸载或共享写 API。 - 第二十一批另补 `accountGovernanceSummary / configGovernanceSummary` 账号与配置治理能力摘要:设备详情页会显示 login / logout / token refresh / add credits nudge / config write / MCP reload / Skill config write 等能力分组;这些字段只读,不在 heartbeat 中调用任何账号或配置写 API。 - 第二十二批另补 `fileSystemGovernanceSummary / commandSessionSummary` 文件系统与命令会话治理能力摘要:设备详情页会显示 file read/write/remove/watch 与 command stdin / resize / terminate / stream 等能力分组;这些字段只读,不在 heartbeat 中调用任何文件读写或命令控制 API。 diff --git a/docs/architecture/api_and_service_inventory_cn.md b/docs/architecture/api_and_service_inventory_cn.md index bfdc866..0681aa7 100644 --- a/docs/architecture/api_and_service_inventory_cn.md +++ b/docs/architecture/api_and_service_inventory_cn.md @@ -125,6 +125,7 @@ - App Server heartbeat discovery 现在还会把最终 `agentMessage` 安全摘要合并进 `projectCandidates.recentAssistantMessages`。服务端根据 `codexThreadRef` 将 Codex Desktop 自己产生的新回复反向同步到 Boss APP 对应会话、preview、lastMessageAt 和未读数;已有本地扫描候选的 folder/thread 映射优先,App Server 只补充最新回复摘要。 - App Server heartbeat discovery 现在还会写入 `capabilities.codexAppServer.metadata.threadActionSummary`。该字段用于 APP/后台展示当前协议下可接入的线程治理动作数量和分组,覆盖 archive / unarchive / fork / compact / rollback / rename / metadata / steer / interrupt / shell / unsubscribe;它只来自 runner 安全 catalog 和协议快照,不会在 heartbeat 中调用这些写操作。 - App Server heartbeat discovery 现在还会写入 `capabilities.codexAppServer.metadata.threadCollaborationSummary`。该字段用于 APP/后台展示 Boss Broker、协作事件 handler、协作模式数量和“非原生私聊”边界;当前本机 `codex-cli 0.136.0-alpha.2` schema 未声明 `ThreadItem.collabToolCall`,所以线程协作继续走 Boss 服务端 `thread-collaboration` 入口和受控 App Server 注入/执行链路。 +- App Server heartbeat discovery 现在还会写入 `capabilities.codexAppServer.metadata.protocolDriftSummary`。该字段用于 APP/后台展示协议漂移状态,包含 `driftLevel`、`failedProbeCount`、`runtimeFailureMethods`、`docFollowupItems` 和 `fallbackStrategy`;其中 `runtimeFailureMethods` 只保留 method 名,不保存错误原文、线程 ID、用户正文或内部 prompt。 - App Server heartbeat discovery 现在还会写入 `capabilities.codexAppServer.metadata.pluginGovernanceSummary`。该字段用于 APP/后台展示当前协议下可接入的插件治理动作数量和分组,覆盖 install / uninstall / read / skill-read / share;它只来自 runner 安全 catalog 和协议快照,不会在 heartbeat 中调用插件安装、卸载或共享写操作。 - App Server heartbeat discovery 现在还会写入 `capabilities.codexAppServer.metadata.accountGovernanceSummary / configGovernanceSummary`。这些字段用于 APP/后台展示当前协议下可接入的账号与配置治理动作数量和分组,覆盖 login / logout / token refresh / add credits nudge / config write / MCP reload / Skill config write;它们只来自 runner 安全 catalog 和协议快照,不会在 heartbeat 中调用账号或配置写操作。 - App Server heartbeat discovery 现在还会写入 `capabilities.codexAppServer.metadata.fileSystemGovernanceSummary / commandSessionSummary`。这些字段用于 APP/后台展示当前协议下可接入的文件系统与命令会话动作数量和分组,覆盖 file read/write/remove/watch 以及 command stdin / resize / terminate / stream;它们只来自 runner 安全 catalog 和协议快照,不会在 heartbeat 中调用文件读写或命令控制操作。 diff --git a/docs/architecture/codex_server_progress_card_cn.md b/docs/architecture/codex_server_progress_card_cn.md index 9c48142..67d459d 100644 --- a/docs/architecture/codex_server_progress_card_cn.md +++ b/docs/architecture/codex_server_progress_card_cn.md @@ -1,6 +1,6 @@ # Codex Server 协议与 Boss 执行进度卡接入记录 -更新时间:`2026-06-03` +更新时间:`2026-06-04` ## 1. Codex 最新开放协议结论 @@ -26,6 +26,8 @@ Boss 不能直接把 App Server 原始 Thread / Turn / Item 字段写进业务 2026-06-04 第二十九批已按本机 `codex-cli 0.136.0-alpha.2` 重新生成协议快照,manifest 扩展到 151 个 method,并新增 schema 暴露的 `ThreadItem` 类型矩阵。当前 schema 确认 `app/list`、`app/list/updated`、`configRequirements/read`、`mcpServerStatus/list` 和 `ThreadItem.contextCompaction`,但未声明 `collaborationMode/list`、`thread/turns/list` 或 `ThreadItem.collabToolCall`;Boss 因此新增 `threadCollaborationSummary`,在设备详情页明确展示 Boss Broker 可用、协作事件 handler 可用、协作模式数量和“非原生私聊”状态,避免把线程协作误做成无监管 P2P。 +同日第二十九批追加 `protocolDriftSummary`:runner 会把 discovery errors 归一成 method 级失败探针,把官方文档跟进项固定展示为 `collaborationMode/list`、`thread/turns/list`、`ThreadItem.collabToolCall`,并把当前兜底策略显示为 Boss Broker + App Server 注入/执行。APP/后台只展示“协议漂移:兼容/告警 · 失败探针 N 个 · 文档跟进 N 项 · Boss Broker 兜底”,不展示错误原文、线程 ID、用户正文或内部 prompt。 + 除用于 Boss APP 会话反向同步的最终 `agentMessage` 安全摘要外,`thread/realtime/sdp`、音频 base64、原始 realtime item、remote installationId、thread settings 的 `cwd`、compaction `turnId`、collaboration settings 内部 prompt、collabToolCall 源/目标线程 ID、`receiverThreadIds`、`agentsStates.message`、共享 Skill 根绝对路径、hook key/command/sourcePath/statusMessage/hash/error message、tool arguments/result/contentItems、web URL token、命令正文/输出、raw reasoning `content`、reasoning item id、imageGeneration 原始 result/revisedPrompt、hook id/sourcePath/statusMessage/entries、Windows sandbox sourcePath/samplePaths、本地绝对路径、permission profile 文件规则、MCP resource URI、账号邮箱、API key、完整 config、外部 Agent 迁移描述、turn id、turn items、turn 内容、用户正文、原始模型输出和未清洗的 MCP 错误不入账。 官方文档入口:`https://developers.openai.com/codex/app-server` @@ -87,6 +89,7 @@ APP 展示结构对齐截图: - `实时状态`:展示 realtime 启动、同步、关闭或错误状态,附带安全清洗后的 transcript 预览和计数 - `线程配置`:展示 thread goal、模型 / provider、审批 / 沙箱、协作模式和上下文压缩状态 - `线程协作`:展示运行时兼容 `collabToolCall` 事件或 Boss Broker 协作摘要的工具名、执行状态、目标类型、目标数量和智能体状态集合,不展示源/目标线程 ID、`receiverThreadIds`、prompt 或 agent 私有消息;本机 schema 未声明该 item 时,APP 只显示 Boss 受控协作状态,不显示“原生线程互聊” +- `协议漂移`:展示 App Server discovery 的兼容/告警状态、失败探针数量、官方文档跟进项数量和 Boss Broker 兜底策略,不展示错误原文、线程 ID、用户正文或内部 prompt - `工具活动`:展示 MCP / dynamic tool / web search / image view / image generation / hook / Review / command 的类型、名称、状态和安全摘要,不展示参数、结果、URL token、命令正文、命令输出、图像生成原始 result/revised prompt 或 hook 原始输出 - `思考摘要`:展示 Codex 官方 reasoning `summary` 和状态,不展示 raw reasoning `content`、item id 或密钥 - `流式增量`:展示 agent 回复片段、计划片段、思考片段、MCP 进度、命令输出片段、终端交互和文件输出片段计数,不展示原始 delta、命令输出、推理正文或文件输出 @@ -144,6 +147,7 @@ UI 参考: - `local-agent/codex-app-server-runner.mjs` 已把 App Server `account/updated`、`account/rateLimits/updated`、`model/verification`、`warning`、`configWarning`、`deprecationNotice` 归一成 `executionProgress.accountStatus / modelVerification / warnings`;服务端进度路由和 Android 原生进度卡已支持展示,测试覆盖配置路径、turnId 和密钥不外泄 - `local-agent/codex-app-server-runner.mjs` 已把 App Server `ThreadItem.collabToolCall` 和 `ThreadItem.contextCompaction` 归一成 `executionProgress.threadCollaboration / compaction`;新版 `receiverThreadIds / agentsStates` 只归一为目标数量与 agent 状态集合;服务端进度路由和 Android 原生进度卡已支持展示,测试覆盖源/目标线程 ID、内部 prompt、agent 私有消息、turnId 和密钥不外泄 - `local-agent/codex-app-server-runner.mjs` 已新增 `threadCollaborationSummary` 能力摘要:当前 Boss Broker 和运行时 `collabToolCall` handler 可用,但本机 0.136.0-alpha.2 schema 没有声明 `ThreadItem.collabToolCall`,所以产品口径固定为“Boss 受控线程协作”,不承诺 Codex 原生线程私聊。 +- `local-agent/codex-app-server-runner.mjs` 已新增 `protocolDriftSummary` 协议漂移摘要:当前会输出 `driftLevel / failedProbeCount / runtimeFailureMethods / docFollowupItems / fallbackStrategy`,设备详情页展示“协议漂移”卡片;测试覆盖兼容态、文档跟进项和 Boss Broker 兜底文案。 - `local-agent/codex-app-server-runner.mjs` 已把 App Server `mcpToolCall`、`dynamicToolCall`、`webSearch`、`imageView`、`enteredReviewMode`、`exitedReviewMode`、`commandExecution` 归一成 `executionProgress.toolActivities`;服务端进度路由和 Android 原生进度卡已支持展示,测试覆盖 tool arguments/result、URL token、命令正文/输出、本地路径和密钥不外泄 - `local-agent/codex-app-server-runner.mjs` 已把 App Server `ThreadItem.plan` 与 `ThreadItem.reasoning.summary` 归一成 `executionProgress.steps / reasoningSummary`;服务端进度路由和 Android 原生进度卡已支持展示,测试覆盖 raw reasoning content、reasoning item id 和密钥不外泄 - `local-agent/codex-app-server-runner.mjs` 已把 App Server `ThreadItem.imageGeneration` 归一成 `executionProgress.toolActivities / artifacts`;服务端进度路由和 Android 原生进度卡已支持展示,测试覆盖 revisedPrompt、result、item id、本地绝对路径和密钥不外泄 @@ -168,6 +172,7 @@ UI 参考: - 新增 App Server Hook 治理 discovery:runner 会调用 `hooks/list` 并写入 `hookSummary`,设备详情页展示“Hook:N 个 · 启用 N 个 · 警告 N 个”;metadata 只保存计数、事件名和 handler 类型,不保存 hook key、command、sourcePath、statusMessage、hash、error message 或本地路径 - 新增 App Server 线程操作能力摘要:runner 写入 `threadActionSummary`,设备详情页展示“线程操作:N 项”;该字段只来自安全 catalog 和协议快照,不在 heartbeat 中调用任何会改变线程状态的 API,后续真正执行这些动作必须走用户显式指令、RBAC、审批和审计链路。 - 新增 App Server 线程协作口径摘要:runner 写入 `threadCollaborationSummary`,设备详情页展示“线程协作:Boss Broker 可用/不可用 · 协作事件可处理/不可处理 · N 种模式 · 原生私聊/非原生私聊”;该字段只来自当前 runner 能力、heartbeat discovery 和协议快照,不在 heartbeat 中向线程注入内容。 +- 新增 App Server 协议漂移摘要:runner 写入 `protocolDriftSummary`,设备详情页展示“协议漂移:兼容/告警 · 失败探针 N 个 · 文档跟进 N 项 · Boss Broker 兜底”;该字段只保留 method 级失败摘要和跟进项,不保存原始错误、线程 ID 或用户内容。 - 新增 App Server 插件治理能力摘要:runner 写入 `pluginGovernanceSummary`,设备详情页展示“插件治理:N 项”;该字段只来自安全 catalog 和协议快照,不在 heartbeat 中调用插件安装、卸载或共享 API,后续真正执行这些动作必须走用户显式指令、RBAC、审批和审计链路。 - 新增 App Server 账号与配置治理能力摘要:runner 写入 `accountGovernanceSummary / configGovernanceSummary`,设备详情页展示“账号治理 / 配置治理”;这些字段只来自安全 catalog 和协议快照,不在 heartbeat 中调用账号登录、退出、令牌刷新、配置写入、MCP 重载或 Skill config 写入 API,后续真正执行这些动作必须走用户显式指令、RBAC、审批和审计链路。 - 新增 App Server 文件系统与命令会话治理能力摘要:runner 写入 `fileSystemGovernanceSummary / commandSessionSummary`,设备详情页展示“文件治理 / 命令会话”;这些字段只来自安全 catalog 和协议快照,不在 heartbeat 中调用文件读写、删除、监听、stdin 写入、PTY resize 或 terminate API,后续真正执行这些动作必须走用户显式指令、RBAC、审批、租约和审计链路。 diff --git a/docs/architecture/current_runtime_and_deploy_status_cn.md b/docs/architecture/current_runtime_and_deploy_status_cn.md index 70ddc8c..ee708db 100644 --- a/docs/architecture/current_runtime_and_deploy_status_cn.md +++ b/docs/architecture/current_runtime_and_deploy_status_cn.md @@ -1,6 +1,6 @@ # Boss 当前运行与部署状态 -更新时间:`2026-06-03` +更新时间:`2026-06-04` ## 1. 本地状态 @@ -44,6 +44,7 @@ - 当前 App Server discovery 还会把最终 `agentMessage` 合并进 heartbeat `projectCandidates.recentAssistantMessages`。服务端已有 `codexThreadRef` 匹配时会把 Codex Desktop 自己产生的新回复反向同步到 Boss APP 对应会话,并刷新 preview、lastMessageAt 和未读数;已有本地扫描候选的 folder/thread 映射优先保留,App Server 只补充最新回复摘要。 - 当前 App Server 能力发现已新增线程操作能力摘要:local-agent 会把已验证进入当前协议快照的 archive / unarchive / fork / compact / rollback / rename / metadata / steer / interrupt / shell / unsubscribe 写入设备 `codexAppServer.metadata.threadActionSummary`;设备详情页会显示“线程操作”。该字段只读,不在 heartbeat 中调用任何线程写 API。 - 当前 App Server 能力发现已新增线程协作口径摘要:local-agent 会写入 `codexAppServer.metadata.threadCollaborationSummary`;设备详情页会显示 Boss Broker 可用性、协作事件 handler 可用性、协作模式数量和“非原生私聊”状态。该字段用于提醒产品和运维:当前可做的是 Boss 受控线程协作,不是 Codex 原生线程互聊。 +- 当前 App Server 能力发现已新增协议漂移摘要:local-agent 会写入 `codexAppServer.metadata.protocolDriftSummary`;设备详情页会显示“协议漂移:兼容/告警 · 失败探针 N 个 · 文档跟进 N 项 · Boss Broker 兜底”。该字段把运行时 discovery 失败 method、官方文档跟进项和当前兜底策略拆开展示,避免 Codex Server 更新后只靠原始日志判断协议是否漂移。 - 当前 App Server 能力发现已新增插件治理能力摘要:local-agent 会把已验证进入当前协议快照的 install / uninstall / read / skill-read / share 写入设备 `codexAppServer.metadata.pluginGovernanceSummary`;设备详情页会显示“插件治理”。该字段只读,不在 heartbeat 中调用任何插件写 API。 - 当前 App Server 能力发现已新增账号与配置治理能力摘要:local-agent 会把已验证进入当前协议快照的 login / logout / token refresh / add credits nudge / config write / MCP reload / Skill config write 写入设备 `codexAppServer.metadata.accountGovernanceSummary / configGovernanceSummary`;设备详情页会显示“账号治理 / 配置治理”。这些字段只读,不在 heartbeat 中调用任何账号或配置写 API。 - 当前 App Server 能力发现已新增文件系统与命令会话治理能力摘要:local-agent 会把已验证进入当前协议快照的文件读写、目录、元数据、复制、删除、监听、命令 stdin、PTY resize、terminate 和输出流能力写入设备 `codexAppServer.metadata.fileSystemGovernanceSummary / commandSessionSummary`;设备详情页会显示“文件治理 / 命令会话”。这些字段只读,不在 heartbeat 中调用任何文件或命令控制 API。 diff --git a/local-agent/codex-app-server-runner.mjs b/local-agent/codex-app-server-runner.mjs index 9719608..c6cdd84 100644 --- a/local-agent/codex-app-server-runner.mjs +++ b/local-agent/codex-app-server-runner.mjs @@ -1400,6 +1400,35 @@ function normalizeDiscoveryThreadCollaborationSummary(collaborationModes) { }; } +const CODEX_APP_SERVER_DOC_FOLLOWUP_ITEMS = [ + "collaborationMode/list", + "thread/turns/list", + "ThreadItem.collabToolCall", +]; + +function discoveryMethodFromError(errorText) { + const text = typeof errorText === "string" ? errorText.trim() : ""; + if (!text) return ""; + return text.split(":")[0] || ""; +} + +function normalizeDiscoveryProtocolDriftSummary(errors) { + const runtimeFailureMethods = Array.from( + new Set(asArray(errors).map(discoveryMethodFromError).filter(Boolean)), + ).slice(0, 12); + return { + driftLevel: runtimeFailureMethods.length > 0 ? "warning" : "compatible", + compatibilityMode: "runtime-probe", + failedProbeCount: runtimeFailureMethods.length, + runtimeFailureMethods, + docFollowupCount: CODEX_APP_SERVER_DOC_FOLLOWUP_ITEMS.length, + docFollowupItems: CODEX_APP_SERVER_DOC_FOLLOWUP_ITEMS, + fallbackStrategy: "Boss Broker + App Server 注入/执行", + userInitiatedOnly: true, + labels: ["运行时探测", "官方文档跟进", "Boss Broker 兜底"], + }; +} + function normalizeDiscoveryPluginGovernanceSummary() { const actions = [ { label: "安装", group: "lifecycle" }, @@ -2216,6 +2245,51 @@ export async function discoverCodexAppServerCapabilities(runnerConfig) { }), })), ); + const discoveryErrors = [ + modelResult?.__bossError ? `model/list:${safeRuntimeDiagnosticText(modelResult.__bossError)}` : undefined, + providerCapabilities?.__bossError + ? `modelProvider/capabilities/read:${safeRuntimeDiagnosticText(providerCapabilities.__bossError)}` + : undefined, + skillsResult?.__bossError ? `skills/list:${safeRuntimeDiagnosticText(skillsResult.__bossError)}` : undefined, + skillExtraRootsResult?.__bossError + ? `skills/extraRoots/set:${safeRuntimeDiagnosticText(skillExtraRootsResult.__bossError)}` + : undefined, + hooksResult?.__bossError ? `hooks/list:${safeRuntimeDiagnosticText(hooksResult.__bossError)}` : undefined, + pluginResult?.__bossError ? `plugin/list:${safeRuntimeDiagnosticText(pluginResult.__bossError)}` : undefined, + appsResult?.__bossError ? `app/list:${safeRuntimeDiagnosticText(appsResult.__bossError)}` : undefined, + experimentalFeaturesResult?.__bossError + ? `experimentalFeature/list:${safeRuntimeDiagnosticText(experimentalFeaturesResult.__bossError)}` + : undefined, + collaborationModesResult?.__bossError + ? `collaborationMode/list:${safeRuntimeDiagnosticText(collaborationModesResult.__bossError)}` + : undefined, + permissionProfilesResult?.__bossError + ? `permissionProfile/list:${safeRuntimeDiagnosticText(permissionProfilesResult.__bossError)}` + : undefined, + mcpServersResult?.__bossError + ? `mcpServerStatus/list:${safeRuntimeDiagnosticText(mcpServersResult.__bossError)}` + : undefined, + accountResult?.__bossError ? `account/read:${safeRuntimeDiagnosticText(accountResult.__bossError)}` : undefined, + rateLimitsResult?.__bossError + ? `account/rateLimits/read:${safeRuntimeDiagnosticText(rateLimitsResult.__bossError)}` + : undefined, + configResult?.__bossError ? `config/read:${safeRuntimeDiagnosticText(configResult.__bossError)}` : undefined, + configRequirementsResult?.__bossError + ? `configRequirements/read:${safeRuntimeDiagnosticText(configRequirementsResult.__bossError)}` + : undefined, + externalAgentConfigResult?.__bossError + ? `externalAgentConfig/detect:${safeRuntimeDiagnosticText(externalAgentConfigResult.__bossError)}` + : undefined, + threadListResult?.__bossError + ? `thread/list:${safeRuntimeDiagnosticText(threadListResult.__bossError)}` + : undefined, + loadedThreadsResult?.__bossError + ? `thread/loaded/list:${safeRuntimeDiagnosticText(loadedThreadsResult.__bossError)}` + : undefined, + ...threadTurnResults + .filter((entry) => entry.result?.__bossError) + .map((entry) => `thread/turns/list:${entry.threadId}:${safeRuntimeDiagnosticText(entry.result.__bossError)}`), + ].filter(Boolean); return { version: trimToDefined(runnerConfig.version), @@ -2249,6 +2323,7 @@ export async function discoverCodexAppServerCapabilities(runnerConfig) { threadCollaborationSummary: normalizeDiscoveryThreadCollaborationSummary( normalizeDiscoveryCollaborationModes(collaborationModesResult), ), + protocolDriftSummary: normalizeDiscoveryProtocolDriftSummary(discoveryErrors), pluginGovernanceSummary: normalizeDiscoveryPluginGovernanceSummary(), accountGovernanceSummary: normalizeDiscoveryAccountGovernanceSummary(), configGovernanceSummary: normalizeDiscoveryConfigGovernanceSummary(), @@ -2267,51 +2342,7 @@ export async function discoverCodexAppServerCapabilities(runnerConfig) { extensionEventSummary: normalizeDiscoveryExtensionEventSummary(), threadLifecycleEventSummary: normalizeDiscoveryThreadLifecycleEventSummary(), streamDeltaEventSummary: normalizeDiscoveryStreamDeltaEventSummary(), - errors: [ - modelResult?.__bossError ? `model/list:${safeRuntimeDiagnosticText(modelResult.__bossError)}` : undefined, - providerCapabilities?.__bossError - ? `modelProvider/capabilities/read:${safeRuntimeDiagnosticText(providerCapabilities.__bossError)}` - : undefined, - skillsResult?.__bossError ? `skills/list:${safeRuntimeDiagnosticText(skillsResult.__bossError)}` : undefined, - skillExtraRootsResult?.__bossError - ? `skills/extraRoots/set:${safeRuntimeDiagnosticText(skillExtraRootsResult.__bossError)}` - : undefined, - hooksResult?.__bossError ? `hooks/list:${safeRuntimeDiagnosticText(hooksResult.__bossError)}` : undefined, - pluginResult?.__bossError ? `plugin/list:${safeRuntimeDiagnosticText(pluginResult.__bossError)}` : undefined, - appsResult?.__bossError ? `app/list:${safeRuntimeDiagnosticText(appsResult.__bossError)}` : undefined, - experimentalFeaturesResult?.__bossError - ? `experimentalFeature/list:${safeRuntimeDiagnosticText(experimentalFeaturesResult.__bossError)}` - : undefined, - collaborationModesResult?.__bossError - ? `collaborationMode/list:${safeRuntimeDiagnosticText(collaborationModesResult.__bossError)}` - : undefined, - permissionProfilesResult?.__bossError - ? `permissionProfile/list:${safeRuntimeDiagnosticText(permissionProfilesResult.__bossError)}` - : undefined, - mcpServersResult?.__bossError - ? `mcpServerStatus/list:${safeRuntimeDiagnosticText(mcpServersResult.__bossError)}` - : undefined, - accountResult?.__bossError ? `account/read:${safeRuntimeDiagnosticText(accountResult.__bossError)}` : undefined, - rateLimitsResult?.__bossError - ? `account/rateLimits/read:${safeRuntimeDiagnosticText(rateLimitsResult.__bossError)}` - : undefined, - configResult?.__bossError ? `config/read:${safeRuntimeDiagnosticText(configResult.__bossError)}` : undefined, - configRequirementsResult?.__bossError - ? `configRequirements/read:${safeRuntimeDiagnosticText(configRequirementsResult.__bossError)}` - : undefined, - externalAgentConfigResult?.__bossError - ? `externalAgentConfig/detect:${safeRuntimeDiagnosticText(externalAgentConfigResult.__bossError)}` - : undefined, - threadListResult?.__bossError - ? `thread/list:${safeRuntimeDiagnosticText(threadListResult.__bossError)}` - : undefined, - loadedThreadsResult?.__bossError - ? `thread/loaded/list:${safeRuntimeDiagnosticText(loadedThreadsResult.__bossError)}` - : undefined, - ...threadTurnResults - .filter((entry) => entry.result?.__bossError) - .map((entry) => `thread/turns/list:${entry.threadId}:${safeRuntimeDiagnosticText(entry.result.__bossError)}`), - ].filter(Boolean), + errors: discoveryErrors, }; }); } diff --git a/src/components/app-ui.tsx b/src/components/app-ui.tsx index faedf51..e7d71b3 100644 --- a/src/components/app-ui.tsx +++ b/src/components/app-ui.tsx @@ -127,6 +127,7 @@ export function buildDeviceWorkspaceDetailCards(workspace: DeviceWorkspaceView) const codexThreadCollaborationSummary = objectFromMetadata( codexAppServerMetadata.threadCollaborationSummary, ); + const codexProtocolDriftSummary = objectFromMetadata(codexAppServerMetadata.protocolDriftSummary); const codexPluginGovernanceSummary = objectFromMetadata(codexAppServerMetadata.pluginGovernanceSummary); const codexAccountGovernanceSummary = objectFromMetadata(codexAppServerMetadata.accountGovernanceSummary); const codexConfigGovernanceSummary = objectFromMetadata(codexAppServerMetadata.configGovernanceSummary); @@ -221,6 +222,15 @@ export function buildDeviceWorkspaceDetailCards(workspace: DeviceWorkspaceView) } · ${numberFromMetadata(codexThreadCollaborationSummary.collaborationModeCount)} 种模式 · ${ codexThreadCollaborationSummary.directThreadChatSupported === true ? "原生私聊" : "非原生私聊" }`, + codexProtocolDrift: `协议漂移:${ + textFromMetadata(codexProtocolDriftSummary.driftLevel) === "compatible" ? "兼容" : "告警" + } · 失败探针 ${numberFromMetadata(codexProtocolDriftSummary.failedProbeCount)} 个 · 文档跟进 ${numberFromMetadata( + codexProtocolDriftSummary.docFollowupCount, + )} 项 · ${ + String(codexProtocolDriftSummary.fallbackStrategy || "").includes("Boss Broker") + ? "Boss Broker 兜底" + : "无兜底策略" + }`, codexPluginGovernance: `插件治理:${numberFromMetadata( codexPluginGovernanceSummary.actionCount, )} 项 · 安装/卸载 ${numberFromMetadata(codexPluginGovernanceSummary.lifecycleActionCount)} 项 · 共享 ${numberFromMetadata( @@ -971,6 +981,9 @@ export function DeviceEditorCard({