Repository navigation
fix(gateway): revert cold session list worker regression - #174052
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
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. |
There was a problem hiding this comment.
💡 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".
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.
* 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) ...
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.
…4052) * fix(gateway): keep session lists available during worker warmup * fix(gateway): revert cold session list worker regression
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 head874f705baafbeb8665c774ea01a35f8de7307bd9. 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 loopbackauth: 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:
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), andsession-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 requiredopenclaw/ci-gatechecks 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.