Skip to content

fix(test): preserve watcher errors when diagnostic capture fails - #155383

Merged
vincentkoc merged 3 commits into
mainfrom
fix/skills-watcher-failure-snapshot
Sep 22, 2026
Merged

vincentkoc merged 3 commits into
mainfrom
fix/skills-watcher-failure-snapshot

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Sep 22, 2026 •

Copy link
Copy Markdown
Member

Related: #149882

What Problem This Solves

The watcher integration test can replace its original failure when diagnostic serialization throws, and its fallback snapshot is labelled as if captured before teardown.

User Impact

No runtime behavior changes. Maintainers retain the original test error and can distinguish an operation-boundary snapshot from an afterEach fallback. This does not fix the underlying watcher discovery failure.

Why This Change Was Made

Main already captures the first snapshot before the test's finally and preserves it with ??= through #155570. This PR is narrowed to the remaining two concerns: truthful capture-stage labels and a catch confined to diagnostic capture that preserves the original operation Error.

Signed head 8a6c0a051fcf1c3b7824bd44884d22a3f685aeef, tree 43abf02ad4bf4a4ba0dafe6d5e1b4225433bc1ac, composes the previous head with frozen main 774687378d80058d4e5ee93ec187421eeac74a71. Main's simpler ??= remains. All original test bodies, assertions, polling, deadlines, teardown/join and cleanup-error precedence are unchanged. A persistent serialization failure in fallback/independent teardown is outside this repair.

Evidence

  • One test file, +11/-8 lines relative to frozen main; production changes: 0. Independent source review and fresh scoped autoreview found no actionable issue. Formatting, whitespace/privacy checks and normal signed commit hooks passed.
  • Exact-head managed Linux proof, Node 24.19.0, pnpm 12.4.0, Vitest 5: current-main source with a one-shot serialization fault fails specifically at original-Error identity in the actual callback control. Both candidate controls pass, the owning integration file passes 11/11 with no skips, and canonical one-file oxlint 1.82.0 / oxlint-tsgolint 7.0.2001 passes. The disposable controls are not part of this PR.
  • The RED reaches the Error-identity assertion before stage-label assertions; it does not rely on a label-only failure. Candidate controls exercise actual callback, teardown and reporting. This controlled fault proves diagnostic robustness, not the cause of a historical watcher/Windows failure.
  • Source and frozen dependency inputs, plus 48,356 unchanged tracked entries' raw bytes/modes, match before/after. The temporary control, baseline and temporary directory were removed after their owned work joined; the candidate remains unchanged. Native completed-stop, exact lease not-found status, local staging absence and owned process-family closure were verified. An independent reader authenticated the retained evidence.
  • The combined native run remains overall exit 1: after all watcher proof and lint passed, a separately authorized dependency lock-generation phase was rejected by pnpm's release-age policy on the existing old lockfile. That phase restored its baseline and produced no new lock. It does not change or invalidate the completed watcher results. No test was rerun. Raw: 19,947 bytes/SHA256 17da22f59475e0cd907789dd7c2aa52e1734116f523e28e8e75bf4d4178102cf; archive: 8,222 bytes/SHA256 794593c74f1d76e06dd9e195ac146ede7519517d87421b6f95cd3083a32b33a7.
  • Fresh ordinary CI and one exact-head Claw review are requested for this narrowed head. The old 22b attempt 1 failed after 94 Teams assertions in native fork teardown on Node 24.19.0. Its single retry, with unchanged workflow/source and Node 24.20.0, failed earlier in the bundled-MCP inner offline npm pack with null status; the later Teams shard did not run. Neither cause was established, and neither old failure is cleared by this Linux proof. No further retry, deadline or runtime-policy change was made. The native spawn-facts follow-up is separately scoped at fix(test): retain native package command failure details #155669.

The earlier pre-finally/closed-watcher controls apply to historical heads only. This narrower PR claims neither that main still lacks first-failure capture nor that it fixes the watcher/Windows runtime issue. It does not qualify the FreeBSD update path, adopt a dependency, or perform a release.

@vincentkoc vincentkoc self-assigned this Sep 22, 2026
@clawsweeper

clawsweeper Bot commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added size: XS maintainer Maintainer-authored PR labels Sep 22, 2026
@vincentkoc
vincentkoc marked this pull request as ready for review September 22, 2026 03:10
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 22, 2026
@clawsweeper

