Skip to content

fix: run registration lifecycle probes serially - #61

Merged
vincentkoc merged 6 commits into
openclaw:mainfrom
SebTardif:fix/f003-serial-registration-probes
Sep 9, 2026
Merged

vincentkoc merged 6 commits into
openclaw:mainfrom
SebTardif:fix/f003-serial-registration-probes

Conversation

@SebTardif

@SebTardif SebTardif commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes an issue where users running synthetic probes with includeLifecycle see a registered service's stop and dispose callbacks run before asynchronous start finishes. This can report false failures or tear down partially initialized state.

Why This Change Was Made

Await the existing registration invocations one at a time in the order owned by profile.callableProperties. The service profile already declares start, stop, then dispose; the final repair uses that existing order directly.

Invocation construction, arguments, opt-in guards, failure records, and captureIndex grouping are unchanged. Each callback settles before the next begins; recorded failures still allow later cleanup callbacks to run.

Original fix and regression contributed by @SebTardif. The contributor branch and ancestry are preserved, with current main integrated through merge commits. The existing regression now yields during both startup and stop, covering disposal before asynchronous teardown finishes as well.

User Impact

Service lifecycle probes no longer overlap startup and teardown. This orders callbacks within each captured registration; it does not keep a service running around other registrations or establish a live Gateway lifecycle contract.

No new options, exports, dependencies, or timeout behavior are added.

Evidence

  • Red checkpoint: Node 22 CI run 34373195617, head f7d1314d6723002fe0c499d3cb0d01be2e1a5205. The registration owner was byte-identical to pre-fix main. Of 359 tests, 358 passed and only the service regression failed. Its result records reported stop ran before start finished and dispose ran before start finished.
  • That deliberate red checkpoint was followed by the restored, narrowed repair; it is not the final candidate.
  • Green final head: Node 22 CI run 34373418279, head 04d7e65763c64ddd012092a65451692ee1cb09fe, integrated with main 7cbdafa1a9c3a107c879088ffed98054cf11db5f. npm run check passed all 359 tests, including the asynchronous service regression and existing opt-in/sibling coverage, plus the package-contents check.
  • Both proof runs report Secret source: None with read-only contents and metadata permissions.
  • Fresh independent P2 review of the final narrowed diff found no actionable findings. git diff --check passes.
  • The complete final source, test, and changelog diff was reviewed and approved.
  • Final scope against integrated main is three files: src/synthetic-probes.js, test/synthetic-probes.test.js, and one changelog entry. No profile, capture-runtime, process-boundary, or Gateway changes.

The regression exercises the production capture/probe APIs with isolated callbacks. Contributor code was not executed locally, and no AWS lease was created. No live Gateway or hung-callback deadline proof is claimed. Crabpot consumer smoke has not been run in this preparation; that followthrough remains with the consolidated release integration.

Final head 04d7e65763c64ddd012092a65451692ee1cb09fe is approved and authorized for squash landing, with the documented downstream consumer followthrough retained for release integration.

@SebTardif
SebTardif requested a review from a team as a code owner August 29, 2026 18:13
@clawsweeper

clawsweeper Bot commented Aug 29, 2026

Copy link
Copy Markdown

🦞👀
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.

@clawsweeper clawsweeper Bot added merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. P2 Normal priority bug or improvement with limited blast radius. proof: sufficient Contributor real behavior proof is sufficient. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Aug 29, 2026
@clawsweeper

clawsweeper Bot commented Aug 29, 2026

Copy link
Copy Markdown

Codex review: blocked before merge. Reviewed September 8, 2026, 12:36 PM ET / 16:36 UTC.

ClawSweeper review

What this changes

Runs captured registration callbacks sequentially so service startup finishes before stop and dispose, with regression coverage and a changelog entry.

Merge readiness

Blocked before merge - 2 items remain

The fix remains necessary on current main and v0.3.24. No introduced correctness defect was found, and the supplied lifecycle trace convincingly demonstrates the repair.

Priority: P2
Reviewed head: c840b7c857747c563f4ca124e1d84898d2d75b2e

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused repair with convincing lifecycle proof and no identified correctness defect; required consumer validation remains outstanding.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (terminal): The supplied macOS/Node terminal trace exercises the production capture and probe APIs with yielding service startup and shows startup completing before stop and dispose, with all three probes passing; the separate required Crabpot smoke remains outstanding.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): The supplied macOS/Node terminal trace exercises the production capture and probe APIs with yielding service startup and shows startup completing before stop and dispose, with all three probes passing; the separate required Crabpot smoke remains outstanding.
Evidence reviewed 8 items Current main still invokes lifecycle callbacks concurrently: The registration runner uses Promise.all over callable invocations; registerService includes start, stop, and dispose. A yielding start therefore permits teardown before startup completes.
Latest release retains the race: The v0.3.24 source also uses Promise.all for registration callbacks. Its peeled tag resolves to 92db8c5.
Pinned implementation and regression coverage: The introduced delta replaces concurrent execution with an awaited loop and lifecycle ordering. The added test yields during startup and rejects premature stop or dispose. Existing opt-in guards, report fields, and capture-index grouping remain intact; tests were inspected, not executed.
Findings None None.
Security None None.

How this fits together

Plugin Inspector captures plugin registrations and exercises their callbacks with synthetic inputs. The probe runner produces compatibility results consumed by reports and downstream tools such as Crabpot.

flowchart TD
  A[Captured plugin registrations] --> B[Execution profile and opt-in checks]
  B --> C[Blocked or metadata result]
  B --> D[Order registration callbacks]
  D --> E[Await startup then teardown]
  E --> F[Results grouped by capture index]
Loading

Before merge

  • Resolve merge risk (P1) - Required Crabpot consumer smoke completion remains unverified after inspecting the newer author comment and available discussion.
  • Complete next step (P2) - Run and record Crabpot's source-mode plugin-inspector smoke against the patched source, confirming any needed consumer pin/docs follow-through.
Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Production and test delta production +27/-4; tests +39/-0 The bounded production growth implements lifecycle sequencing with a targeted asynchronous regression test.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Retain sequential lifecycle execution and stable report output, supported by Crabpot source-mode smoke validation before landing.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Retain sequential lifecycle execution and stable report output, supported by Crabpot source-mode smoke validation before landing.

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

Yes: current-main source invokes startup and teardown concurrently, and the supplied public-API trace demonstrates the race with yielding startup. This read-only review did not execute a reproduction.

Is this the best way to solve the issue?

Yes: awaiting existing callbacks repairs the ordering defect without adding configuration or a competing implementation; invocation deadlines remain separate work.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 84ede904fd6e.

Labels

Label justifications:

  • P2: Repairs false failures in opt-in lifecycle inspection with limited blast radius.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The supplied macOS/Node terminal trace exercises the production capture and probe APIs with yielding service startup and shows startup completing before stop and dispose, with all three probes passing; the separate required Crabpot smoke remains outstanding.
  • proof: sufficient: Contributor real behavior proof is sufficient. The supplied macOS/Node terminal trace exercises the production capture and probe APIs with yielding service startup and shows startup completing before stop and dispose, with all three probes passing; the separate required Crabpot smoke remains outstanding.

Evidence

What I checked:

  • Current main still invokes lifecycle callbacks concurrently: The registration runner uses Promise.all over callable invocations; registerService includes start, stop, and dispose. A yielding start therefore permits teardown before startup completes. (src/synthetic-probes.js:762, 84ede904fd6e)
  • Latest release retains the race: The v0.3.24 source also uses Promise.all for registration callbacks. Its peeled tag resolves to 92db8c5. (src/synthetic-probes.js:762, 92db8c57e1d5)
  • Pinned implementation and regression coverage: The introduced delta replaces concurrent execution with an awaited loop and lifecycle ordering. The added test yields during startup and rejects premature stop or dispose. Existing opt-in guards, report fields, and capture-index grouping remain intact; tests were inspected, not executed. (src/synthetic-probes.js:764, c840b7c85774)
  • Public API lifecycle proof: The supplied body snapshot, sourceRevision 11867b5294b0664484a1add4934445ab60c3b68bd90352c9048d43601a03e83c, records macOS/Node execution through captureEntrypoint and runCapturedSyntheticProbes with includeLifecycle enabled. Before: start-begin, stop, dispose, start-end with one failure. After: start-begin, start-end, stop, dispose with three passes. This exercises the changed production scheduler without requiring a live Gateway.
  • Explicit consumer-validation requirement: The fully read root AGENTS.md requires Crabpot smoke validation for inspector behavior changes; README contribution guidance repeats it. The target-owned follow-through script identifies CRABPOT_PLUGIN_INSPECTOR_CLI=source npm run plugin-inspector:smoke as the source-mode check. This establishes the applicable consumer contract without importing sibling repository policy. (AGENTS.md:12, c840b7c85774)
  • Prior smoke uncertainty resolved to an outstanding check: Successfully retrieved fix: run registration lifecycle probes serially #61 (comment): its entire body requests re-review and contains no smoke result. The supplied body and retrieved discussion do not record Crabpot smoke completion. The host-verified test merge has the pinned main and head parents, so the historical changelog-conflict blocker no longer applies.

Likely related people:

  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; confidence: low)
  • Vincent Koc: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Record the required Crabpot source-mode smoke result against the patched source.

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 (18 earlier review cycles; latest 8 shown)
  • reviewed 2026-09-01T20:50:39.029Z sha 084f061 :: found issues before merge. :: [P1] Resolve the current-main changelog conflict | [P2] Record the required Crabpot source-mode smoke
  • reviewed 2026-09-02T13:05:26.983Z sha 084f061 :: found issues before merge. :: [P1] Resolve the current-main changelog conflict | [P2] Record the required Crabpot source-mode smoke
  • reviewed 2026-09-02T20:03:13.252Z sha 084f061 :: found issues before merge. :: [P1] Resolve the current-main CHANGELOG conflict | [P2] Record the required Crabpot source-mode smoke
  • reviewed 2026-09-03T04:53:37.454Z sha 084f061 :: blocked before merge. :: [P1] Resolve the current-main CHANGELOG conflict | [P2] Record the required Crabpot source-mode smoke
  • reviewed 2026-09-03T20:03:19.814Z sha 084f061 :: blocked before merge. :: [P1] Resolve the current-main CHANGELOG conflict | [P2] Record the required Crabpot source-mode smoke
  • reviewed 2026-09-05T05:59:20.711Z sha 084f061 :: blocked before merge. :: none
  • reviewed 2026-09-07T14:22:29.928Z sha 541de8e :: blocked before merge. :: none
  • reviewed 2026-09-07T14:25:53.716Z sha 541de8e :: blocked before merge. :: none

@clawsweeper clawsweeper Bot added merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. 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. and removed merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Sep 2, 2026
@SebTardif
SebTardif force-pushed the fix/f003-serial-registration-probes branch from 084f061 to 541de8e Compare September 7, 2026 14:18
@SebTardif

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Sep 7, 2026

Copy link
Copy Markdown

🦞🧹
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.

Re-review progress:

Run registerService start, then other callables, then stop/dispose
instead of Promise.all so teardown cannot overlap startup.

Signed-off-by: Sebastien Tardif <sebtardif@ncf.ca>
@SebTardif
SebTardif force-pushed the fix/f003-serial-registration-probes branch from 541de8e to c840b7c Compare September 8, 2026 16:32
@vincentkoc
vincentkoc marked this pull request as draft September 9, 2026 15:52
@vincentkoc
vincentkoc marked this pull request as ready for review September 9, 2026 15:58
@vincentkoc
vincentkoc merged commit 340f18e into openclaw:main Sep 9, 2026
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Normal priority bug or improvement with limited blast radius. proof: sufficient Contributor real behavior proof is sufficient. 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants