Skip to content

fix(gateway): publish readiness after startup span - #188873

Merged
RomneyDa merged 1 commit into
mainfrom
fix/gateway-ready-after-post-attach
Oct 31, 2026
Merged

RomneyDa merged 1 commit into
mainfrom
fix/gateway-ready-after-post-attach

Conversation

@RomneyDa

@RomneyDa RomneyDa commented Oct 31, 2026 •

Copy link
Copy Markdown
Member

Summary

  • delay non-deferred gateway readiness publication until the runtime.post-attach startup span has closed
  • preserve deferred sidecar readiness publication semantics and candidate-canary readiness logging
  • ratchet the real non-deferred minimal-boot diagnostics timeline so gateway.ready follows the post-attach span end

This repairs the startup diagnostic race reproduced by the 2026.10.10 release qualification lane, where health could report ready while the required startup span was still open.

Validation

  • node scripts/run-vitest.mjs src/gateway/server-startup-minimal-boot.test.ts (1 file, 4 tests passed)
  • node scripts/run-vitest.mjs src/gateway/server-startup-update-canary.test.ts (1 file, 1 test passed)
  • pnpm exec oxfmt --check src/gateway/server-startup-finish.ts src/gateway/server-startup-minimal-boot.test.ts
  • git diff --check

@clawsweeper

clawsweeper Bot commented Oct 31, 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 gateway Gateway runtime size: XS labels Oct 31, 2026
@RomneyDa
RomneyDa force-pushed the fix/gateway-ready-after-post-attach branch from 0bc272d to 47a922a Compare October 31, 2026 00:25
@RomneyDa
RomneyDa enabled auto-merge (squash) October 31, 2026 00:25
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 31, 2026
@clawsweeper

clawsweeper Bot commented Oct 31, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR delays non-deferred Gateway readiness publication until the post-attach startup span finishes.

Example: An update-canary Gateway finishes loading its startup plugins.

  • Before: The sidecar callback can publish readiness before runtime.post-attach finishes.
  • After: Readiness publication waits until runtime.post-attach finishes, retaining the candidate-specific ready message.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The production repair is focused and appears correct, but the added regression bypasses the changed readiness gate.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored PR is outside the ordinary contributor proof gate; its supplied validation consists of in-process startup tests rather than a shipped-entry-point trace of the changed readiness callback.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: A readiness observer can see successful startup while the required post-attach diagnostic span remains open.
Reason: The maintainer-authored direction restores consistent startup reporting through a small internal ordering change.

Merge readiness

✅ Ready for maintainer review

Keep open: this maintainer-authored PR makes a focused readiness-ordering repair, and no introduced production defect was found.

Priority: P2
Reviewed head: 47a922a803ad8f19f3ac396537accfc967046e8a

Before merge

None.

Findings

None.

Tests

  • Low-value test src/gateway/server-startup-minimal-boot.test.ts: Replace or remove the added timeline-only ordering assertions: minimal mode prepublishes sidecar readiness and skips onSidecarsReady, while the base already places the final gateway.ready mark after the span; these assertions do not detect removal of the production fix.
  • Missing end-to-end proof: The supplied evidence does not show non-minimal readiness staying false until post-attach completion, and no base-failing regression result is supplied.
Agent review details

How this fits together

Gateway startup attaches transports and starts sidecars; its kernel publishes the readiness state consumed by health probes and startup diagnostics.

flowchart TD
  A[Gateway startup] --> B[Post-attach span]
  B --> C[Sidecar completion callback]
  C --> D[Startup completion owner]
  B --> D
  D --> E[Kernel readiness state]
  E --> F[Health probes and ready logs]
Loading

Technical review

Best possible solution:

Keep readiness publication in the existing startup owner and protect its ordering with a non-minimal regression.

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

Source establishes that current-main canary startup publishes sidecar readiness before the enclosing post-attach measurement returns; no target code was executed during this read-only review.

Is this the best way to solve the issue?

The production fix uses the existing lifecycle owner, preserves deferred startup and readiness checks, and adds no persistent state or public contract.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Tracked post-attach startup work keeps the original intent (0d830e9: Keep original startup producers owned through completion and shutdown rather than treating early readiness as completed work.)
  • Post-attach lifecycle ownership keeps the original intent (bd71c34: Separate startup phases by lifecycle ownership while preserving their sequencing.)
  • Readiness-gated announcements keeps the original intent (3a46c0f: Suppress ready announcements while required agent stores are refused and retain actionable admission failures.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

PR surface

Source +10, Tests +13. Total +23 across 2 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 1 14 4 +10
Tests 1 16 3 +13
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 30 7 +23

Labels

Label changes:

  • add P2: This is a narrow startup readiness-ordering correction with no demonstrated outage or urgent user regression.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P2: This is a narrow startup readiness-ordering correction with no demonstrated outage or urgent user regression.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rank-up moves

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

  • Replace the minimal-mode ordering assertion with a non-minimal startup or canary regression that fails on the base and observes readiness before post-attach completion.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed October 30, 2026, 8:41 PM ET / October 31, 2026, 00:41 UTC.

@RomneyDa
RomneyDa merged commit f8fe586 into main Oct 31, 2026
139 checks passed
@RomneyDa
RomneyDa deleted the fix/gateway-ready-after-post-attach branch October 31, 2026 00:51
RomneyDa added a commit that referenced this pull request Oct 31, 2026
Adapt the landed main fix to the release startup structure so normal readiness is published only after post-attach startup work settles.

Co-authored-by: roboclaw-bot <[email protected]>
Co-authored-by: RomneyDa <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gateway Gateway runtime P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. 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.

2 participants