Skip to content

fix(ci): wait for replacement PR runs instead of stale failures - #138307

Merged
obviyus merged 2 commits into
mainfrom
codex/ci-watch-run-identity
Sep 4, 2026
Merged

obviyus merged 2 commits into
mainfrom
codex/ci-watch-run-identity

Conversation

@obviyus

@obviyus obviyus commented Sep 4, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #138298.

What Problem This Solves

The PR check watcher could report a previous run's failure while its replacement was still queued or running.

Why This Change Was Made

The watcher passes its selected run identity to the existing result classifier. Only checks from strictly older pull-request runs of the same workflow are superseded. Current runs, manual runs, independent checks, and unknown identities retain their existing rules.

User Impact

Maintainers can wait for replacement checks without a stale failure ending the wait. Completion still requires the selected run to succeed. No retry, timeout, or merge-policy change.

Evidence

The real command reproduced the stale failure before the fix. Against the same live event, the repaired command waited until the diagnostic timeout. Five regression cases failed before the change; all 136 watcher tests passed afterward. The final default-mode watcher reported success with no pending checks.

@clawsweeper

clawsweeper Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@obviyus
obviyus marked this pull request as ready for review September 4, 2026 13:56
@openclaw-barnacle openclaw-barnacle Bot added scripts Repository scripts size: M maintainer Maintainer-authored PR labels Sep 4, 2026

@sylvesterkaczmarek sylvesterkaczmarek left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Passing the selected run identity into rollup classification is the right fix; name-only reconciliation cannot distinguish a replacement graph before its matrix jobs appear. The workflow/event/strictly-older guards keep manual and unrelated checks visible, so this does not become a blanket stale-failure filter. Final success still being tied to the attached run is the important fail-closed property.

@obviyus

obviyus commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator Author

Ready to land at f088b8960ec6a58ada6679fd852ad99736ed1d5f.

  • The rollup classifier now receives the selected run identity. It replaces only strictly older pull-request checks from the same workflow and still requires the attached run to succeed.
  • Live baseline: the documented watcher exited 15 from an older run while its replacement was queued. Patched behavior on that event waited to the explicit diagnostic timeout instead. Final live proof on this PR: the default watcher returned GREEN, with zero pending checks.
  • Validation: node scripts/run-vitest.mjs test/scripts/watch-pr-ci.test.ts — 136 passed; node scripts/run-oxlint.mjs --tsconfig config/tsconfig/oxlint.scripts.json scripts/watch-pr-ci.mts; node scripts/run-oxlint.mjs --tsconfig test/tsconfig/tsconfig.test.root.json test/scripts/watch-pr-ci.test.ts; node_modules/.bin/oxfmt --check scripts/watch-pr-ci.mts test/scripts/watch-pr-ci.test.ts; git diff --check.
  • CI run 33882315695 passed on the exact head, including the previously failing test typecheck. Independent exact-head review is clean.
  • Production +25/-4; tests +202/-51. Growth carries authoritative identity into the existing classifier; no new API call, retry, configuration, or merge exception.
  • Latest ClawSweeper content is a review-start placeholder, with no completed findings or rank-up moves to address. The independent review and normal CI gates are complete.

@obviyus
obviyus merged commit 894e9f4 into main Sep 4, 2026
142 checks passed
@obviyus
obviyus deleted the codex/ci-watch-run-identity branch September 4, 2026 14:24
@obviyus

obviyus commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator Author

Landed in 894e9f4d28781858204bda4e6bcebef8c85c7651. Thanks @obviyus for the report.

Proof: 136 watcher tests, scoped lint and formatting, clean independent exact-head review, and successful CI run 33882315695, including the corrected test typecheck. The real default-mode watcher returned GREEN with zero pending checks.

  • Bug: the watcher attached a replacement CI run but reported the previous run's failure.
  • Fix: the existing classifier receives the attached run identity and supersedes only strictly older pull-request checks from the same workflow. Independent checks and final attached-run success remain required.
Before After
Live replacement-run case exited 15 from an old failed aggregate. The same event waited to the explicit diagnostic timeout; the final PR's real watcher reached GREEN after CI completed.

Verified source head: f088b8960ec6a58ada6679fd852ad99736ed1d5f. No CI exception was used.

vincentkoc added a commit that referenced this pull request Sep 4, 2026
…9-prep

* commit '407a8f453c0f0306af1ddc0aafa8697c1d49a9e7': (312 commits)
  perf(ui): coalesce automation event refreshes (#138065)
  fix: reject incomplete Skill Workshop directory reads (#138082)
  test(ui): decouple rendering checks from generated wording (#138283)
  perf: avoid temporary entries in bounded JSON traversal (#138017)
  fix(irc): render complete messages before splitting (#138328)
  perf: prepare worker trajectory payloads only for recorded events (#138086)
  fix(mcp): paginated listings no longer time out after a forward clock step (#137206)
  fix(codex): page native transcripts and bound UI previews (#136282)
  feat(gateway): apply more settings without restarting (#138112)
  fix(docs): preserve mirrored ClawHub maturity links (#138241)
  fix(test): own UI animation and legacy database setup (#138296)
  fix(tts): preserve literal directives in Markdown code (#138319)
  fix: load chat widgets behind authenticated gateways (#138074)
  chore(ui): cover native approval finalization (#137259)
  fix(cron): cancel conditions before main-session handoff (#138313)
  fix(backup): preserve text after embedded NUL characters (#138327)
  fix(android): align composer control sheets (#137442)
  fix(ci): wait for replacement PR runs instead of stale failures (#138307)
  fix(sessions): keep Gateway responsive with long transcripts (#138094)
  fix(computer): map window inputs to delivered image coordinates (#138271)
  ...

# Conflicts:
#	scripts/release-check.ts
#	test/release-check.test.ts
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 5, 2026
…claw#138307)

Fix the CI watcher's stale failure report when a replacement pull-request run has attached but has not yet published its job graph.

Carry the selected run identity into the existing rollup classifier. Supersede only strictly older pull-request checks from that workflow; retain independent checks and require the attached run to succeed.

Closes openclaw#138298

Co-authored-by: Ayaan Zaidi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR scripts Repository scripts size: M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: CI watcher reports superseded failures after attaching a new PR run

2 participants