clawsweeper Bot commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 22, 2026, 9:30 AM ET / 13:30 UTC (Revision 3).

ClawSweeper review

What this changes

The skill-watcher integration test preserves its original operation error when diagnostic capture throws and labels when each failure snapshot was captured.

Merge readiness

✅ Ready for maintainer review

The narrowed repair remains useful on current main. No introduced correctness or security defect was found; the earlier merged watcher work covers only part of the original proposal.

Priority: P3
Reviewed head: 8a6c0a051fcf1c3b7824bd44884d22a3f685aeef

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, maintainable diagnostic repair with no actionable findings and clearly bounded validation claims.
Proof confidence 🌊 off-meta tidepool Not applicable: The external-contributor proof gate does not apply to this MEMBER-authored test-only repair. The body reports actual callback fault controls and the owning integration run; linked raw logs could not be inspected because the artifact host is blocked. No production owner or stored-data contract changes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The external-contributor proof gate does not apply to this MEMBER-authored test-only repair. The body reports actual callback fault controls and the owning integration run; linked raw logs could not be inspected because the artifact host is blocked. No production owner or stored-data contract changes.
Evidence reviewed 7 items Pinned introduced change: The introduced patch confines exception suppression to diagnostic capture, then rethrows the original error. Assertions, polling, watcher shutdown, cleanup precedence, and production code are unchanged.
Remaining behavior on current main: Current main still calls diagnostic capture without a protective catch and reports fallback snapshots under the old before-cleanup label. The affected file has no changes between the pinned base and fetched main, so the residual repair is still necessary. The supplied release commit was unavailable locally; no shipped-fix claim is made.
Verified partial overlap: GitHub verifies #155570 merged on 2026-09-22. Its committed patch added pre-finally capture and first-snapshot retention, but neither the diagnostic exception guard nor capture-stage labels.
Findings None None.
Security None None.

How this fits together

Skill watchers keep workspace skill discovery fresh after filesystem changes. This patch affects the integration test’s failure reporting, which turns watcher observations into diagnostics for developers.

flowchart TD
  A[Filesystem changes] --> B[Skill watchers]
  B --> C[Integration assertions]
  C --> D[Operation failure]
  D --> E[Attempt diagnostic capture]
  E --> F[Preserve original error]
  E --> G[Snapshot with capture stage]
  F --> H[Test teardown and reporting]
  G --> H
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests +3. Total +3 across 1 file.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 11 8 +3
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 11 8 +3

Review metrics

None.

Technical review

Best possible solution:

Keep diagnostic capture best-effort at the operation boundary while retaining first-snapshot semantics and existing teardown behavior.

Do we have a high-confidence way to reproduce the issue?

Yes, from source: a diagnostic serialization exception escapes main’s operation-error handler before it can rethrow the original error. This review did not execute that fault; the PR reports a matching controlled reproduction.

Is this the best way to solve the issue?

Yes. The nested catch repairs error precedence at the existing diagnostic owner, and explicit stage labels remove misleading fallback reporting without changing watcher behavior.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 2c7feb0648ce.

Labels

Label changes:

No label changes.

Label justifications:

  • P3: This improves test failure diagnostics without changing shipped runtime behavior or test success criteria.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The external-contributor proof gate does not apply to this MEMBER-authored test-only repair. The body reports actual callback fault controls and the owning integration run; linked raw logs could not be inspected because the artifact host is blocked. No production owner or stored-data contract changes.

Evidence

What I checked:

  • Pinned introduced change: The introduced patch confines exception suppression to diagnostic capture, then rethrows the original error. Assertions, polling, watcher shutdown, cleanup precedence, and production code are unchanged. (src/skills/runtime/refresh.missing-root.integration.test.ts:516, 8a6c0a051fcf)
  • Remaining behavior on current main: Current main still calls diagnostic capture without a protective catch and reports fallback snapshots under the old before-cleanup label. The affected file has no changes between the pinned base and fetched main, so the residual repair is still necessary. The supplied release commit was unavailable locally; no shipped-fix claim is made. (src/skills/runtime/refresh.missing-root.integration.test.ts:516, 2c7feb0648ce)
  • Verified partial overlap: GitHub verifies fix(skills): preserve watcher coverage during directory rescans #155570 merged on 2026-09-22. Its committed patch added pre-finally capture and first-snapshot retention, but neither the diagnostic exception guard nor capture-stage labels. (src/skills/runtime/refresh.missing-root.integration.test.ts:273, 5965d5de896c)
  • Validation evidence and inspection limit: The captured PR body reports Linux callback controls that fail on original-error identity before the fix, pass afterward, and an 11/11 owning-file pass. It explicitly preserves the combined run’s later lock-generation failure. The linked Actions run uses a transport-carrier SHA and is marked cancelled; these metadata alone do not authenticate the reported candidate execution. Reading its job logs was blocked by the environment’s artifact-host allowlist. The reported results remain contributor-supplied evidence, without a new contributor-proof requirement. (8a6c0a051fcf)
  • Scope and review continuity: The prior completed review retained no findings or published rank-up moves. The current body explicitly limits this repair to diagnostic robustness; persistent fallback serialization failures and independent teardown failures remain outside its claim. The earlier-head blob needed for a local continuity comparison was unavailable, so no unchanged-code attribution is asserted. (src/skills/runtime/refresh.missing-root.integration.test.ts:217, 8a6c0a051fcf)
  • Area history for routing: Current-main file history includes merged work by Vincent Koc and Peter Steinberger. GitHub commit metadata resolves their handles to vincentkoc and steipete. These are routing signals; unavailable historical blobs prevent verified source-line introduction attribution. (src/skills/runtime/refresh.missing-root.integration.test.ts, 2c7feb0648ce)

Likely related people:

  • vincentkoc: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (2 earlier review cycles)
  • reviewed 2026-09-22T03:17:10.969Z sha 7f0940f :: needs changes before merge. :: none
  • reviewed 2026-09-22T04:05:02.714Z sha 22b1df0 :: needs maintainer review before merge. :: none

@vincentkoc vincentkoc changed the title fix(test): preserve watcher diagnostics before teardown fix(test): preserve watcher errors when diagnostic capture fails Sep 22, 2026
@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

Please review exact head 8a6c0a051fcf1c3b7824bd44884d22a3f685aeef. Main already supplies first pre-finally capture; this narrowed test-only residual preserves original errors and reports capture stages truthfully. The body records fresh RED/GREEN/owner proof and the separate later lock-generation failure.

@clawsweeper

clawsweeper Bot commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

@clawsweeper

clawsweeper Bot commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@vincentkoc
vincentkoc merged commit 837758a into main Sep 22, 2026
106 of 107 checks passed
@vincentkoc
vincentkoc deleted the fix/skills-watcher-failure-snapshot branch September 22, 2026 13:50
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Sep 22, 2026
* commit '739e2410702e0b1ad1d17a6dac07ddc0ab6dbebb': (140 commits)
  fix(ui): pause passive polling in hidden tabs (#155617)
  improve(android): keep chat photos outside text bubbles (#155338)
  fix(ui): preserve saved project after discovery failure (#155619)
  feat: compare Kitchen Sink Gateway resource costs (#155734)
  test(gateway): arm clock-jump claim after readiness (#155748)
  chore(ui): refresh control ui locales (#155700)
  fix(ci): join archive placement fixtures before teardown (#155751)
  fix(matrix): keep bot discovery off the Gateway thread (#152122)
  fix(agents): reconcile late requester recovery receipts (#155357)
  test(gateway): guard embeddings HTTP fixture lifetimes
  fix: isolate triage fixture acquisition and cleanup (#155736)
  refactor(sessions): hydrate saved transcripts off thread (#153325)
  fix: Claude MCP turns abort before tool timeout (#155663)
  fix(goals): pause terminal failures and clarify goal states (#155694)
  fix(test): preserve watcher errors when diagnostic capture fails (#155383)
  ci: move native runtime proofs to release validation (#155606)
  fix(auth): decouple compaction from profile rotation (#155204)
  fix(agents): admit compaction outside retired plugin generations (#151232)
  perf(ui): reduce automatic session list refetches (#155705)
  test: avoid unused source repos in release input fixtures (#155733)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 23, 2026
…nclaw#155383)

* fix(test): preserve watcher diagnostics before teardown

* fix(test): preserve operation errors without unsafe finally

* test(skills): preserve operation errors during failure capture

Co-authored-by: Vincent Koc <[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 P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant