Repository navigation
fix(gateway): keep readiness false while required agents prepare - #171063
Merged
steipete merged 1 commit intoOct 13, 2026
Merged
Conversation
Contributor
|
🦞👀 Pull request received. I will update this pull request when review starts. |
steipete
marked this pull request as ready for review
October 13, 2026 13:16
Contributor
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
steipete
deleted the
steipete/perf-micro-ready-but-cannot-dispatch-20260919
branch
October 13, 2026 13:29
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Oct 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Problem This Solves
/readyzcould return 200 while a required agent's database was still preparing andchat.sendrejected the turn withagent-database-inspection-pending.User Impact
Required-agent startup preparation now keeps
/readyzat 503 with the existing agent-specific diagnostic. The listener, Control UI, and admitted agents remain usable; optional agents still do not hold readiness. Recovery and resume scheduling are unchanged.Why This Change Was Made
Remove the normal-Gateway exemption for pending admission and consume the same required-agent refusal facts that dispatch enforces. Canary readiness was already strict. Update verification already waits for
/startupzbefore readiness, so this adds no new updater wait or startup dependency. Production delta: −7 lines, with no new state, timers, configuration, or schema changes.Evidence
Synthetic Linux sandbox measurements on
fc4e122aac62and current maindf8c7ddb5d68reproduced the mismatch independently of event-loop saturation. HTTP readiness returned 200 while WebSocketchat.sendrefused the required agent. After admission, a new turn reached the reply dispatcher while subagent restoration remained deliberately blocked, both before and after this change.Treat the tiny timing differences as neutral; this is a readiness correctness fix. The older baseline measured 69 ns healthy / 82 ns pending and also returned 100,000 false-ready results. The existing startup integration fixture's two recovery scenarios passed on both unmodified revisions and the changed code. Measurements used synthetic state and constrained CPU/memory in the operator-authorized sandbox; no production state or Testbox/Crabbox leases were used.
The three changed readiness assertions fail on the original implementation. Local validation: changed-file formatter, repository scoped lint, and
pnpm test src/gateway/server/readiness.test.ts src/gateway/server-agent-database-startup.test.ts --maxWorkers=1— 34/34 passed, 193.36 s wall time (185.93 s Vitest time). The existing startup file owns real Gateway/worker lifecycle and cleanup; its complete 13-case run accounts for the longer duration. The change reuses that fixture without adding a boot. Full exact-head PR CI passed, including typechecks, lint, changed/boundary tests and UI E2E: 743 s elapsed for the whole run. Security and dependency checks also passed; no CI reruns or inherited-failure exception were needed. No new test file or exported surface was added.Review: independent subagent review (autoreview route unavailable); clean at P0–P2.
Limits: the reply provider is mocked at the existing integration boundary. This does not fix the separately investigated event-loop wedge, nor certify external provider availability or unrelated pending model acquisition. Slow startup-sidecar scheduling is preserved because the non-wedged repro showed that it does not itself prevent new dispatch.