feat: expose codex account config governance

This commit is contained in:
AI Bot
2026-06-03 11:36:44 +08:00
parent ca92133019
commit 21e514a895
12 changed files with 153 additions and 7 deletions

View File

@@ -20,7 +20,7 @@ Boss 不能直接把 App Server 原始 Thread / Turn / Item 字段写进业务
2026-05-31 已继续把 `turn/plan/updated``turn/diff/updated``item/started|completed``thread/started` 这类协议事件归一化为 Boss `execution_progress` 的步骤、分支变更、产物和后台智能体。同日第二批补齐 `item/*/requestApproval``item/autoApprovalReview/*``guardianWarning``serverRequest/resolved``item/fileChange/patchUpdated` 的安全摘要映射APP 只展示审批状态、风险提醒和文件路径不展示完整命令、diff、系统提示词或密钥。第三批已把 `thread/status/changed``thread/realtime/*` 归一成 `executionProgress.threadStatus / realtime`APP 只展示活跃/等待审批/等待用户输入、realtime 文本摘要、音频片段计数和关闭/错误原因;第四批已把 `model/rerouted``thread/tokenUsage/updated``mcpServer/startupStatus/updated``remoteControl/status/changed` 归一成 `executionProgress.modelRoute / tokenUsage / mcpServers / remoteControl`,用于 APP “运行状态”区块。
2026-06-01 第五批已把 `thread/goal/updated|cleared``thread/settings/updated``thread/compacted` 归一成 `executionProgress.threadGoal / threadSettings / compaction`,用于 APP “线程配置”区块;第六批已把 `account/updated``account/rateLimits/updated``model/verification``warning``configWarning``deprecationNotice` 归一成 `executionProgress.accountStatus / modelVerification / warnings`;第七批已把官方 `ThreadItem.collabToolCall` 归一成 `executionProgress.threadCollaboration`,并按官方建议把新版 `ThreadItem.contextCompaction` 映射回 `executionProgress.compaction`;第八批已把 `mcpToolCall``dynamicToolCall``webSearch``imageView``enteredReviewMode``exitedReviewMode``commandExecution` 归一成 `executionProgress.toolActivities`;第九批已把官方 `ThreadItem.plan` 的最终 `item/completed` 文本映射为 `executionProgress.steps`,并把 `ThreadItem.reasoning.summary` 映射为 `executionProgress.reasoningSummary`;第十批已把 `ThreadItem.imageGeneration` 安全映射为 `executionProgress.toolActivities` 的图像生成活动和 `executionProgress.artifacts` 的图片产物;第十一批已把 `hook/started|completed` 安全映射为 `executionProgress.toolActivities` 的钩子活动,供 APP 以“钩子”轻卡展示企业治理和插件生命周期状态;第十二批已把 `windowsSandbox/setupCompleted` 安全映射为 `executionProgress.windowsSandbox`,供 APP 在“运行状态”里展示 Windows 沙箱准备状态、setup mode 和脱敏错误摘要;第十三批已把 heartbeat discovery 扩展到 `experimentalFeature/list``collaborationMode/list``permissionProfile/list``mcpServerStatus/list`供设备详情、APP 和 PC 后台看到实验特性、协作模式、权限 Profile 与 MCP 服务摘要;第十四批已把 `account/read``account/rateLimits/read``config/read``configRequirements/read``externalAgentConfig/detect` 纳入 heartbeat discovery用于展示账号、套餐、额度、App 配置、托管要求和外部 Agent 迁移候选摘要;第十五批已把 `thread/list``thread/loaded/list` 纳入 heartbeat discovery用于展示线程总数、已加载线程、活跃线程、归档线程和非归档可见线程轻量目录第十六批已把 `thread/turns/list` 纳入 heartbeat discovery用于展示总轮次、运行中轮次、完成轮次和每个非归档线程的最近 turn 状态摘要;第十七批已按 `codex-cli 0.136.0-alpha.2` 补齐 `skills/extraRoots/set`,支持把企业共享 Skill 根下发给 App Server 后再拉取 `skills/list`,并把新版 `ThreadItem.collabToolCall.receiverThreadIds / agentsStates` 安全映射成目标数量和 agent 状态集合;第十八批已把 `hooks/list` 纳入 heartbeat discovery用于展示本机 Codex hook 数、启用数、信任状态和 warning/error 计数;第十九批已新增线程操作能力摘要,用于展示 `thread/archive / thread/unarchive / thread/fork / thread/compact/start / thread/rollback / thread/name/set / thread/metadata/update / thread/shellCommand / thread/unsubscribe / turn/interrupt / turn/steer` 这类动作是否进入 Boss 受控能力目录;第二十批已新增插件治理能力摘要,用于展示 `plugin/install / plugin/uninstall / plugin/read / plugin/skill/read / plugin/share/*` 这类动作是否进入 Boss 受控能力目录。
2026-06-01 第五批已把 `thread/goal/updated|cleared``thread/settings/updated``thread/compacted` 归一成 `executionProgress.threadGoal / threadSettings / compaction`,用于 APP “线程配置”区块;第六批已把 `account/updated``account/rateLimits/updated``model/verification``warning``configWarning``deprecationNotice` 归一成 `executionProgress.accountStatus / modelVerification / warnings`;第七批已把官方 `ThreadItem.collabToolCall` 归一成 `executionProgress.threadCollaboration`,并按官方建议把新版 `ThreadItem.contextCompaction` 映射回 `executionProgress.compaction`;第八批已把 `mcpToolCall``dynamicToolCall``webSearch``imageView``enteredReviewMode``exitedReviewMode``commandExecution` 归一成 `executionProgress.toolActivities`;第九批已把官方 `ThreadItem.plan` 的最终 `item/completed` 文本映射为 `executionProgress.steps`,并把 `ThreadItem.reasoning.summary` 映射为 `executionProgress.reasoningSummary`;第十批已把 `ThreadItem.imageGeneration` 安全映射为 `executionProgress.toolActivities` 的图像生成活动和 `executionProgress.artifacts` 的图片产物;第十一批已把 `hook/started|completed` 安全映射为 `executionProgress.toolActivities` 的钩子活动,供 APP 以“钩子”轻卡展示企业治理和插件生命周期状态;第十二批已把 `windowsSandbox/setupCompleted` 安全映射为 `executionProgress.windowsSandbox`,供 APP 在“运行状态”里展示 Windows 沙箱准备状态、setup mode 和脱敏错误摘要;第十三批已把 heartbeat discovery 扩展到 `experimentalFeature/list``collaborationMode/list``permissionProfile/list``mcpServerStatus/list`供设备详情、APP 和 PC 后台看到实验特性、协作模式、权限 Profile 与 MCP 服务摘要;第十四批已把 `account/read``account/rateLimits/read``config/read``configRequirements/read``externalAgentConfig/detect` 纳入 heartbeat discovery用于展示账号、套餐、额度、App 配置、托管要求和外部 Agent 迁移候选摘要;第十五批已把 `thread/list``thread/loaded/list` 纳入 heartbeat discovery用于展示线程总数、已加载线程、活跃线程、归档线程和非归档可见线程轻量目录第十六批已把 `thread/turns/list` 纳入 heartbeat discovery用于展示总轮次、运行中轮次、完成轮次和每个非归档线程的最近 turn 状态摘要;第十七批已按 `codex-cli 0.136.0-alpha.2` 补齐 `skills/extraRoots/set`,支持把企业共享 Skill 根下发给 App Server 后再拉取 `skills/list`,并把新版 `ThreadItem.collabToolCall.receiverThreadIds / agentsStates` 安全映射成目标数量和 agent 状态集合;第十八批已把 `hooks/list` 纳入 heartbeat discovery用于展示本机 Codex hook 数、启用数、信任状态和 warning/error 计数;第十九批已新增线程操作能力摘要,用于展示 `thread/archive / thread/unarchive / thread/fork / thread/compact/start / thread/rollback / thread/name/set / thread/metadata/update / thread/shellCommand / thread/unsubscribe / turn/interrupt / turn/steer` 这类动作是否进入 Boss 受控能力目录;第二十批已新增插件治理能力摘要,用于展示 `plugin/install / plugin/uninstall / plugin/read / plugin/skill/read / plugin/share/*` 这类动作是否进入 Boss 受控能力目录;第二十一批已新增账号与配置治理能力摘要,用于展示 `account/login/* / account/logout / account/chatgptAuthTokens/refresh / account/sendAddCreditsNudgeEmail / config/value/write / config/batchWrite / config/mcpServer/reload / skills/config/write` 这类动作是否进入 Boss 受控能力目录。
`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 错误不入账。
@@ -41,7 +41,7 @@ Boss 不能直接把 App Server 原始 Thread / Turn / Item 字段写进业务
- 本机 `codex --version``codex-cli 0.136.0-alpha.2`
- 本机 `codex app-server --help` 已可用;本机 help 当前显示 `--listen` 支持 `stdio://``unix://``unix://PATH``ws://IP:PORT``off`
- 本机 `codex app-server --help` 当前已经支持 `--ws-auth capability-token|signed-bearer-token``--ws-token-file``--ws-token-sha256``--ws-shared-secret-file`、issuer/audience/clock-skew 等 WebSocket 认证参数
- 本机协议快照已生成到 `docs/protocol-snapshots/codex-app-server/0.136.0-alpha.2/`,共识别 138 个协议方法;确认支持 `thread/inject_items``thread/rollback``thread/archive``thread/unarchive``thread/fork``thread/compact/start``thread/name/set``thread/metadata/update``thread/shellCommand``thread/unsubscribe``thread/goal/*``turn/steer``turn/interrupt``command/exec``thread/realtime/*``account/*``model/verification``configWarning``deprecationNotice``model/list``skills/extraRoots/set``hooks/list``plugin/install``plugin/uninstall``plugin/read``plugin/skill/read``plugin/share/*`
- 本机协议快照已生成到 `docs/protocol-snapshots/codex-app-server/0.136.0-alpha.2/`,共识别 138 个协议方法;确认支持 `thread/inject_items``thread/rollback``thread/archive``thread/unarchive``thread/fork``thread/compact/start``thread/name/set``thread/metadata/update``thread/shellCommand``thread/unsubscribe``thread/goal/*``turn/steer``turn/interrupt``command/exec``thread/realtime/*``account/*``model/verification``configWarning``deprecationNotice``model/list``skills/extraRoots/set``hooks/list``plugin/install``plugin/uninstall``plugin/read``plugin/skill/read``plugin/share/*``config/value/write``config/batchWrite``config/mcpServer/reload``skills/config/write`
- Boss 当前默认仍以 `stdio` 作为本机 agent 接入方式;`ws://127.0.0.1:<port>``unix://PATH` 本地长驻 transport 已可灰度接入WebSocket/Unix WebSocket handshake 支持 `Authorization: Bearer <token>`;非 loopback signed bearer/JWT、自动重连和健康探测仍保留为后续增强不直接替换当前稳定链路
- 官方文档提示 WebSocket ingress 满载时会返回 JSON-RPC `-32001 / Server overloaded; retry later.`Boss runner 已对该错误做最多 3 次指数退避重试,避免长驻连接瞬时拥塞直接把用户任务打失败
- Boss heartbeat 已新增 App Server 能力发现缓存:按 `codexAppServerDiscoveryTtlMs` 拉取 `model/list``modelProvider/capabilities/read``skills/list``hooks/list``plugin/list``app/list``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`;配置了 `codexAppServerSkillExtraRoots` / `BOSS_CODEX_APP_SERVER_SKILL_EXTRA_ROOTS` 时,会先调用 `skills/extraRoots/set` 再拉取 `skills/list`,归一成设备 `capabilities.codexAppServer.metadata`;发现失败只记录 warn不阻塞心跳。MCP discovery 使用 `detail=toolsAndAuthOnly`turn discovery 固定 `itemsView=notLoaded`账号、配置、线程、Hook 和 Skill extra root discovery 只保留安全摘要不保存邮箱、resource URI、工具参数、完整 config、本地路径、迁移描述、turn id、turn items、用户正文、模型输出、hook 命令或共享 Skill 根绝对路径。
@@ -153,6 +153,7 @@ UI 参考:
- 新增 App Server Hook 治理 discoveryrunner 会调用 `hooks/list` 并写入 `hookSummary`设备详情页展示“HookN 个 · 启用 N 个 · 警告 N 个”metadata 只保存计数、事件名和 handler 类型,不保存 hook key、command、sourcePath、statusMessage、hash、error message 或本地路径
- 新增 App Server 线程操作能力摘要runner 写入 `threadActionSummary`设备详情页展示“线程操作N 项”;该字段只来自安全 catalog 和协议快照,不在 heartbeat 中调用任何会改变线程状态的 API后续真正执行这些动作必须走用户显式指令、RBAC、审批和审计链路。
- 新增 App Server 插件治理能力摘要runner 写入 `pluginGovernanceSummary`设备详情页展示“插件治理N 项”;该字段只来自安全 catalog 和协议快照,不在 heartbeat 中调用插件安装、卸载或共享 API后续真正执行这些动作必须走用户显式指令、RBAC、审批和审计链路。
- 新增 App Server 账号与配置治理能力摘要runner 写入 `accountGovernanceSummary / configGovernanceSummary`,设备详情页展示“账号治理 / 配置治理”;这些字段只来自安全 catalog 和协议快照,不在 heartbeat 中调用账号登录、退出、令牌刷新、配置写入、MCP 重载或 Skill config 写入 API后续真正执行这些动作必须走用户显式指令、RBAC、审批和审计链路。
后续建议按两步继续: