Skip to content

fix(gateway): revert cold session list worker regression - #174052

Merged
steipete merged 2 commits into
mainfrom
steipete/fix-session-list-worker-cold-start
Oct 16, 2026
Merged

steipete merged 2 commits into
mainfrom
steipete/fix-session-list-worker-cold-start

Conversation

@steipete

@steipete steipete commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Revert #173932 because cold session-list initialization delays clients reconnecting after a Gateway restart. The attempted startup warmup and prepared-row fallback did not meet the cold/storm gates, so this takes the requested release-freeze fallback.

User Impact

Session lists again use the existing prepared main-thread projection. The dedicated list worker, duplicated roster, and asynchronous rendering round trips are removed. This gives up steady-state offloading to restore cold/reconnect behavior.

Why This Change Was Made

The final diff is exactly the inverse of #173932: all 46 affected paths match its parent byte for byte, and intervening main changes are preserved. No warmup/fallback code remains. Selected-row preparation feeds the existing synchronous selection, sharing, and presentation boundary.

Production delta: 466 additions, 1,622 deletions, net -1,156 lines, excluding tests, test support, and docs. No schema, configuration, dependency, or public API change.

Evidence

Matched source comparison: exact PR base 330ce7f06f38bd51ce6c080fd2a932fe87ed27a0 → reverted head 874f705baafbeb8665c774ea01a35f8de7307bd9. Both runtime builds passed on the Linux benchmark rig. Every reverted snapshot path was verified against the committed source.

The same synthetic fixture contains 13,000 sessions and 6,000 retained executions. Each revision receives three fresh-start single-client trials and three fresh-start 50-client trials. Immediately after /readyz, separate WebSocket clients complete the connect handshake under loopback auth: none, with the same synthetic operator/admin audience, then issue their first sidebar list (archived: all, limit 100). No prior list or artificial settling delay. Every response contains 100 rows and totalCount 13,000; the session-entry hash stayed unchanged.

Medians across three launches; ranges shown for the primary latency metrics:

Metric Before Revert
Cold first-list latency 4.279 s [3.663–5.646] 0.325 s [0.322–0.341]
50-client storm p99 5.487 s [5.048–5.870] 2.494 s [1.906–2.882]
Ready → first cold response 4.401 s 0.424 s
Ready → last storm response 6.364 s 3.572 s
Cold main-thread CPU/request window 3,827 ms 337 ms
Storm main-thread CPU/op (burst total ÷ 50) 103.8 ms 46.1 ms
Worst measured cold synchronous callback 628 ms 142 ms
Worst measured storm synchronous callback 402 ms 479 ms
Cold readiness time 18.390 s 18.521 s
Storm readiness time 17.232 s 19.463 s
Spawn → last storm response 23.544 s 23.035 s
Process RSS after fixed post-response wait, cold 2,288 MiB 1,922 MiB
Process RSS after fixed post-response wait, storm 2,199 MiB 2,097 MiB

The dedicated worker retained about 132 MiB of used JS heap before the revert and is absent in all six reverted observations. The matched process RSS reductions are 366 MiB cold / 102 MiB storm. Worker threads share RSS; these are whole-process differences including startup and GC effects, not invented per-thread RSS. Memory is sampled after the same five-second wait and memory IPC, before any supporting untimed request.

The rollback restores roughly the original pre-worker result: cold median 389 ms and storm p99 median 2.450 s. Reverted storm p99 is 1.8% higher with overlapping three-run ranges. The rejected warmup/fallback, measured as a three-production-file overlay on the original worker merge, still took 5.051 s cold and 5.298 s storm p99. Its independent RPC timing failed the cold gate. The candidate’s internal diagnostic timer omitted synchronous fallback selection, so it cannot reliably attribute that delay to readiness waiting; those diagnostic values are not used for the tables above.

Limits: shared-rig contention was uncontrolled. Storm readiness increased in this sample, and spawn-to-last-response ranges overlap (23.136–26.399 s before; 22.502–24.998 s after), so this does not establish an overall restart-time improvement. The worst storm callback also increased despite a lower median. Main-thread CPU includes overlapping startup work; callback timing does not measure an entire microtask-chain stall. This is not credential-authentication or 50-distinct-user performance proof. The older pre-worker campaign retained an 11.56-second storm outlier. One reverted launch failed to bind the owned port before any request; after verifying listener/process absence, the unchanged campaign completed all six trials. No measured trial was discarded.

Autoreview: no actionable P0–P2 findings in the revert. The two GitHub review comments concern diagnostic accounting and worker-loss fallback in the superseded warmup candidate; both paths are removed by this complete revert. Changed-file format/lint passed. Focused files passed 26/26, sequentially with one worker: session-row-selection.test.ts (9), session-utils.perf.test.ts (8), session-row-projection.list-page.test.ts (6), and session-row-publication-authority.test.ts (3). The last file protects recipient isolation. No Testbox/Crabbox was allocated; no broad checks ran locally.

Exact-head PR CI completed successfully for 874f705baafbeb8665c774ea01a35f8de7307bd9, including build, Node tests, type/lint, all UI end-to-end shards, and PostgreSQL conformance. Both required openclaw/ci-gate checks passed. Superseded candidate failures were not treated as inherited failures or rerun. The owned rig Gateway was stopped and its worktree/state removed after evidence capture.

@clawsweeper

clawsweeper Bot commented Oct 16, 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 October 16, 2026 09:09
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-16T09:29:57.322182Z 874f705 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime size: M labels Oct 16, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 728286bf10

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/gateway/session-utils-list.ts Resolved
Comment thread src/gateway/session-utils-list.ts Resolved
@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. labels Oct 16, 2026
@steipete steipete changed the title fix(gateway): keep session lists available during worker warmup fix(gateway): revert cold session list worker regression Oct 16, 2026
@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling size: XL and removed docs Improvements or additions to documentation size: M labels Oct 16, 2026
steipete added a commit that referenced this pull request Oct 16, 2026
Recent owner migrations left mountLitContent, PluginToolIcon, and
createLaneQueue exported without production consumers. Keep them private;
exercise Lit retention through LitContent and construct test queues through
the existing lane-state owner. Preserve all test cases and assertions.

Hourly 38875037669 first reported the UI findings. Current-main scans also
found the queue factory and session row presenter. Leave presentedContent,
renderChatSelectionAnnotations, and presentSessionRow to their covering
PRs #174019, #174023, and #174052. The last restores a production presenter
consumer by reverting #173932; no competing row repair is included here.

Proof: all three deadcode commands before/after, 71 focused cases,
core/UI production and owning test types, boundary lint, format, assertion
safety, line-cap and Lit ratchets, and clean P2 review. Scoped lint reports
only the inherited queue-test size violation: the exact baseline has 1032
counted lines and this patch reduces it to 1025 against the unchanged 1000
limit. No ignores, suppressions, retries or timeout changes were added.

Changed-test timings with --maxWorkers=1: queue 67.12s, cancellation 3.67s,
Lit boundary 3.56s test-runner time (outer wall not separately captured).
The inherited queue process tests and worker preparation dominate its wall.
Production algorithms and emitted runtime behavior are unchanged.
@steipete
steipete merged commit 8bb3d40 into main Oct 16, 2026
198 of 202 checks passed
@steipete
steipete deleted the steipete/fix-session-list-worker-cold-start branch October 16, 2026 09:47
vincentkoc added a commit that referenced this pull request Oct 16, 2026
* commit 'ac03ca0b6d26a7dc55d0d262e40d2549631b1ea7': (25 commits)
  fix: apply shared plugin model policy to decisions (#156621)
  perf: shortlist transcript relevance scores before metadata reads (#174058)
  fix: strip standalone trailing NO_REPLY from replies (#171990)
  fix(ci): avoid repeated discovery during changed-test planning (#174069)
  fix(sqlite): preserve transaction outcomes when warnings throw (#157151)
  fix(ai): native video handoff to chat-completions providers + preflight video cost (#170920)
  fix(litellm): image generation fails when the backend returns image URLs (#173508)
  test(memory,gateway,infra,subagents): remove low-value tests (batch d152) (#174034)
  perf(memory): bound derived worker snapshot and pricing retention (#174067)
  fix(test): reduce eager imports during test startup (#174056)
  refactor(codex): share lifecycle preflight fixtures (#174062)
  test(gateway,matrix,agents,ui): remove low-value tests (batch d150) (#174025)
  perf(infra): batch usage refresh maintenance (#174050)
  fix(gateway): revert cold session list worker regression (#174052)
  refactor(config): consolidate browser meeting configuration (#173947)
  fix(cron): keep global-session deliveries on the selected agent (#173855)
  test(compaction): assert structured stale-writer failure (#174064)
  fix(cli): local terminal chat sends model requests without the configured proxy (#173530)
  test(ui): restore bootstrap preference locale after each case (#174065)
  fix: download session files through the development proxy (#173973)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 17, 2026
Recent owner migrations left mountLitContent, PluginToolIcon, and
createLaneQueue exported without production consumers. Keep them private;
exercise Lit retention through LitContent and construct test queues through
the existing lane-state owner. Preserve all test cases and assertions.

Hourly 38875037669 first reported the UI findings. Current-main scans also
found the queue factory and session row presenter. Leave presentedContent,
renderChatSelectionAnnotations, and presentSessionRow to their covering
PRs openclaw#174019, openclaw#174023, and openclaw#174052. The last restores a production presenter
consumer by reverting openclaw#173932; no competing row repair is included here.

Proof: all three deadcode commands before/after, 71 focused cases,
core/UI production and owning test types, boundary lint, format, assertion
safety, line-cap and Lit ratchets, and clean P2 review. Scoped lint reports
only the inherited queue-test size violation: the exact baseline has 1032
counted lines and this patch reduces it to 1025 against the unchanged 1000
limit. No ignores, suppressions, retries or timeout changes were added.

Changed-test timings with --maxWorkers=1: queue 67.12s, cancellation 3.67s,
Lit boundary 3.56s test-runner time (outer wall not separately captured).
The inherited queue process tests and worker preparation dominate its wall.
Production algorithms and emitted runtime behavior are unchanged.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 17, 2026
…4052)

* fix(gateway): keep session lists available during worker warmup

* fix(gateway): revert cold session list worker regression
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling 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. gateway Gateway runtime size: XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant