Conversation
tt-a1i
left a comment
There was a problem hiding this comment.
审查提交:da4a4faa2ea61d4905150b4cd3b4aa2e3ca26916。
需要修改后再合并。
具体问题
P1 — 配置诊断 schema 未纳入 main 已发布的三个 Web UI 字段 · extensions/shared/setup-config.ts:580
setupShape lacks webChatWidth/webChatFontSize/webExpandThinking while current main canonical config contains them. preserveUnknown treats omitted schema keys as raw unknown values, so mechanical conflict resolution cannot safely validate/persist changes.
验证范围
Reviewed versioning, diagnostics, exact-byte/identity rollback, async consumer receipts and unknown-field preservation; focused config/setup/apply suite completed. Existing exact-head integration finding remains.
限制与后续
Branch conflicts with main; no conflict-resolved tree exists. Finding is an integration blocker, not a claim that a merged build was executed.
Add versioned fail-closed configuration loading, preserve unknown fields, and report load diagnostics through the existing setup entry point and session notifications. Await consumer apply receipts and restore prior configuration on failure. Clarify explicit invalid values and effective-change receipts with regression coverage.
da4a4fa to
d45443f
Compare
The Node phases consumed 265 seconds of the 300-second step budget, leaving too little time for Vitest. Raise the full-suite step limit to 10 minutes while retaining individual test deadlines and the 15-minute job limit.
|
@tt-a1i 之前提出的问题和合并冲突都已修复,CI 也已全部通过,麻烦有空时再帮忙 review 一下,谢谢! |
tt-a1i
left a comment
There was a problem hiding this comment.
复审提交 07610dcf65df33cce5602c83c67ed55ed431afe8。
此前指出的配置 schema 缺漏已修复:ui.webChatWidth、ui.webChatFontSize、ui.webExpandThinking 已进入校验与默认值,新增测试覆盖合法边界、拒绝非法值、保存和失败回滚。当前 PR 的远端检查全部通过;我本地专项测试首次 64/65,其中真实 Pi 集成用例触发既有 8 秒超时,单独复跑通过。
仍需修改:与当前 main(6132d997)合并时,extensions/post-edit/index.ts 有内容冲突。main 已将待运行任务改成队列(pendingRuns.length = 0),此分支仍有旧的计数器清理逻辑(pendingRuns = 0),同时新增 onSetupApply 配置重载。解决冲突时需要保留当前队列/同步屏障,并确保关闭 post-edit 后清空待运行队列;不能直接接受分支一侧的旧实现。请解决冲突后在合并结果上重跑相关测试。当前绿灯仅覆盖此 PR 分支,不能证明冲突解决后的代码。
Problem
配置加载失败会静默回退默认值,用户难以区分缺文件、损坏文件及不支持的配置;保存也缺少未知字段保留和当前 Session 应用失败后的恢复保障。
Closes #498
Value
让用户看见配置加载问题,避免普通 setup 操作覆盖无效配置或丢失未知字段。当前 Session 的配置消费者确认应用成功后才报告成功;失败时尝试恢复原文件和配置,并明确报告恢复不完整。
Approach
configVersion: 1和字段校验。缺文件使用默认值;无版本配置仅在明确保存时迁移;JSON、IO、版本或已知字段错误阻止写入。未知字段告警并保留,会导致未知字段丢失的修改被拒绝。/openpi-setup显示来源、版本、字段诊断和写入状态。有 UI 的 Session 启动或重载时主动提示加载错误或警告,详情仍留在原入口;不自动写文件或调用模型。compact预设和footerStyle枚举;提示词要求显式非法字段值先说明合法范围并等待用户选择,禁止擅自替换。运行时拒绝非法 Footer 样式或预设。f991f9e,解决 setup 导入冲突,并将 feat(web): complete session workbar and settings experience #561 的三个 Web 字段纳入 schema:ui.webChatWidth(820–2000 的整数)、ui.webChatFontSize(12–24 的整数)、ui.webExpandThinking(布尔值)。复用上游范围常量,避免把合法字段当作未知字段、保存时被旧值覆盖。Validation
d45443f,上游基线为f991f9e。bun run check全部通过(配置/文档合同、构建、格式、lint、类型检查);git diff --check upstream/main通过。node --test --experimental-strip-types tests/extensions/shared/setup-config.test.ts tests/extensions/shared/setup-apply.test.ts tests/extensions/setup/index.test.ts tests/extensions/setup/integration.test.ts,65/65 通过。最初一次运行的集成测试触发 8 秒超时;后续全量和专项复跑均通过,保留为间歇性超时记录。bun run test在允许本地测试端口的环境下运行:Node 部分 1776 通过、2 失败、1 跳过(共 1779 项)。两个失败均为 Plan Mode 的a rich plan renders without throwing and keeps its content、expanded survives edge-content plans at extreme widths,已在未修改上游f991f9e和相同安装依赖下复现(22 通过、2 失败)。测试辅助函数未去除 OSC 8 超链接控制符;本 PR 未修改 Plan Mode,未将全量测试标为通过。.spec.ts文件(--maxWorkers=2):291 通过、2 失败。失败分别为 Web settings 的 5 秒超时和 composer 焦点断言;原样单独复跑这两个文件(--maxWorkers=1)13/13 通过,未调整测试断言或超时。ui.footerStyle="compact"和workflows.concurrency=0请求会解释合法范围并询问,选择保持现状后不调用写入工具。这是此前版本的人工验收,本次 rebase 未重新做真实 TUI 目视验收;没有安装或运行社区 statusline 包。Impact