Skip to content

perf(codex): bound progressive local catalog waits - #154362

Merged
steipete merged 1 commit into
mainfrom
steipete/perf-micro-catalog-no-foreground-pages-20260919
Sep 21, 2026
Merged

steipete merged 1 commit into
mainfrom
steipete/perf-micro-catalog-no-foreground-pages-20260919

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

A cold local Codex catalog can hold sessions.catalog.list open for seconds while the app-server produces its first thread/list page. Progressive local lists still took that complete-response path after paired-node lists gained bounded progress handling in #153614.

User Impact

Progressive lists now return warm resident rows immediately, or a pending local host after at most 250 ms of page waiting. Pending hosts preserve existing displayed rows, and the existing onHost callback publishes the page or error when ready. One-shot lists, host-specific requests, and pagination retain their existing deadline and complete-response behavior.

Why This Change Was Made

Reuse the paired-node wait bound and the existing waitUntil publication lifetime. The local visible-page operation finishes and closes under that lifetime after the foreground driver closes. The resident index still owns shared hydration, incremental reconciliation, and the 15-minute safety walk. No new cache, configuration, schema, protocol, migration, or updater behavior; net production change is +38 lines.

Evidence

Registered-provider benchmark with a fake 2-second app-server page, using the real resident index:

Measurement Before After
Cold progressive list latency 2,100.76 ms 251.49 ms
Cold native control requests 1 1, retained in background
Warm list latency 1.36 ms 0.74 ms
Warm native control requests 0 0

Cold response latency fell 88%. These are single synthetic samples, not production p50/p99 claims. Fake-clock regression proves the 250 ms page-wait bound; the measured wall time also includes provider overhead. No live deployment was performed.

All heavy validation used provider blacksmith-testbox, profile openclaw-check, initially on lease tbx_01m30y9jgnpakky4xxfem28a4c (Testbox workflow) and then its replacement listed below. No local tests, typechecks, or builds ran.

  • The new cold-progress regression failed on the original code because the list remained unsettled at 250 ms; the complete-response case passed.
  • 29 existing list-operation tests passed, covering ordering, exclusion filling, paired-node snapshots, and callback ownership.
  • 49 cold-start, request-lifetime, and Gateway progress tests passed, including host/cursor negotiation, shared hydration, and stale-publication fences.
  • Independent Codex autoreview: no actionable P0–P2 findings. A subsequent test-only correction uses the existing public error summary instead of expecting private exception text.

Final result: all 82 focused regression/sibling tests passed, plus the complete changed-file gate (extension production/test typechecks, lint, formatting, ratchets, boundary checks, and import-cycle checks). The pinned-base gate finished successfully in 8m11s including sync. Both task-owned leases were stopped. Full builds and live app-server/deployment testing were outside this lane; PR CI is pending at publication.

Remote commands and recovery history

Every validation command below ran through crabbox run --id <lease> --timing-json -- ..., with normal sync enabled and only one active command. Both leases used blacksmith-testbox / openclaw-check.

On tbx_01m30y9jgnpakky4xxfem28a4c:

  • env OPENCLAW_CATALOG_LOCAL_BENCH=1 node scripts/run-vitest.mjs extensions/codex/src/session-catalog-local-progress.test.ts --maxWorkers=1: first attempt stopped before tests because dependencies were missing. After pnpm install --frozen-lockfile passed, baseline run reproduced the intended cold-progress failure; complete-response and benchmark cases passed.
  • env OPENCLAW_CATALOG_LOCAL_BENCH=1 node scripts/run-vitest.mjs extensions/codex/src/session-catalog-local-progress.test.ts extensions/codex/src/session-catalog-list-operation.test.ts --maxWorkers=1: measured the after result; 32 passed, two new error-message assertions failed. The assertions were corrected to the existing sanitized public error contract; no production change was needed.
  • node scripts/run-vitest.mjs extensions/codex/src/session-catalog-cold-start.test.ts extensions/codex/src/session-catalog-request-lifetime.test.ts src/gateway/server-methods/session-catalog-progress.test.ts: 49 passed, runner wall 36.70 s.
  • pnpm test extensions/codex/src/session-catalog-local-progress.test.ts --maxWorkers=1: two attempts, second with sync diagnostics, stopped before command execution at Blacksmith's two-minute full-sync deadline. Stopped this lease and acquired its replacement; no concurrent leases or sync bypass.

On replacement tbx_01m30z5j5ckdd53te0ca6x8jbs (workflow):

  • A single sequential run installed frozen dependencies, ran pnpm test extensions/codex/src/session-catalog-local-progress.test.ts --maxWorkers=1, then ran node scripts/check-changed.mjs -- <the three changed files> with the remote-child/raw-sync environment. The test passed: four regressions, one opt-in benchmark skipped; test-case time 323 ms, Vitest wall 26.00 s, runner wall 27.37 s including cold compilation.
  • The initial changed-file gate found unrelated line-count differences. git rev-parse HEAD origin/main, git status --short, git diff --stat origin/main, and git log -3 --oneline proved the checkout was the exact candidate base 46e56ca97d44d304337014674965b047507ecfa1 with only these three files changed, while the hydrated origin/main pointed elsewhere. The gate passed with --base 46e56ca97d44d304337014674965b047507ecfa1 and the same three explicit paths; no guard was disabled.

Return pending local hosts after a 250 ms page-wait budget and retain background publication through waitUntil. Preserve resident reads and complete-response callers. Synthetic two-second native page latency fell from 2100.76 ms to 251.49 ms; 82 focused tests and changed-file checks passed on Blacksmith Testbox.
@clawsweeper

clawsweeper Bot commented Sep 21, 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 docs Improvements or additions to documentation extensions: codex size: M maintainer Maintainer-authored PR labels Sep 21, 2026
@steipete
steipete marked this pull request as ready for review September 21, 2026 03:27
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. 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. labels Sep 21, 2026
@clawsweeper

clawsweeper Bot commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 20, 2026, 11:35 PM ET / September 21, 2026, 03:35 UTC.

ClawSweeper review

What this changes

The Codex session catalog now returns pending local hosts after a 250 ms progressive wait, publishes their results asynchronously, and adds regression coverage and documentation.

Merge readiness

✅ Ready for maintainer review

This remains useful work: current main still waits for the local page. No actionable correctness or security findings were identified in the introduced changes.

Priority: P2
Reviewed head: 3206f17aff262d5fe7067c3ae29dc7a484355abd

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused implementation with meaningful regression coverage and clearly stated synthetic-validation limits.
Proof confidence 🌊 off-meta tidepool Not applicable: The maintainer-authored exemption applies. The registered-provider benchmark exercises the changed local catalog owner with a mocked native page; it is useful synthetic evidence, not a live app-server run.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The maintainer-authored exemption applies. The registered-provider benchmark exercises the changed local catalog owner with a mocked native page; it is useful synthetic evidence, not a live app-server run.
Evidence reviewed 9 items Pinned introduced change: Reviewed the merge-base-to-head delta. Local progressive work uses the existing wait helper, registers publication before starting pages, and closes its page in the background completion’s finally block.
Still necessary on current main: Current main’s local readHost awaits page.next without the progressive wait bound. The verified merged paired-node precursor covers a different host path and does not supersede this local improvement.
Latest release check: The released file also awaits the local page without this bound. Local historical blob inspection failed; the read-only GitHub contents API supplied the release source instead.
Findings None None.
Security None None.

How this fits together

The Codex plugin turns native session pages into OpenClaw’s session catalog. The Gateway delivers these results to clients, retaining background publications when a progressive list returns early.

flowchart LR
  A[Catalog request] --> B[Gateway selects response mode]
  B --> C[Codex local catalog]
  D[Resident rows or native page] --> C
  C --> E{Ready within wait budget?}
  E -->|Yes| F[Completed host response]
  E -->|No| G[Pending host response]
  G --> H[Owned background publication]
  D --> H
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +38, Tests +164, Docs +5. Total +207 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 1 41 3 +38
Tests 1 164 0 +164
Docs 1 7 2 +5
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 212 5 +207

Review metrics

Metric Value Why it matters
Synthetic cold-list latency 2,100.76 ms → 251.49 ms The reported registered-provider benchmark demonstrates the intended foreground improvement, using a mocked two-second native response rather than production latency.

Technical review

Best possible solution:

Keep local progressive responses bounded while the existing publication lifetime owns completion and complete-response callers retain their deadlines.

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

Yes, from source: a cold local page holds the current-main list open until it settles. The supplied regression reports that the original code remains unsettled at 250 ms; this review did not execute it.

Is this the best way to solve the issue?

Yes. Reusing the existing partial-response contract and publication owner avoids adding another cache or changing native pagination.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P2: This is a bounded catalog responsiveness improvement without evidence of a core outage or urgent regression.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The maintainer-authored exemption applies. The registered-provider benchmark exercises the changed local catalog owner with a mocked native page; it is useful synthetic evidence, not a live app-server run.

Label justifications:

  • P2: This is a bounded catalog responsiveness improvement without evidence of a core outage or urgent regression.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The maintainer-authored exemption applies. The registered-provider benchmark exercises the changed local catalog owner with a mocked native page; it is useful synthetic evidence, not a live app-server run.

Evidence

What I checked:

Likely related people:

  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; confidence: low)

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.

@steipete
steipete merged commit 221e8ac into main Sep 21, 2026
168 checks passed
@steipete
steipete deleted the steipete/perf-micro-catalog-no-foreground-pages-20260919 branch September 21, 2026 04:19
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

vincentkoc added a commit to jb510/openclaw that referenced this pull request Sep 21, 2026
* commit 'f76d38a4ac5e5f4e6c5a5320436db169e33d5c8a': (49 commits)
  fix(ci): remove duplicate database worker test entry
  fix(voice): keep audio flowing while the Gateway is busy (openclaw#154119)
  docs: reserve Team live updates for Night Watch (openclaw#154425)
  test(meeting-bot): control browser retry fixture clocks (openclaw#149174)
  fix(ui): use remote defaults for manual worktree creation (openclaw#154364)
  fix(proxy): keep WebChat and Codex loopback calls direct (openclaw#154013)
  fix(pr): revalidate head reads and reuse repository locators (openclaw#154212)
  fix(browser): start control when the Gateway has activated the plugin (openclaw#154255)
  improve: publish CI dependencies promptly and warm hosted JavaScript caches (openclaw#154156)
  improve: speed up streaming text with inline brackets (openclaw#154398)
  test: isolate historical Node runner policy from CI
  fix: refresh stale Gateway shutdown budgets during updates and Doctor (openclaw#153636)
  ci: use four Windows workers on the 16 class (openclaw#154261)
  feat: verify GitHub credit from trusted OIDC claims (openclaw#153940)
  feat(sessions): support explicit local placement for child sessions (openclaw#153912)
  fix(ui): prevent stale copies after text changes (openclaw#154259)
  perf(gateway): reuse session list candidates across viewers (openclaw#154003)
  perf(codex): bound progressive local catalog waits (openclaw#154362)
  docs: keep update requests owned through acceptance (openclaw#154111)
  perf(state): reduce main-thread coordinator waits (openclaw#154244)
  ...
vincentkoc added a commit that referenced this pull request Sep 21, 2026
* commit 'f76d38a4ac5e5f4e6c5a5320436db169e33d5c8a': (58 commits)
  fix(ci): remove duplicate database worker test entry
  fix(voice): keep audio flowing while the Gateway is busy (#154119)
  docs: reserve Team live updates for Night Watch (#154425)
  test(meeting-bot): control browser retry fixture clocks (#149174)
  fix(ui): use remote defaults for manual worktree creation (#154364)
  fix(proxy): keep WebChat and Codex loopback calls direct (#154013)
  fix(pr): revalidate head reads and reuse repository locators (#154212)
  fix(browser): start control when the Gateway has activated the plugin (#154255)
  improve: publish CI dependencies promptly and warm hosted JavaScript caches (#154156)
  improve: speed up streaming text with inline brackets (#154398)
  test: isolate historical Node runner policy from CI
  fix: refresh stale Gateway shutdown budgets during updates and Doctor (#153636)
  ci: use four Windows workers on the 16 class (#154261)
  feat: verify GitHub credit from trusted OIDC claims (#153940)
  feat(sessions): support explicit local placement for child sessions (#153912)
  fix(ui): prevent stale copies after text changes (#154259)
  perf(gateway): reuse session list candidates across viewers (#154003)
  perf(codex): bound progressive local catalog waits (#154362)
  docs: keep update requests owned through acceptance (#154111)
  perf(state): reduce main-thread coordinator waits (#154244)
  ...
vincentkoc added a commit that referenced this pull request Sep 21, 2026
* commit 'f76d38a4ac5e5f4e6c5a5320436db169e33d5c8a': (58 commits)
  fix(ci): remove duplicate database worker test entry
  fix(voice): keep audio flowing while the Gateway is busy (#154119)
  docs: reserve Team live updates for Night Watch (#154425)
  test(meeting-bot): control browser retry fixture clocks (#149174)
  fix(ui): use remote defaults for manual worktree creation (#154364)
  fix(proxy): keep WebChat and Codex loopback calls direct (#154013)
  fix(pr): revalidate head reads and reuse repository locators (#154212)
  fix(browser): start control when the Gateway has activated the plugin (#154255)
  improve: publish CI dependencies promptly and warm hosted JavaScript caches (#154156)
  improve: speed up streaming text with inline brackets (#154398)
  test: isolate historical Node runner policy from CI
  fix: refresh stale Gateway shutdown budgets during updates and Doctor (#153636)
  ci: use four Windows workers on the 16 class (#154261)
  feat: verify GitHub credit from trusted OIDC claims (#153940)
  feat(sessions): support explicit local placement for child sessions (#153912)
  fix(ui): prevent stale copies after text changes (#154259)
  perf(gateway): reuse session list candidates across viewers (#154003)
  perf(codex): bound progressive local catalog waits (#154362)
  docs: keep update requests owned through acceptance (#154111)
  perf(state): reduce main-thread coordinator waits (#154244)
  ...
vincentkoc added a commit to vyctorbrzezowski/openclaw that referenced this pull request Sep 21, 2026
* commit 'f76d38a4ac5e5f4e6c5a5320436db169e33d5c8a': (44 commits)
  fix(ci): remove duplicate database worker test entry
  fix(voice): keep audio flowing while the Gateway is busy (openclaw#154119)
  docs: reserve Team live updates for Night Watch (openclaw#154425)
  test(meeting-bot): control browser retry fixture clocks (openclaw#149174)
  fix(ui): use remote defaults for manual worktree creation (openclaw#154364)
  fix(proxy): keep WebChat and Codex loopback calls direct (openclaw#154013)
  fix(pr): revalidate head reads and reuse repository locators (openclaw#154212)
  fix(browser): start control when the Gateway has activated the plugin (openclaw#154255)
  improve: publish CI dependencies promptly and warm hosted JavaScript caches (openclaw#154156)
  improve: speed up streaming text with inline brackets (openclaw#154398)
  test: isolate historical Node runner policy from CI
  fix: refresh stale Gateway shutdown budgets during updates and Doctor (openclaw#153636)
  ci: use four Windows workers on the 16 class (openclaw#154261)
  feat: verify GitHub credit from trusted OIDC claims (openclaw#153940)
  feat(sessions): support explicit local placement for child sessions (openclaw#153912)
  fix(ui): prevent stale copies after text changes (openclaw#154259)
  perf(gateway): reuse session list candidates across viewers (openclaw#154003)
  perf(codex): bound progressive local catalog waits (openclaw#154362)
  docs: keep update requests owned through acceptance (openclaw#154111)
  perf(state): reduce main-thread coordinator waits (openclaw#154244)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 22, 2026
Return pending local hosts after a 250 ms page-wait budget and retain background publication through waitUntil. Preserve resident reads and complete-response callers. Synthetic two-second native page latency fell from 2100.76 ms to 251.49 ms; 82 focused tests and changed-file checks passed on Blacksmith Testbox.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation extensions: codex maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. 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