Skip to content

test(workflows): cover canonical agent result handoffs - #286

Merged
tt-a1i merged 1 commit into
openpi-dev:mainfrom
yxr-2025:codex/issue-284-pr
Aug 29, 2026
Merged

tt-a1i merged 1 commit into
openpi-dev:mainfrom
yxr-2025:codex/issue-284-pr

Conversation

@yxr-2025

@yxr-2025 yxr-2025 commented Aug 29, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Issue #284 exposed a Windows-specific contract violation in workflow agent result handoffs: a successful child result could be written to disk with a host-native path, but its protocol-visible artifact identity used backslashes and was rejected by the strict handoff registry.

While this PR was under review, upstream independently landed the production correction in aa326f9: persisted artifact identities use the explicit POSIX form agent-results/agent-XXXX.json, while writeRunFile() continues to translate that identity through host path.join() for filesystem access.

After rebasing onto current main, duplicating that production change would add no value. This PR therefore completes the regression coverage requested by #284 and protects the already-landed behavior.

Value

The tests lock down the full contract, not just string construction: a structured child result must produce ok: true, a canonical handoff ref, valid downstream inputs, and POSIX artifact identities in persisted workflow.json state.

This keeps the handoff and dashboard consumers strict. The tests would fail if a future Windows change reintroduced backslash artifact identities or broke the result-to-ref-to-inputs chain.

Approach

  • Keep upstream's production implementation unchanged.
  • Assert the canonical agent-results/agent-XXXX.json identity in the artifact persistence test.
  • Add an execute-level regression for structured result -> handoff ref -> downstream inputs.
  • Assert both result artifact identities persisted in workflow.json use /.
  • Preserve upstream acceptance replay coverage while resolving the rebase conflict.

Validation

  • node --test --experimental-strip-types --test-name-pattern "agent result artifacts are complete or fail without leaving a file" tests/extensions/workflows/artifacts.test.ts - passed on Windows.
  • node --test --experimental-strip-types --test-name-pattern "structured agent results survive handoff refs and downstream inputs" tests/extensions/workflows/execute.e2e.test.ts - passed on Windows.
  • bunx tsc --noEmit --pretty false - passed.
  • git diff --check upstream/main...HEAD - passed.
  • bun run check reached the formatter after the config-contract and discipline checks passed, then reported 270 repository-wide CRLF diagnostics. The same formatter failure reproduces on a clean main; the separate .gitattributes/CRLF baseline is documented under the related work in Windows 上测试套件不绿:setup-config 死锁回收从未在 win32 验证 + capabilities 测试硬编码正斜杠路径 #211 and is outside this PR.
  • bun run test was attempted on Windows but did not complete: unrelated background-terminal termination tests failed and the runner later stopped producing output, so it was terminated. The focused workflow tests above are green. All three repository CI checks pass on this rebased commit.

Impact

This PR is now test-only: two workflow test files, no production code, no schema changes, and no changes to tools, permissions, providers, or consumer validation. It completes regression coverage for #284 without reopening or weakening the canonical path implementation already present on main.

@somewan820 somewan820 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.

Issue #284 要求修复 Windows 下成功 child result 因反斜杠 artifact identity 被 handoff 拒绝的问题,并保持消费者严格、补充 artifact 单测、execute E2E 和 workflow.json 的 POSIX identity 断言。

本轮未发现阻塞问题。生产改动 extensions/workflows/artifacts.ts:130 将协议身份改为 path.posix.join,而本地落盘仍通过宿主平台的 path.join;handoff 与 dashboard 的严格 canonical 校验未被放宽。新增测试覆盖结构化结果、ref、下游 inputs 和两个 workflow.json artifact。

非阻塞验证问题:

简化审计结论:未发现有充分证据的简化项。严格校验、持久化边界以及取消和清理机制均有实际消费者或独立生命周期保证,不建议删除。

验证状态:本轮仅完成静态审查;bun run check、bun run test 和 Windows execute E2E 均未运行,因此没有测试通过或失败的运行结论。残余风险限于 Windows 实际运行证据和 fake session 与真实 provider 之间的差异。

@yxr-2025

Copy link
Copy Markdown
Contributor Author

感谢审查。确认 Windows workflow E2E 尚未纳入 CI 是测试基础设施层面的非阻塞缺口;
本 PR 保持范围聚焦于 #284 的 artifact identity 修复,不额外修改 CI。
bun run format:check 在干净的 main 上同样复现,已作为独立 issue 跟踪。
生产端 canonicalization、严格 handoff 校验和结构化下游 handoff 回归均保留在本 PR 中。

somewan820
somewan820 previously approved these changes Aug 29, 2026

@somewan820 somewan820 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.

已完成静态审查:path.posix.join 生成的逻辑 artifact identity 与 handoff.ts 的 / 校验契约一致,主机文件系统写入仍使用 host path.join。未发现 P0-P2 或死代码问题。P3:缺少 Windows 主机写入/读取路径的直接测试,建议后续补充。未运行测试。

@yxr-2025

Copy link
Copy Markdown
Contributor Author

感谢审查。
补充一项运行证据:artifacts.test.ts 已直接将 canonical artifact identity 写入宿主临时目录,并通过 host path.join(directory, artifact) 读取校验;
该定向测试已在 Windows 主机运行通过。
新增的 structured result → ref → downstream inputs E2E 也已在 Windows 主机定向运行通过。
目前真正缺少的是在仓库 Windows CI job 中持续运行 workflow E2E,这会作为独立的测试基础设施改进跟踪,不扩大本 PR 范围。

@yxr-2025
yxr-2025 force-pushed the codex/issue-284-pr branch from de130a3 to a134bdc Compare August 29, 2026 14:08
@yxr-2025 yxr-2025 changed the title fix(workflows): canonicalize agent result artifact paths on Windows test(workflows): cover canonical agent result handoffs Aug 29, 2026
@yxr-2025

Copy link
Copy Markdown
Contributor Author

Rebase update for reviewers:

  • Resolved the conflicts against current main.
  • Upstream commit aa326f9 independently landed the production canonical-path implementation, so this PR is now intentionally test-only.
  • Retained the artifact identity assertion, structured result -> handoff ref -> downstream inputs regression, both workflow.json POSIX identity assertions, and upstream's acceptance replay coverage.
  • All three repository CI checks pass on a134bdc.

The force-push dismissed the previous approval; the current one-commit diff is ready for re-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 merge-gate review at a134bdc against main 6286bd8. This is test-only and exercises the real structured result -> handoff ref -> explicit downstream inputs -> persisted POSIX artifact path chain. Two independent reviews found no actionable findings; focused artifact/E2E tests and bun run check passed locally, and all required CI checks are green. The remaining absence of Workflow tests in the Windows CI job is a non-blocking CI-coverage follow-up, not a production regression introduced by this PR.

@tt-a1i
tt-a1i force-pushed the codex/issue-284-pr branch from a134bdc to 0a99a1e Compare August 29, 2026 14:54
@github-actions github-actions Bot added the area:workflows Workflow engine, capability, skills, or tests label Aug 29, 2026
@tt-a1i
tt-a1i requested a review from somewan820 August 29, 2026 14:55
@tt-a1i

tt-a1i commented Aug 29, 2026

Copy link
Copy Markdown
Collaborator

Rebased linearly onto current main@25fd64d with an explicit expected-SHA lease; new exact head is 0a99a1e3d36df21f312a7272a17129700a7f2b6e. The net patch-id is unchanged (4fae1f70abd07589953787d2b422c5ce631120d3), git diff --check, the 10 artifact tests, the structured result -> handoff ref -> downstream inputs E2E, and bun run check all pass after the rebase. Because I performed the last push, branch protection correctly requires a different maintainer to approve this exact head. Requesting that last-push review; no merge will occur before it and the new required CI complete.

@tt-a1i
tt-a1i merged commit 2740971 into openpi-dev:main Aug 29, 2026
4 checks passed
agnitum2009 pushed a commit to agnitum2009/openpi that referenced this pull request Aug 29, 2026
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.

3 participants