Repository navigation
fix(sessions): restore Windows cron setup and session admission - #160075
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: blocked before merge. Reviewed September 29, 2026, 9:46 AM ET / 13:46 UTC (Revision 14). ClawSweeper reviewWhat this changesThe branch captures cloneable storage-environment facts before session worker requests, restores Windows environment lookup inside the worker, and adds regression and Windows CI coverage. Regression provenancePossible regression — suspected (failure trace). No predecessor PR is attributed. Merge readiness⛔ Blocked before merge - 2 items remain Current main still has the Windows worker-transfer defect, and native Windows evidence supports this repair. The PR remains useful, but its closing reference would prematurely close a broader issue with separately reported symptoms. Priority: P1 Review scores
Verification
How this fits togetherCron preparation and Gateway session admission read session rows through a shared worker. The caller supplies a session target and storage context; the worker locates the SQLite store and returns session facts or an error. flowchart LR
A["Cron or chat request"] --> B["Session target"]
B --> C["Capture storage facts"]
C --> D["Worker transport"]
D --> E["Store discovery and SQLite read"]
E --> F["Session facts or error"]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +39, Tests +100, Config 0, Other +5. Total +144 across 9 files. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Land the worker transport repair through the normal exact-head gates while keeping the broader cron report available for its distinct symptoms. Do we have a high-confidence way to reproduce the issue? Yes for the worker defect: current-main source exposes the Proxy transfer, and the supplied native Windows comparison shows the affected flows failing before the repair and succeeding afterward. The broader linked report's distinct symptoms have not all been reproduced through this patch. Is this the best way to solve the issue? Yes for the demonstrated defect: capture cloneable storage facts at the worker boundary and restore Windows lookup semantics in the worker. The linked issue closure must match that narrower scope. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 099380708f99. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (13 earlier review cycles; latest 8 shown)
|
b5d0b78 to
4710cc9
Compare
Consolidate equivalent embedded-runner projections and owner helpers, remove unused plumbing, and simplify redundant branches while preserving run authority, cancellation, prompt/transcript bytes, tool policy, transport shaping, and usage accounting. Production change: 361 added / 1,002 removed, net -641 lines. Preserve real model-selection exports in the command test mock. Missing provider maps return undefined on both main and the refactor; the legacy automatic fallback still wins over the colliding alias. Keep the unchanged collision configuration in the existing fixture helper to satisfy the line-cap ratchet. Validation: main/PR comparison with model-selection fully unmocked; 138 command tests; all 20 facade-mocking siblings plus embedded runner tests (355 files / 5,827 tests); final check-changed; independent autoreview through P2. No production behavior change is claimed. Related: #159597 Exact-head CI exception: checks-node-compact-small-18 has the same two sparse-runner missing-prerequisite failures as unrelated PR #160075 run 36528303180. All other execution jobs passed or skipped. See PR Evidence.
4fd4b77 to
4f3397d
Compare
Capture plain storage environment facts before exact-entry and store-discovery worker dispatch, and restore platform lookup semantics inside the worker. Reuse the storage environment owner while copying only its routing inputs. Cover admission and configured-store cron preparation with the Windows env Proxy through real worker transport, and include the regressions in Windows CI. Closes #157067 Closes #159339 Refs #157109 #157348 Co-authored-by: Aniket Kumar <[email protected]> Co-authored-by: Yashas Prakash <[email protected]>
Move the Windows environment Proxy cases into their own suite and point the Windows CI target at that owner. Await the asynchronous database admission claim release during test cleanup. Validation: separate local runs passed 2 storage-environment tests and 13 preparation tests; oxfmt, focused type-aware lint, and P1 review passed.
Normalize planner sums to their recorded tenth-second precision so floating-point drift does not turn 424 seconds into 425. Keep the Windows inventory and budget unchanged. Restore platform environment semantics directly on each worker-owned request, removing redundant envelope copies and keeping the worker within its line cap.
4f3397d to
9f63c38
Compare
|
Native Windows result for this PR's head, since the body notes native Windows execution was unavailable. Setup. Windows 11 (10.0.26200), Node 24.21.0. Each build from source with
On this PR's head there are zero About 2026.9.7.
|
* fix(sessions): restore Windows cron setup and session admission (#160075) Windows cron isolated-agent runs and session transcript discovery failed with DataCloneError because the request carried the Windows process-environment proxy into the transcript worker. Exact-entry and discovery requests now capture a plain, bounded storage environment and the worker restores Windows lookup semantics. Closes #157067. Closes #159339. Supersedes #157109 and #157348 (closed with credit). Landed under the pre-existing-red rule (#161124 and session-store main reds). (cherry picked from commit a181c3f) * fix(codex): avoid browser auth in CUA readiness (#162467) (cherry picked from commit 9f9dab3) * chore(release): prepare 2026.9.7-1 * chore(release): prepare 2026.9.8 * fix(gateway): normalize quiescence recovery diagnostics Keep the retained watchdog recovery error consistent with the single-line workspace sync error surfaced to operators on single-digit days. Preserve raw ps start identities for signal guards and existing watchdogs. Make the existing exhaustion regression calendar-independent with padded lstart input, retaining the exact recoveryError assertion and proving that all stopped workers resume after process probes recover. Verified the original UTC failure and the deterministic pre-fix failure. The full quiescence script file passes under UTC, the exact regression passes in the default timezone, and 15 sibling tests pass. Core typecheck, formatting, diff checks, and independent review also pass. --------- Co-authored-by: Peter Steinberger <[email protected]>
Closes #157067
Closes #159339
Refs #157109 #157348
What Problem This Solves
Windows cron agent turns and session admission can fail before execution with
DataCloneErrorwhen a case-insensitive environment Proxy reaches a session-history worker.User Impact
Restores session reads during Windows cron setup and admission, including configured stores that require discovery. No configuration, database schema, dependency, or migration changes are required.
Why This Change Was Made
Capture plain storage facts at both the registered exact-entry request builder and the session-store discovery request builders, then restore platform environment semantics inside the worker. The existing storage-environment owner supplies the resolved state directory and external-supervisor mode; it now reads only the bounded inputs needed to resolve those facts instead of copying the whole environment. Local admission, retained database authority, and configured path resolution stay with their existing owners.
Thanks to @aniketkrs and @yashas-13 for identifying and proposing the exact-entry environment capture in the referenced PRs. This replacement covers the earlier discovery transport as well. Both GitHub-linked human commit authors are credited in the commit.
Evidence
tbx_01m3jtnz69vq5cq2thp03vv3qn: exact-entry admission and configured-store cron preparation both failed before the fix withDataCloneError(136 ms / 32 ms).f5e5f75f2b775adef5fd87f5cd5d5017fe2d086b(refactor(config): deslop config fifth pass #161076). One rebase onto88e0f4ac3acc0539ff05b144d8a452ebde3c4e9epreserves that rewrite: the worker differs from main by only two environment-normalization assignments insidereadRequest. The shared database/reply boundary, direct reader returns, and removed wrappers remain as main defines them. Package JSON retains main plus the focused Windows test target.9f63c38245d962c3b762f28f579c306df742217e, tested tree803cab09db8a2ff82600dcac4456b3f6213f4b15. Fresh proof ran on Linux Blacksmith Testbox run 36554368452, leasetbx_01m3pahxwxz4z19pfcrrq44v8s, with physical cwd and source SHA-256 checks.node scripts/run-vitest.mjs: 741 passed, one existing skip, six project groups in 295.59 seconds. This includes both Windows-shaped Proxy transports, general cron preparation, worker error/cleanup behavior, storage snapshots, and the Windows planner/importer. No individual test exceeded 30 seconds.node scripts/check-changed.mjsran on Testbox. The earlier feat: connect Agents API sessions to HTTP MCP servers #160931 SDK surface-budget failure now passes on this fetched base; no baseline was edited. Core types, all 27 core test-type shards, script types, formatting, ratchets, dead-export scans, and other preceding guards passed. Core lint reported one inherited max-lines error:ui/src/pages/model-setup/model-setup-page.ts, 705/700. That file and.oxlintrc.jsonare byte-identical to the tested main base. Every subsequent selected check passed separately on the same verified tree, including script lint (0 warnings / 0 errors across 1,256 files), schema, storage, media, runtime-sidecar, import-cycle, webhook, and pairing guards. The full gate is recorded as failed on inherited lint, not as a clean pass.a1ec6f7f4e1de7f2f27b52055096020f541b194f.git merge-tree --write-tree origin/main HEADexited 0 without conflicts and produced treebb4c2c36017791d0191fb46d98104d5b23cffee7. The reviewed/tested candidate was not changed after validation.CI classification: run 36397803629
Inspected the exact tested merge
9e8c473d2a0356d0e3fbe4e8d76f01093aceeddb(PR headb74b8f91a9224455e409634c2d03bc1f33fcf770, base40019980f2687648942b0788fb8523fef58ff7ff). Its tree is identical to the PR head:5a272aa3e1b254465c9133e072f02f530e38d16a.Both actual Node test failures are inherited from scheduled main
c7f4733f33a90442f7ddf5abea7b647c8e4dbd14, run 36399583824:core-runtime-infra-storage-state-hosted-28, has the same 120-second timeouts andretryRestartAbortedMainSessionRecoverycalled twice instead of once inreply-turn-admission.recovery.test.ts. That test has the same Git blob on the PR, its exact main base, and this failing main run. The PR failure belongs tocore-runtime-infra-storage-state-hosted-13, not the Doctor shard.core-runtime-infra-heartbeat-runner-hosted-1, fails the identicaldoes not infer admission rejection from a replacement run after an empty heartbeatassertion (failedversusran). Its test blob is also unchanged.The Doctor shard passed all 282 tests. Its
foreign_key_checkwarning comes from the schema-preparation fixture deliberately inserting an orphan row and asserting refusal. The agents-support shard passed 420 tests (3 existing skips);engine cleanup failedis deliberately thrown by its disposal-failure fixtures, separate from the heartbeat assertion. All five Windows jobs in the PR run succeeded.Replayed the recorded recovery and heartbeat group plans on Linux Blacksmith Testbox, lease
tbx_01m3kmfsqvfq50g0x3yt939j14, with the exact merge tree and source hashes verified. Recovery passed once (635 passed, 1 skipped; 350.95 seconds); this does not establish a fix for its intermittent main failure. Heartbeat reproduced the identical failure (111 passed, 1 failed; 162.38 seconds). The lease is stopped.No source change or fix push resulted from this classification. Auto-merge remains enabled. The separate CI compiler-sharing error was outside this investigation.