Skip to content

fix(workflows): bound dashboard history hydration - #319

Merged
tt-a1i merged 16 commits into
openpi-dev:mainfrom
testikun:codex/issue-178-dashboard-hydration-bound
Sep 12, 2026
Merged

tt-a1i merged 16 commits into
openpi-dev:mainfrom
testikun:codex/issue-178-dashboard-hydration-bound

Conversation

@testikun

@testikun testikun commented Aug 31, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

Related to #178. The Workflow Dashboard materializes persisted history and artifacts without a retained-data bound. Review also identified live-state mutation, repeated disk scans, and compact-list data being replaced by hydrated detail data.

Value

Bound the operator-facing history projection while keeping canonical execution state and complete disk artifacts intact.

Approach

  • Build compact history from workflow metadata, with 32-run / 2 MiB bounds for non-pinned history. Measure the representation actually retained, including legacy inline results.
  • Hydrate an independent detail view on demand; pin the open run through live-to-settled transitions. Opening live details never runs stale recovery on canonical state.
  • Reuse history on idle animation ticks. Keep omitted-run identities available for explicit full-ID/suffix navigation without retaining their transcripts.
  • The shared resolveWorkflowRunTarget change ALSO affects workflow_status and workflow_stop, not only Dashboard navigation. Exact-case full IDs win; otherwise unique case-insensitive full IDs and suffixes resolve to the original ID. Case collisions and ambiguous suffixes fail closed. No new tool or schema is introduced.

Validation

Revalidated on 2026-09-09 using Node 24 and Bun 1.3.14:

  • bun run check: passed.
  • bun run test: Node 1476 passed, 1 skipped; Vitest 130 passed.
  • Fresh GitHub CI for 033a0bd: Node 22.19.0 / 24 / 26, Web E2E, and Windows all passed.
  • Dashboard and target-resolution tests: 41 passed.
  • Tool-entry regressions invoke registered workflow_status / workflow_stop against live runs: uppercase full IDs and unique uppercase suffixes select the intended canonical ID; ambiguous suffixes cannot inspect or stop either run. Resolver regression proves exact-case precedence under a case collision.
  • Existing regressions cover live state preservation, idle scan reuse, detail hydration, compact/detail separation, and actual retained-byte accounting.
  • No installed Pi/TUI or provider smoke was performed in this follow-up. This is code/test validation, not deployment evidence.

Impact

  • User-visible: bounded Dashboard history and on-demand complete details.
  • Model-visible tools: shared run target matching affects workflow_status and workflow_stop as described above; their schemas and result shapes are unchanged.
  • Runtime/lifecycle: operator projections do not mutate canonical live state. Stop still goes through the existing lifecycle owner after resolving one unambiguous run.
  • Persisted config/data: no artifact format, delivery, resume/replay, or settled-memory policy change.
  • Compatibility/risk: this is NOT a UI-only change; target-resolution compatibility is explicitly tested at the tool boundary. Maintainer approval is still required.

@github-actions github-actions Bot added the area:workflows Workflow engine, capability, skills, or tests label Aug 31, 2026
@testikun

Copy link
Copy Markdown
Collaborator Author

TUI smoke

验证 Dashboard 修复后的实际界面:列表显示省略数量,打开详情后才加载完整 transcript。

OpenPI Dashboard TUI smoke

@tt-a1i tt-a1i left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

复审 exact head b2dc49ee74643aa4842216dc4b04b9f697a061af。目标是让 /workflows 列表只保留有界元数据,打开详情再加载磁盘正文,减少历史规模带来的内存/读取开销。方向和价值成立,但当前有两个可复现回归,需要修改后再合并。

Standards

1 项:enterEntry 对 live entry 调用会修改输入的 stale recovery,违背 AGENTS 中 canonical execution facts 与 operator-facing UI 分离的边界。仅查看 UI 不应改变真实任务状态。

Spec

2 项:

  • P1:打开正在运行的 run,原始 active Map 对象及 agent 都从 running 变成 uncertain,并被写入 finishedAt/error。这违反 PR 的“不改变 execution/delivery”承诺。
  • P2:从列表打开的 run 完成后被32条历史限额省略,current 仍标记 live,不进入一次性 artifact hydration,无法看到 canonical transcript。这违反“live run settles while its detail view is open 时 rehydrate once”的承诺。

详见行内评论。最小修复可局限在 live/history 分支与当前详情的 pin/refresh,无需新增存储或生命周期框架;不要求本 PR 一并完成 #178 的全部 retention 工作。

验证

