Skip to content

fix(codex): keep completed nodes from blocking catalog refreshes - #149396

Merged
steipete merged 3 commits into
mainfrom
codex/catalog-node-quiescence-20260915
Sep 16, 2026
Merged

steipete merged 3 commits into
mainfrom
codex/catalog-node-quiescence-20260915

Conversation

@steipete

@steipete steipete commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

Related: #149030.

What Problem This Solves

Fixes unrelated catalog refreshes waiting behind a local Codex multi-page scan when selected nodes have already finished, including a connected node that only offers terminal access.

User Impact

Waiting session sources get a turn between completed local pages, so a completed node placeholder no longer delays their appearance.

Why This Change Was Made

The list driver used the number of returned node hosts to decide whether it could yield. A terminal-only or offline host can remain in the result after its work is done. The driver now tracks the existing node publication completions, which include invocation and any late publication beyond the eight-second foreground timeout. Failed discovery and local failures remain conservative, and fully completed lists still return at the existing response deadline. The tracker lives outside the driver's request scope so late callbacks do not retain that scope.

Evidence

The current head is 62ee0ffd194977be7b88b1d984a2f4151e518ec9, a signed main sync with the same two-file fix. CI for this head passed. Its focused CI-watcher suite passed all 189 tests, including the newly incorporated run-status revalidation case. The completed 69 tests, changed-file checks, and green CI below are for 3aeac3a414b88cb143d346f193ad30012aed9181; the accepted remote proof is for d627e87963e5460555995e19eed5d90b0b2901b3. Both remain ancestors of the current head.

  • Registered-provider regressions for terminal-only and offline placeholders fail on the original code because it refills before yielding; both pass with the repair. On refreshed head 3aeac3a414b88cb143d346f193ad30012aed9181, all 69 focused tests across the driver, node-listing, source-backoff, and catalog-client-lifetime suites pass. These include held invocation/publication beyond the eight-second foreground deadline (using fake timers), publication rejection, final-result timing, source recovery, request authority, sibling progress, and closure.
  • Complete changed-file checks passed on refreshed head 3aeac3a414b88cb143d346f193ad30012aed9181 in a physical checkout outside ancestor dependency installations. The initial nested-checkout declaration guard refusal is retained; it was resolved by the isolated checkout without changing code or weakening the guard. Independent source review is clean through P2 for the unchanged fix. Original-head CI passed for d627e87963e5460555995e19eed5d90b0b2901b3; CI for 3aeac3a414b88cb143d346f193ad30012aed9181 passed.
  • The required remote Gateway/browser counterpart passed at d627e87963e5460555995e19eed5d90b0b2901b3 using Blacksmith Testbox run 35040351339. Four original Codex holders occupied the existing admission capacity when the real browser's fifth request queued. An original incomplete step settled at event 205; the browser's healthy provider started at 207, before the second physical thread/list send at 235. The browser received its fast-host progress at 237, before page two was released at 239. Request, handler, provider, progress, and queue identities were independently joined. The Testbox hosting workflow’s cancelled final state is separate from the successful application and launcher receipts.
  • Five complete Codex results shared two physical list sends. The fixture retained 40 managed first-page rows, one eligible second-page row, connected terminal capabilities, the original 4-active/32-queued limits, and zero actual node invocations. The source UI rendered both expected rows. All nine application cleanup owners closed; Chromium and the application exited 0 without forced termination. The lease was canonically stopped and independently confirmed completed. The earlier supplemental local counterpart also passed; prior unsuccessful remote attempts remain recorded separately.

This remote result uses a real Gateway, WebSocket, Control UI, and Chromium with a synthetic App Server peer and terminal-only node roster. It is one candidate scheduling proof, without a matched remote baseline, real-node pairing, native-binary CPU, or production latency evidence. It does not establish that wider production stalls are eliminated. The target catalog RPC completed successfully; 46 of 47 observed browser RPCs had successful receipts, while one ancillary sessions.branches.list remained pending when context closure began. No completion is claimed for that ancillary request. Full state and raw capability metadata remain private.

Use actual node publication completion to decide when a local filled-page scan can yield to queued catalog requests. Preserve in-flight invocation and publication ownership beyond the fail-soft response, failed discovery, independent local progress, and completed-result behavior.

Related: #149030
@clawsweeper

clawsweeper Bot commented Sep 15, 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.

@steipete
steipete marked this pull request as ready for review September 15, 2026 20:17
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Sep 15, 2026
@clawsweeper

clawsweeper Bot commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 15, 2026, 9:50 PM ET / September 16, 2026, 01:50 UTC (Revision 5).

ClawSweeper review

What this changes

The PR lets Codex catalog scans yield between local pages once node work finishes, while retaining unfinished invocations and publications, and adds regression coverage.

Merge readiness

✅ Ready for maintainer review

This remains a useful, focused fix: current main still prevents handoff after selected nodes finish. No blocking correctness or security findings remain, and the recorded production-path proof supports the scheduling change.

Priority: P2
Reviewed head: 62ee0ffd194977be7b88b1d984a2f4151e518ec9

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused repair with meaningful lifecycle regressions and strong, carefully bounded runtime evidence.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): The captured remote trace exercises the registered Codex driver through a real Gateway, WebSocket, and Chromium with a synthetic App Server and terminal-only roster, showing the waiting provider progressing before the next held page. The changed files match the exercised revision; this proves bounded scheduling behavior, not production latency or native-binary performance.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The captured remote trace exercises the registered Codex driver through a real Gateway, WebSocket, and Chromium with a synthetic App Server and terminal-only roster, showing the waiting provider progressing before the next held page. The changed files match the exercised revision; this proves bounded scheduling behavior, not production latency or native-binary performance.
Evidence reviewed 9 items Current main still needs the fix: Fetched main retains the nodeHosts.length === 0 requirement, so a completed terminal-only or offline placeholder prevents an intermediate handoff. The list-operation file is absent from v2026.9.4; that release does not establish that this newer driver repair has shipped.
Lifecycle and handoff implementation: The complete driver tracks settlement of existing publication promises, retains conservative discovery/local-failure behavior, and checks foreground activity before yielding. Complete results still take precedence over intermediate handoff, preserving the existing response deadline.
Existing publication and authority owners remain intact: publishSessionCatalogHost supplies a completion that includes the invocation result and callback settlement. The unchanged Gateway step runner checks current ownership before and after each step, while the lifetime owner checks delivery eligibility and retains publication tails.
Findings None None.
Security None None.

How this fits together

The Codex plugin combines local and paired-node session listings for OpenClaw’s session catalog. Its resumable scan shares the Gateway’s admission queue with other catalog requests, so its handoff decisions affect when other sources become visible.

flowchart TD
  A[Catalog requests] --> B[Gateway admission queue]
  B --> C[Codex catalog scan]
  C --> D[Local session pages]
  C --> E[Node results and publications]
  D --> F{Remaining work and nodes settled?}
  E --> F
  F -->|More pages and settled| B
  F -->|List complete| G[Catalog response]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +25, Tests +216. Total +241 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 27 2 +25
Tests 1 244 28 +216
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 271 30 +241

Review metrics

None.

Technical review

Best possible solution:

Keep the existing admission and publication owners, allowing intermediate handoff when node work has actually settled rather than when the node result list is empty.

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

Yes, from source: a completed terminal-only or offline node leaves a nonempty host list, causing current main to refill local pages without yielding. Registered-provider regressions cover that trigger; this review did not execute them.

Is this the best way to solve the issue?

Yes. Tracking existing publication completion is a narrow repair that preserves native page atomicity, late-result ownership, failure handling, and the established response deadline.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P2: This fixes a bounded catalog scheduling defect that delays other session sources during multi-page scans.
  • 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 (live_output): The captured remote trace exercises the registered Codex driver through a real Gateway, WebSocket, and Chromium with a synthetic App Server and terminal-only roster, showing the waiting provider progressing before the next held page. The changed files match the exercised revision; this proves bounded scheduling behavior, not production latency or native-binary performance.
  • proof: sufficient: Contributor real behavior proof is sufficient. The captured remote trace exercises the registered Codex driver through a real Gateway, WebSocket, and Chromium with a synthetic App Server and terminal-only roster, showing the waiting provider progressing before the next held page. The changed files match the exercised revision; this proves bounded scheduling behavior, not production latency or native-binary performance.

