Skip to content

fix(sessions): clone exact-entry env before worker transport - #157348

Closed
yashas-13 wants to merge 3 commits into
openclaw:mainfrom
yashas-13:fix/windows-exact-session-env-clone
Closed

yashas-13 wants to merge 3 commits into
openclaw:mainfrom
yashas-13:fix/windows-exact-session-env-clone

Conversation

@yashas-13

Copy link
Copy Markdown
Contributor

Fixes #157067.

The exact-session-entry worker reader forwarded input.env directly across the worker boundary. On Windows, that environment can be the Proxy returned by cloneEnvWithPlatformSemantics, which Node worker structured cloning rejects with DataCloneError.

This patch:

  • materializes env into a plain object before session-exact-entries transport;
  • copies the session-key and continuation arrays/objects at the same boundary;
  • adds a regression test using a Proxy environment and structuredClone.

The sibling session-row-facts reader already follows this materialization pattern.

@chatgpt-codex-connector

Copy link
Copy Markdown
Contributor

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@clawsweeper

clawsweeper Bot commented Sep 24, 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 size: S triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. labels Sep 24, 2026
@clawsweeper clawsweeper Bot added P1 High-priority user-facing bug, regression, or broken workflow. 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. labels Sep 24, 2026
@clawsweeper

clawsweeper Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed September 26, 2026, 10:58 AM ET / 14:58 UTC (Revision 2).

ClawSweeper review

What this changes

The branch copies the environment and related request fields into cloneable values before sending exact session-entry reads to a worker, and adds a proxy-environment regression test.

Merge readiness

⛔ Blocked before merge - 2 items remain

The Windows worker-cloning defect remains on current main, and this is a focused repair. A newer open PR addresses the same boundary, but its landing viability is unverified, so this branch should stay open.

Priority: P1
Reviewed head: ef5fe3cb096742ade6b94a8e2be21c3f316048ce

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The narrow patch addresses the source-proven boundary, but branch-specific after-fix behavior proof is absent.
Proof confidence 🦪 silver shellfish (2/6) Needs real behavior proof before merge: The changed production reader would snapshot the environment before real worker transport, but this branch shows only an injected-runner structured-clone test. The linked issue demonstrates the prior Windows failure, and a different PR reports recovery after an equivalent hot patch; neither shows this branch running the affected automation. A redacted terminal trace or logs from an after-fix Windows run would establish that result. Updating the PR body should trigger review; otherwise a maintainer can request @clawsweeper re-review. Redact private values before posting. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Needs proof Needs real behavior proof before merge: The changed production reader would snapshot the environment before real worker transport, but this branch shows only an injected-runner structured-clone test. The linked issue demonstrates the prior Windows failure, and a different PR reports recovery after an equivalent hot patch; neither shows this branch running the affected automation. A redacted terminal trace or logs from an after-fix Windows run would establish that result. Updating the PR body should trigger review; otherwise a maintainer can request @clawsweeper re-review. Redact private values before posting. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed 8 items Introduced patch: The introduced hunk snapshots the environment, session keys, and continuation before preparing the exact-entry worker request.
Current-main gap: Fetched current main still forwards the exact-entry input unchanged, while the sibling row-facts reader snapshots its environment.
Windows source: The platform environment clone is a Proxy on Windows; a Proxy cannot be passed through worker structured cloning.
Findings None None.
Security None None.

How this fits together

Isolated automation setup reads session entries through a worker. The session reader prepares a request from the caller's environment and session keys, then the worker reads SQLite and returns the entries.

flowchart LR
  A[Isolated automation] --> B[Session entry request]
  B --> C[Cloneable request snapshot]
  C --> D[Worker transport]
  D --> E[SQLite session read]
  E --> F[Session entries]
Loading

Before merge

  • Add real behavior proof - Needs real behavior proof before merge: The changed production reader would snapshot the environment before real worker transport, but this branch shows only an injected-runner structured-clone test. The linked issue demonstrates the prior Windows failure, and a different PR reports recovery after an equivalent hot patch; neither shows this branch running the affected automation. A redacted terminal trace or logs from an after-fix Windows run would establish that result. Updating the PR body should trigger review; otherwise a maintainer can request @clawsweeper re-review. Redact private values before posting. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • Complete next step (P2) - Add branch-specific redacted Windows worker or cron after-fix proof, and record the new test's measured wall time and available CI seconds in the PR body.
Agent review details

Security

None.

PR surface

Source +7, Tests +38. Total +45 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 12 5 +7
Tests 1 38 0 +38
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 50 5 +45

Review metrics

None.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #157067
Summary: This PR targets the exact worker-serialization failure in the canonical Windows report; another open PR proposes the same boundary repair.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Technical review

Best possible solution:

Land one focused worker-boundary repair with observed Windows cron recovery, then resolve the overlapping PRs and linked reports without maintaining parallel fixes.

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

Yes, from source and the linked Windows failure trace: the platform clone is a Proxy, and current main forwards it into a structured-cloned worker request. I did not execute the path in this read-only review.

Is this the best way to solve the issue?

Yes, copying the environment at the existing worker boundary matches the sibling reader's approach. A real worker or Windows cron run should confirm the branch's after-fix behavior.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The changed production reader would snapshot the environment before real worker transport, but this branch shows only an injected-runner structured-clone test. The linked issue demonstrates the prior Windows failure, and a different PR reports recovery after an equivalent hot patch; neither shows this branch running the affected automation. A redacted terminal trace or logs from an after-fix Windows run would establish that result. Updating the PR body should trigger review; otherwise a maintainer can request @clawsweeper re-review. Redact private values before posting. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • remove proof: sufficient: Current real behavior proof status is mock_only, not sufficient.
  • remove rating: 🐚 platinum hermit: Current PR rating is rating: 🦪 silver shellfish, so this older rating label is no longer current.
  • remove status: 👀 ready for maintainer look: Current PR status label is status: 📣 needs proof.

Label justifications:

  • P1: The linked Windows reports describe isolated agent automations failing before inference on the current release.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The changed production reader would snapshot the environment before real worker transport, but this branch shows only an injected-runner structured-clone test. The linked issue demonstrates the prior Windows failure, and a different PR reports recovery after an equivalent hot patch; neither shows this branch running the affected automation. A redacted terminal trace or logs from an after-fix Windows run would establish that result. Updating the PR body should trigger review; otherwise a maintainer can request @clawsweeper re-review. Redact private values before posting. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • RoboClaw: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Add a redacted after-fix Windows exact-entry worker or isolated cron run showing the request completes.
  • State the new test's measured wall time and available CI seconds in the PR body.

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 (1 earlier review cycle)
  • reviewed 2026-09-24T15:12:08.626Z sha ef5fe3c :: needs changes before merge. :: none

@clawsweeper clawsweeper Bot added 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. and removed 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. labels Sep 26, 2026
@clawsweeper

clawsweeper Bot commented Sep 27, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper status: review started.

I am starting a fresh review of this pull request: fix(sessions): clone exact-entry env before worker transport This is item 2/3 in the current shard. Shard 63/76.

This temporary status tracks the active review worker. The completed review will appear in the durable ClawSweeper review comment.

Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted.

@WG-Mojo

WG-Mojo commented Sep 27, 2026

Copy link
Copy Markdown

I'm the author of #157067. Our native-Windows results support the core environment-materialization change here: #157067 (comment).

We built an equivalent local repair from v2026.9.6 using env: { ...input.env } at the exact-entry request boundary. The rebuilt worker successfully read an existing Windows session database through readSessionEntriesFromStoreInWorker. After installing that package, a traced isolated cron recovery completed session-exact-entries and advanced through identity reads into model-catalog preparation without the original DataCloneError.

This is supporting evidence for the repair mechanism, not validation of this PR's exact head (ef5fe3cb096742ade6b94a8e2be21c3f316048ce) or its additional session-key/continuation copies. It also does not establish end-to-end cron success: subsequent worker/preparation delays remained and were investigated separately in #155859. I would keep that distinction when adding evidence to the PR body; the branch-specific Windows proof requested by ClawSweeper is still outstanding.

Investigation and this comment assisted by Codex.

@steipete

Copy link
Copy Markdown
Contributor

Thanks, @yashas-13, for the exact-entry environment Proxy investigation and proposed repair. I’ve carried the finding forward in #160075, which covers both the registered exact-entry reader and the earlier session-store discovery transport, with real-worker regression proof. You’re credited in the PR body and commit. Closing this overlapping PR so review and the pending native Windows CI validation can continue in one place.

@steipete steipete closed this Sep 28, 2026
steipete added a commit that referenced this pull request Sep 29, 2026
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]>
steipete added a commit that referenced this pull request Sep 29, 2026
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]>
steipete added a commit that referenced this pull request Sep 29, 2026
)

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).
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 30, 2026
…claw#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 openclaw#157067. Closes openclaw#159339. Supersedes openclaw#157109 and openclaw#157348 (closed with credit).

Landed under the pre-existing-red rule (openclaw#161124 and session-store main reds).
RomneyDa added a commit that referenced this pull request Oct 1, 2026
* 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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P1 High-priority user-facing bug, regression, or broken workflow. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: S status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Windows isolated cron setup passes an uncloneable environment Proxy to session history worker

3 participants