隔离 checkout、Node 24:bun run check 通过;bun run test:Node 1083 passed / 1 skipped,Vitest 30 passed;git diff --check 通过。另用实际 WorkflowDashboard class 完成两条独立复现:live 对象被原地改写;33条记录 mock FS 中 current 被省略、artifactReads=0、current.live=true。现有绿测未覆盖这两个交叉场景。本轮不是安装后真实 Pi/TUI 或模型验收。

Comment thread extensions/workflows/dashboard.ts Resolved
Comment thread extensions/workflows/dashboard.ts Resolved
@tt-a1i

tt-a1i commented Aug 31, 2026

Copy link
Copy Markdown
Collaborator

审查结论:Changes Requested,exact head b2dc49e。价值是降低 /workflows 历史加载开销;已确认 P1 查看 live 详情会改写真实运行态,以及 P2 当前详情被历史限额省略后不加载完成 transcript。建议仅修 live/history 分支和当前详情 pin/refresh。check、完整测试(Node 1083 passed/1 skipped,Vitest 30)通过,但两个独立复现暴露了测试遗漏。详见正式 review:#319 (review) 。本轮未改代码或合并。

@tt-a1i tt-a1i left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

复审 exact head 93ab72ca8ca8e64d1554111f43a31de69fc2bd8a。目标是降低 /workflows 历史加载成本:列表只读 metadata,详情按需 hydrate,并把 operator projection 限制为 32 条 / 2 MiB。作者这次已经修复上轮两项回归:打开 live 详情不再改 canonical state,省略的 live run 完成后也能 pin 并 hydrate。

仍有 1 项运行时资源边界问题:最终列表有界,但每次刷新仍同步枚举并解析全部 workflow.json;存在 live run 或 notice 时,这个过程每 120 ms 执行一次。独立 exact-head 基准(最小 metadata)显示 warm refresh:100 条约 2.7 ms、1,000 条约 136–166 ms、5,000 条约 706–780 ms,已经超过刷新周期并会持续占用 TUI 线程;5,000 条首次读取约 7.1 s。

最小修复不需要新存储框架:把“全量持久历史扫描”移出 spinner tick,刷新周期只处理 active/current pin 的变化;持久 metadata projection 可在打开、显式刷新或可证明的增量事件上重建。

验证:bun run check 通过;dashboard/target-resolution 35/35 通过;GitHub CI 全绿。绿测覆盖了最终投影边界,但没有覆盖扫描工作量边界。

Comment thread extensions/workflows/dashboard.ts Resolved

@tt-a1i tt-a1i left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Exact-head follow-up on 59d4da6: the three prior blockers are addressed in the bounded checks. Dashboard/target-resolution tests passed 35/35; a direct probe confirmed that opening a live run preserves canonical state, idle ticks skip disk-history rescans, and a state change refreshes the projection. No new P0/P1 was confirmed.

There is an additional impact boundary to make explicit: this is not solely a dashboard rendering change. resolveWorkflowRunTarget in model.ts now changes case-sensitive/full-ID and suffix matching, and is called by resolveRunDetails for both workflow_stop and workflow_status (as well as the command/UI paths). An unchanged index.ts diff does not mean tool behavior is unchanged.

Please split the shared target-resolution behavior into its own reviewed change, or document and validate the tool-level compatibility explicitly. This is a scope/impact observation, not a demonstrated new correctness defect. I am not advancing this branch under the current UI-only/low-impact batch.

An unpublished clean integration with main c1c60cd passed bun run check, but its first full suite had two plan-mode rendering failures and a setup subprocess timeout; the same failures were observed on pure main in this environment. Those results do not establish a PR regression, and I am not requesting speculative production fixes for them. No branch push or merge was performed.

Keep dashboard list projections metadata-only and bounded by count and UTF-8 bytes. Hydrate result and transcript artifacts only when a run is opened, preserve explicit target lookup across omitted history, and surface omitted runs without changing canonical artifacts.
@testikun
testikun force-pushed the codex/issue-178-dashboard-hydration-bound branch from 59d4da6 to ae55277 Compare September 6, 2026 06:19
@testikun

testikun commented Sep 6, 2026

Copy link
Copy Markdown
Collaborator Author

@tt-a1i 已修复你指出的两项:live stale recovery 不再改写 canonical state;current live run 会 pin 并 hydrate,即使超出 32 条历史列表。相关回归与 required CI 已通过。

@tt-a1i tt-a1i left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

复审当前 exact head。延迟加载详情、减少 Workflow 列表开销的价值成立;此前 live state 和 idle disk rescan 问题已有改善。但本轮真实文件与 dashboard 按键复现确认两项 P2,需作者修改后再合并。