Evidence

What I checked:

  • Current main still needs the fix: Fetched main retains the nodeHosts.length === 0 requirement, so a completed terminal-only or offline placeholder prevents an intermediate handoff. The list-operation file is absent from v2026.9.4; that release does not establish that this newer driver repair has shipped. (extensions/codex/src/session-catalog-list-operation.ts:250, fc1cadae3286)
  • Lifecycle and handoff implementation: The complete driver tracks settlement of existing publication promises, retains conservative discovery/local-failure behavior, and checks foreground activity before yielding. Complete results still take precedence over intermediate handoff, preserving the existing response deadline. (extensions/codex/src/session-catalog-list-operation.ts:156, 62ee0ffd1949)
  • Existing publication and authority owners remain intact: publishSessionCatalogHost supplies a completion that includes the invocation result and callback settlement. The unchanged Gateway step runner checks current ownership before and after each step, while the lifetime owner checks delivery eligibility and retains publication tails. (src/gateway/server-methods/session-catalog-provider-access.ts:100, 62ee0ffd1949)
  • Registered-provider regression coverage: The complete changed test module exercises terminal-only/offline handoff, invocation and asynchronous publication beyond eight seconds, rejection, absent upstream waitUntil, completed-result timing, sibling progress, failure, and closure through the registered provider. Tests were inspected but not executed during this read-only review. (extensions/codex/src/session-catalog-list-operation.test.ts:340, 62ee0ffd1949)
  • Proof identity and review continuity: The two changed files are unchanged from the proof revision d627e87 and the previous reviewed head 3aeac3a. The prior completed review retained no findings; no new blocker was inferred from its historical status. (extensions/codex/src/session-catalog-list-operation.ts:156, 62ee0ffd1949)
  • Recorded remote scheduling proof: The captured PR body, sourceRevision 0bfff3ba8f3d49bb8c5e0c8e006aad83a3998ead27b1aab5eaf5e9e2d83ef887, records real Gateway/WebSocket/Chromium execution on d627e87 with a synthetic App Server and terminal-only roster: step completion at event 205, waiting provider start at 207, second native send at 235, and browser progress at 237 before page-two release at 239. https://github.com/openclaw/openclaw/actions/runs/35040351339 is a cancelled hosting workflow, not a successful CI receipt; its runner revision is distinct from the exercised candidate. Direct log retrieval was blocked by the proxy’s Azure-host allowlist. This reviewer limitation does not negate the captured runtime observations. Prepared screenshots were inspected and belong to the related earlier fairness PR, not this candidate’s runtime proof. (d627e87963e5)

Likely related people:

  • Peter Steinberger: Raw commit 9462e12 adds extensions/codex/src/session-catalog-list-operation.ts:285 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 9462e1241e16; files: extensions/codex/src/session-catalog-list-operation.ts)

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 (4 earlier review cycles)
  • reviewed 2026-09-15T20:28:56.736Z sha d627e87 :: needs real behavior proof before merge. :: none
  • reviewed 2026-09-15T21:23:00.256Z sha d627e87 :: blocked before merge. :: none
  • reviewed 2026-09-16T01:14:42.799Z sha d627e87 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-16T01:27:11.046Z sha 3aeac3a :: needs maintainer review before merge. :: none

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. 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 rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Sep 15, 2026
@steipete
steipete merged commit 78052a3 into main Sep 16, 2026
109 checks passed
@steipete
steipete deleted the codex/catalog-node-quiescence-20260915 branch September 16, 2026 02:15
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 16, 2026
…nclaw#149396)

Use actual node publication completion to decide when a local filled-page scan can yield to queued catalog requests. Preserve in-flight invocation and publication ownership beyond the fail-soft response, failed discovery, independent local progress, and completed-result behavior.

Related: openclaw#149030
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extensions: codex maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M 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