Repository navigation
fix(acp): wait for pending acpx startup probes - #177499
Merged
Merged
Conversation
Keep the deferred ACPX facade available while callers share its bounded startup promise, then recheck registered health before creating a session. Failed probes reject waiting spawns with ACP_BACKEND_UNAVAILABLE; later admissions fail fast and doctor recovery stays available. Add regression coverage for concurrent success, failed probes, steady-state failure, and doctor recovery. Focused acpx, registry, and spawn tests: 80 passed. Targeted package typecheck remains blocked by missing generated Plugin SDK declarations; no build was run.
Contributor
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review in progressClawSweeper is reviewing this revision. This supersedes any previous blocked status. |
steipete
marked this pull request as ready for review
October 19, 2026 16:50
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
enabled auto-merge (squash)
October 19, 2026 17:00
steipete
disabled auto-merge
October 19, 2026 17:03
Contributor
Author
|
Merged via explicitly authorized admin squash with attributed pre-existing CI failures.
|
This was referenced Oct 19, 2026
This was referenced Oct 19, 2026
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Oct 20, 2026
Keep the deferred ACPX facade available while callers share its bounded startup promise, then recheck registered health before creating a session. Failed probes reject waiting spawns with ACP_BACKEND_UNAVAILABLE; later admissions fail fast and doctor recovery stays available. Add regression coverage for concurrent success, failed probes, steady-state failure, and doctor recovery. Focused acpx, registry, and spawn tests: 80 passed. Targeted package typecheck remains blocked by missing generated Plugin SDK declarations; no build was run.
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
The first ACP spawns after Gateway start could fail even though ACP is healthy. The acpx backend starts lazily; the real backend registers before its readiness probe finishes and reports unhealthy in that window, and
requireAcpRuntimeBackend(src/acp/runtime/registry.ts) rejects unhealthy backends withACP_BACKEND_UNAVAILABLE. Sub-agent fleets spawn many children at once, so they land in the window reliably. Live: an Opus parent's first batch of 8runtime: "acp"spawns all failed withACP runtime backend is currently unavailable. Try again in a moment.; a second batch 6 seconds later was accepted. The backend registered at 16:13:22.18 and reported ready at 16:13:23.97.User Impact
Sub-agents spawned through ACP right after Gateway start wait for the backend's initial readiness check instead of failing while it is still starting. No configuration changes or migration are required.
Why This Change Was Made
The deferred acpx service (
extensions/acpx/register.runtime.ts) keeps admissions waiting on its existing shared startup promise and rechecks registered health before creating a session. A failed initial probe rejects the waiting spawns; a steady-state unhealthy backend still fails fast;/acp doctorrecovery is unchanged. No polling, configuration, or public API. The quickstart notes the behavior.Evidence
acpconfig): two 8-childruntime: "acp", agentId: "codex"fleets started as the first ACP use after a fresh Gateway start; zerocurrently unavailableerrors in either parent or the Gateway log, both fleets merged all modules, both parents reportedmachinery: clean. On main the same first-use burst fails.extensions/acpx/register.runtime.startup.test.ts(new) fails on main (pending admissions settle prematurely; initiating admission succeeds after a failed probe) and passes; 80 focused acpx/registry/spawn tests pass. Targeted format, lint, and review clean.Release note context
Fix: sub-agents spawned through ACP right after Gateway start no longer fail with "ACP runtime backend is currently unavailable" while the backend is still starting.
CI qualification
CI run 39288914131, attempt 1, completed on head
65d0d79d6f713c83d97375dcd242bb9ac3c76843. All selected checks passed exceptchecks-fast-baseline-ratchetsand its downstream CI gate. The sole ratchet failure ismock-exportsatsrc/infra/openclaw-process-census.missing-command.test.ts:12for./container-environment.js, outside this PR's four changed files.The same ratchet command reproduces the identical failure on the exact tested main base
4ba34fdbb69fc1dbeafd93a2c946e362141ff0be. The offending test, target module, baseline ledger, and scanner have identical Git blobs in that base and CI's tested merge8cbeb9d247c4d92b16b74faa685da99474fc9be5. Current main separately fixes the mock incc942bc04e1. Landing uses the explicitly authorized native inherited-failure exception; the failed CI is retained as failed. No baseline changes, retries, or source changes were made for this PR.