验证:精确 HEAD 的 dashboard/target-resolution 测试 39/39 通过;另运行真实磁盘 history/artifact probes,确认查看报告后列表丢失条目,以及 2 MiB 预算低估实际保留数据。没有修改 PR 源码,未进行安装后 Pi/TUI 验收。详见行内证据。

Comment thread extensions/workflows/dashboard.ts Resolved
Comment thread extensions/workflows/dashboard.ts Resolved
@testikun

testikun commented Sep 9, 2026

Copy link
Copy Markdown
Collaborator Author

Fixed and pushed as 37df44a (merged latest main).

  • Hydrated report/transcript details are now cloned into the detail view; the compact list entry remains independent and continues to satisfy the projection budget after returning from detail.
  • Dashboard byte accounting now measures the retained representation directly (with a safe fallback for cyclic runtime values), so large legacy inline results are omitted instead of being retained beyond the 2 MiB bound.
  • Added regressions for large inline history and compact-vs-hydrated navigation.
  • Validation: workflow dashboard/retention tests passed (47/47); bun run check passed.

@testikun

testikun commented Sep 9, 2026

Copy link
Copy Markdown
Collaborator Author

Review follow-up pushed as 033a0bd. The PR body now explicitly documents that shared full-ID/suffix matching affects workflow_status and workflow_stop, including canonical case precedence and ambiguous-case failure. Added registered-tool regressions for uppercase full IDs and unique uppercase suffixes while preserving ambiguous-stop rejection. bun run check passed; full suite Node 1476 passed / 1 skipped, Vitest 130 passed; Dashboard/target-resolution 41/41. No new production abstraction or tool behavior was added in this follow-up. Please re-review the current head; no installed TUI/provider acceptance or merge is claimed.

@tt-a1i tt-a1i left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewed exact head 033a0bd.

This is valuable: the previous live-state mutation, settlement hydration, idle rescans, compact/detail aliasing, and byte-accounting issues are fixed. Exact-head and current-main merged-tree focused tests pass 41/41, and hosted CI is green. I found no P0/P1.

One P2 remains: resolveWorkflowRunTarget preserves exact-case full-ID precedence, but Dashboard pinning compares lowercased IDs. On a case-sensitive filesystem, explicitly opening wf_ABCD can pin both wf_ABCD and wf_abcd, allowing case variants to bypass the 32-run / 2 MiB projection bound. Pin only the exact resolved canonical ID and add a collision regression.

P3: a full-ID case collision is reported as suffix ambiguity and recommends using a full ID even though one was supplied.

I am not auto-merging because the shared resolver also changes model-visible workflow_status and execution-affecting workflow_stop target selection. That is a core authority boundary, so the remaining behavior should be explicitly accepted by a maintainer before merge.

@testikun

Copy link
Copy Markdown
Collaborator Author

已按本轮 review 集中处理并推送 09f5b9e:Dashboard 现在只按已解析出的 exact canonical run id pin,大小写碰撞不会同时进入 pinned projection;新增 collision 回归。验证:目标测试环境缺少可执行 Bun runtime,已完成提交并推送,等待 hosted CI。

tt-a1i
tt-a1i previously approved these changes Sep 12, 2026

@tt-a1i tt-a1i left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewed a741c4d after current-main integration. Standards: no remaining actionable blocker identified. Spec: Hydration remains bounded and canonical run identities are pinned exactly, with ambiguity rejected. The previous ownership/case findings are fixed. No P0/P1 found. This supersedes findings against older implementations where stated; merge remains conditional on current required CI and branch protection.

tt-a1i
tt-a1i previously approved these changes Sep 12, 2026

@tt-a1i tt-a1i left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

仅修复两处格式并集成最新 main,原 P1 已通过现有收窄设计解决。 bun run check 已通过;完整测试已执行或正在串行验证,本机部分测试存在资源竞争超时,最终状态以最新 CI 为准。未发现 P0/P1。此账户推送了修复,仍需另一位维护者满足最后一次推送后的独立批准。

@tt-a1i tt-a1i left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

追加修复 Windows 测试夹具:用已有 retained projection 表示大小写不同的两个身份,不依赖文件系统能否创建两个同名目录。仍断言只保留精确 initialRunId 且省略另一个条目。39项 Dashboard 测试及 bun run check 通过,最新跨平台完整CI待验证。此账户推送了修复,仍需要独立批准。

@tt-a1i
tt-a1i merged commit dfb737f into openpi-dev:main Sep 12, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:workflows Workflow engine, capability, skills, or tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants