fix(app): show all agents when configuring execution intervals - #5186
Conversation
Signed-off-by: huangruiteng <14976749+huangruiteng@users.noreply.github.com>
huangruiteng
left a comment
There was a problem hiding this comment.
Approval conclusion (author-owned PR; GitHub blocks formal self-approval)
Reviewed exact head: 4373965
Baseline: d23f1c8
动机
这包解决的是配置执行间隔时“目标 Agent 不够显式、候选不容易完整选择”的用户路径。此前设置页默认 Goal scope,Agent 输入框又预填近期第一条 lane;datalist 只是建议列表,不能清楚表达完整注册候选与当前选择。用户本想改一个 Agent,却可能停留在 Goal 默认配置;只检查最近有活动的两条 lane,也会漏掉已经注册但空闲的 Agent。
我以 automatic-execution-admission RFC 的 M3 配置入口 和既有 cadence scoped override 契约判断本 PR,不把 UI 配置成功误称为实际 Codex App timer 或 pre-model admission 已经交付。
改动思路
直接复用 WorkspaceGoal.agentLanes 的既有完整注册投影和 inspect/preview/apply API,不新增 registry 或 Python policy owner。入口改为 Agent scope 的空选择,使用原生 select 展示全部候选;scopeReady 要求 id 属于注册列表,automation scope 还需明确 automation id。显式空数组保留为“没有候选”,与老 DTO 缺失 agentLanes 时的兼容 fallback 区分。
选择并不授予执行或配置权限:后端仍由 TypeScript manageAutomationCadence 校验 owner reason、configuration revision、preview revision 和 reduction approval。Goal 范围仍可主动选择;0-clear、继承下限与 timer 未接入的提示保持原有含义。
具体改动
8 个文件 +97/-25:现有组件/Goal key、三条中英文提示、原生 select 的 CSS、浏览器 smoke、真实 HTTP 回归及双语 M3 checkpoint。生产部分只有 +19/-16,没有新增 API、CLI 参数或持久字段,也没有提交构建产物。Goal key 让换 Goal 的本地编辑状态重新建立;输入或目标变化会清掉旧 preview。
关键代码讲解
- apps/presentation/dashboard/src/features/personal-workspace/automation-cadence-settings.tsx:13,AutomationCadenceSettings:空 Agent 初态、完整 agentLanes 和 scopeReady 放在同一组件,未选/未注册/明确空列表时不查询 cadence;load effect 的 active cleanup 不接纳旧 scope 的加载结果。
- apps/presentation/dashboard/src/features/personal-workspace/automation-cadence-settings.tsx:71,createPreview:change() 仍带实际 goal/agent/automation identity、reason 和当前 configuration revision;preview 不写配置,修改目标后必须重做。
- apps/presentation/dashboard/src/features/personal-workspace/automation-cadence-settings.tsx:80,apply:同时要求当前 payload 和 preview_revision,沿用 server CAS/reduction 约束;读回后更新 inspection,按 readback_verified 给出准确反馈,失败清空 preview。
- apps/presentation/dashboard/src/features/personal-workspace/workspace-settings-page.tsx:202,cadence-tab keyed mount:key 是 selectedGoal.goalId,换 Goal 时退休旧本地选择/preview,并不新增另一套 Goal 或 Agent 生命周期。
正向路径是打开设置 → 明确选 registered Agent → 读现有直接/继承 floor → 给 reason → preview → apply → 单独读回。独立浏览器 fixture 有 103 个注册 Agent(101 个 idle),idle-100 实际可选,反转候选顺序也不自动选任何人。真实 HTTP 写 agent-a=120 后,peer agent-b 和 Goal default 分别读回 60,说明 UI 改动没有变成 blanket override。
负向路径覆盖显式空列表、注入未注册 option、切换已 preview 的目标、过期 revision 和未经批准的 reduction。空/未知目标没有 cadence 请求;重新选择 registered idle-100 后合法 GET 恢复。切换目标清空 preview/禁用旧 apply;真实 HTTP 仍分别返回 409 stale conflict 和 400 reduction refusal。清除直接规则后仍恢复继承 floor。
语义对齐
复用既有 registered-agent projection、cadence DTO 和 TypeScript policy owner。默认 UI 从 Goal 改成空 Agent 选择是有意的行为变化,双语 M3 checkpoint、选择提示和更新后的 smoke 已披露。CLI/Lark 没有 companion 改动的具体原因是其共用 cadence DTO、inheritance 和 mutation owner 未变;没有声称实测 live Lark。
对主干的风险
风险主要在投影不全、空列表 fallback 伪造候选、目标切换保留 preview、UI 看似 per-Agent 而后端写 Goal。不能仅凭两条 mock Agent 或一次成功判断安全,因此我在 immutable base/head 上使用同一 103/empty/reordered 浏览器输入,并把当前 head 的同一真实 HTTP test 在两份源代码上跑了一次:后端观察完全一致。针对新显式选择语义的独立 oracle 在 base 上实际因 goal != agent 失败,而 head 通过。
验证结果:source 和真实 packaged Chat bundle 的 native automation-cadence 浏览器 scenario 均 PASS;2 个真实 HTTP tests、7 个 TS cadence tests 均通过,base 对应 API/TS 检查也通过;desktop/chat 两个 build、settings smoke、28 个 shared Python boundary tests、TypeScript typecheck、配置内 ruff/mypy(19 source files)、diff whitespace 通过。canary 16 项 +4 direct checks,零 failure/warning。实际检查了 1512px desktop 和 390px mobile viewport,无横向溢出,目标、floor、风险提示和 owner reason 的注意力层次清楚。
浏览器 scenario 的 API 是 fixture 拦截,真实 authority 由单独 loopback HTTP/TS file-backed 测试验证;两种证据不混称。没有验证 deployed Electron、实际 App timer/pre-model hook 或 live Lark,也没有宣称 M4 完成。按 capability wait_for_ci=false 未获取远端 CI;批准不代表 merge readiness。回滚只需退 UI selector,不需要迁移 cadence state。
我的整体评价
APPROVE,无未解决阻塞项。user_experience 明确改善:全部注册候选可选、没有默选/伪造目标、纠正后可以继续;long_horizon 保持:目标以外 peer/Goal policy 不变,preview/CAS/reduction 的恢复路径仍有效。这是一段完整可用且可逆的 M3 UX 修复,并非以接口或截图代替用户结果。
Future-facing pass 已在相邻边界考虑:原生 select 与现有 typed projection 比自由输入/新 registry 更简单;Goal-key/remount 复用正常 React 生命周期;保留确有 DTO 缺失语义的 fallback,不新增版本解码或平行 authority。本人 PR 的批准结论用 COMMENTED review 留档;没有进行自合并。以上结论只绑定当前完整 head,head 改变需重审。
English verdict: APPROVE - 4373965; full registered-Agent selection, explicit empty target and scoped recovery validated. Source/packaged browser scenarios, independent 103/empty/reordered/escape counterfactuals, real base/head HTTP readback, native cadence tests, builds and bounded static/canary checks passed. App timer/pre-model admission and merge readiness are not claimed.
|
Current-head frame conclusion (4373965): APPROVE for the M3 registered-Agent configuration UX slice in the automatic execution admission RFC. Full/empty registered selection, correction/recovery and real scoped policy readback are validated; App timer/pre-model hook/M4/live-provider acceptance remains outside this slice. Full bilingual self-review and validation; recorded as COMMENTED because GitHub blocks formal self-approval. No merge-readiness or merge action claimed. |
Problem and result
The automatic-interval settings used a prefilled text input with a datalist: the browser filtered suggestions to the current Agent ID, hiding other candidates. Settings now start in per-Agent scope with an explicit, complete Agent selector. Empty projected lists stay empty instead of inventing a fallback Agent; changing Goal remounts the editor, changing Agent invalidates the preview, and the preview identifies its target.
This changes the editor default from whole-Goal to per-Agent, with no automatic selection. Goal-wide and automation-specific settings remain available. Existing TypeScript quota policy, inheritance, CAS and reduction approval remain the only policy owner; saving here still does not directly change an existing Codex App timer. The bilingual automatic-execution-admission RFC records this M3 improvement, without claiming unqualified App pre-model enforcement.
Validation
Visual review: the Agent selector and effective floor remain prominent at 1512px and 390px; the misleading suggestion popup is replaced by the native selection control. No new cards or competing navigation are introduced. Generated bundles are validated locally and remain untracked under the repository build workflow.
Future-facing pass: reuse the existing projection and policy API, and replace Goal-change synchronization with a keyed component lifecycle. CLI and Lark behavior are unchanged because only the App selector changes. No live model invocation or production admission claim is part of this validation. Full premerge and CI remain pending; the checks above are the focused validation set for this UI fix.