Skip to content

feat(workbench): surface Steward monitors with one-click Run now in Steward dock/overview and raise Core ledger timeout - #10295

Open
loopx-agent wants to merge 1 commit into
mainfrom
codex/steward-monitors-in-workbench-20261206
Open

loopx-agent wants to merge 1 commit into
mainfrom
codex/steward-monitors-in-workbench-20261206

Conversation

@loopx-agent

Copy link
Copy Markdown
Collaborator

Delivery Brief

  • Goal / Source: Advance LoopX Steward integration into Workbench so users can immediately see LoopX Steward's own standing continuous_monitor todos (such as mergeable-PR watches) right inside the Steward conversation and Steward Overview and manually trigger Run now in a single click, while fixing Core ledger read timeouts on real multi-Goal machines.
  • Root Gaps Addressed:
    1. apps/workbench/packages/daemon/src/steward-ledger.ts defaulted DEFAULT_CORE_GOALS_TIMEOUT_MS to 2000 ms, while live multi-Goal Core /status.json responses take ~4–6 s, causing /api/steward/ledger to report coreGoals: unavailable (timeout).
    2. In Workbench, the Steward's own monitoring Goal (steward-agent-*) was buried inside generic Goal rows requiring 3–4 clicks (open overview -> expand Goal -> expand Tasks -> find Periodic monitors -> click Run now).

What Changed

  • apps/workbench/packages/daemon/src/steward-ledger.ts: Raised DEFAULT_CORE_GOALS_TIMEOUT_MS from 2000 to 10_000 ms (preserving explicit caller timeoutMs overrides and fail-open behavior).
  • apps/workbench/packages/web/src/loopx/status.ts: Added resolveStewardMonitorGoal() preferring the bound Steward's declared Goal ID and falling back to an active steward-agent-* Goal (skipping stopped Goals).
  • apps/workbench/packages/web/src/components/StewardInlineCards.tsx, StewardConversation.tsx, StewardPage.tsx, App.tsx: Added a Steward monitors · N (管家巡检 · N) dock pill and inline tray in StewardStatusDock listing open Steward continuous_monitor todos with direct 1-click Run now (reusing canonical executeTodoMutationOneClick -> preview/apply monitor.update, honest error/gate readback, and 1-click jump to the monitor Goal).
  • apps/workbench/packages/web/src/components/StewardOverview.tsx: Added an expanded-by-default Steward monitors (管家巡检) group at the top of StewardOverview with 1-click Run now per monitor.
  • apps/workbench/packages/web/src/i18n/locales/{zh,en,ja}.ts & apps/workbench/packages/web/test/loopx-monitors-ui.test.ts: Added localized strings and unit/UI tests covering goal resolution, dock pill/tray 1-click trigger, negative 409 error readback, and overview group trigger.

Verification

  • tsc -p packages/web/tsconfig.json --noEmit & tsc -p packages/daemon/tsconfig.json --noEmit: 0 errors
  • npm -w packages/web test: 884/884 passed (0 failed)
  • packages/daemon/test/steward-ledger.test.ts: passed
  • npm run build (daemon + web + ext-loopx): ✓ built cleanly
  • Public boundary check (loopx check): ok=true, errors=0

…teward dock/overview and raise Core ledger timeout

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>

@loopx-agent loopx-agent left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approval conclusion (author-owned PR; GitHub blocks formal self-approval)

Reviewed exact head: 10295@db5f4956a21700f6e078466c51166273b098caa2

动机 / Motivation

在推动 LoopX 管家融入 Workbench 的过程中,用户希望打开管家页就能直接看到管家自身的周期巡检任务(如可合并 PRs 巡检)并一键手动触发「立即运行」,同时当前 StewardLedgerService 读取 Core /status.json 的默认超时仅 2000ms,在真实多 Goal 机器上(4–6s)高频超时导致 coreGoals 误报不可用。

改动思路 / Approach

在完全复用现有 Core 权威 preview -> apply(monitor.update)链路、不新增任何后端旁路的前提下,从三条切面补齐闭环:① 将 StewardLedgerService 的 DEFAULT_CORE_GOALS_TIMEOUT_MS 从 2000ms 放宽至 10000ms(保留调用方显式 timeoutMs 覆盖与 fail-open);② 在 StewardStatusDock 中直接呈现「管家巡检 · N」胶囊与内联抽屉,支持一键「立即运行」与失败/门禁诚实回读;③ 在 StewardOverview 顶部默认展开「管家巡检」分组,消除原先 3–4 层折叠路径。

具体改动 / Changes

  • apps/workbench/packages/daemon/src/steward-ledger.ts:DEFAULT_CORE_GOALS_TIMEOUT_MS 从 2000 调整为 10_000。
  • apps/workbench/packages/web/src/loopx/status.ts:新增 resolveStewardMonitorGoal(),优先匹配绑定管家声明的 goalId,否则回退到活跃的 steward-agent-* Goal,并自动排除已停止 Goal。
  • apps/workbench/packages/web/src/components/StewardInlineCards.tsx、StewardConversation.tsx、StewardPage.tsx、App.tsx:在管家对话底部状态栏新增「管家巡检 · N」胶囊与抽屉,列出全部开放 continuous_monitor 任务并提供单次点击「立即运行」(复用 executeTodoMutationOneClick)、即时触发反馈、错误/门禁显式回读与「查看巡检 Goal」跳转。
  • apps/workbench/packages/web/src/components/StewardOverview.tsx:在总览顶部新增默认展开的 StewardMonitorGroup,支持直接浏览与一键触发管家巡检。
  • apps/workbench/packages/web/src/i18n/locales/zh.ts、en.ts、ja.ts 与 apps/workbench/packages/web/test/loopx-monitors-ui.test.ts:补齐三语文案及 3 组核心单测(Goal 解析、Dock 胶囊/抽屉一键触发与 409 错误回读、Overview 顶部巡检分组)。

对主干的风险 / Risks

风险低且边界清晰。所有「立即运行」动作仍严格经由既有的服务端 preview -> apply(monitor.update)权威校验链执行,任何 failed/gated 或 409 响应都会抛出并渲染为 role=alert 错误提示,不会伪造触发成功;StewardLedgerService 超时上限放宽至 10s 仍受显式 AbortSignal 与 fail-open 保护,且保留了调用方自定义 timeoutMs。实测 tsc --noEmit(web + daemon)0 错、packages/web 884/884 测试通过、steward-ledger.test.ts 9/9 通过、npm run build 完整通过、loopx check 0 错误。

我的整体评价 / Verdict

改动精准打通了「在 Workbench 中直接看见管家与管家巡检任务并一键触发」的最后一公里,同时消除了真实多 Goal 环境下 coreGoals 的 2s 超时误报,验证完整,达到合入标准。

English Verdict: Approve — promotes Steward standing monitors with one-click canonical preview->apply Run now directly in StewardStatusDock and StewardOverview, fixes multi-Goal Core ledger 2s timeout, and passes 884/884 web tests, 9/9 ledger tests, tsc, build, and public boundary checks at 10295@db5f4956a21700f6e078466c51166273b098caa2.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant