Skip to content

test(sessions): assert frozen nested patch results after #186051 - #186180

Merged
steipete merged 1 commit into
mainfrom
steipete/fix-session-row-frozen-patch-result-test-20261027
Oct 27, 2026
Merged

steipete merged 1 commit into
mainfrom
steipete/fix-session-row-frozen-patch-result-test-20261027

Conversation

@steipete

Copy link
Copy Markdown
Contributor

Problem

Main is red. src/config/sessions/session-accessor.sqlite-session-row.test.ts > records committed owner facts before cancellation observers fails with TypeError: Attempted to assign to readonly property. Bisect between r240 (7bce7a61, where the test passes) and main pins the first bad commit at 126c3b55, "perf(sessions): share frozen nested patch results internally" (#186051).

Cause

#186051 changed the internal contract on purpose. Internal session-entry patch results now keep independent top-level fields but share the frozen publication's nested facts. Plugin SDK egress keeps the fully mutable copy. Its caller audit found no internal nested-result mutation. This test still pushed into a nested result array (result.skillsSnapshot.skills), which the old deep copy allowed. The changed-test selection for #186051 did not run this file.

Fix

Assert the new internal contract: mutating the nested result throws TypeError, and the stored entry is unchanged. Production code is unchanged.

Proof

  • On main, the file fails 1/8 with the readonly error.
  • With this change it passes 8/8.

#186051 intentionally made internal session-entry patch results share the
frozen publication's nested facts (SDK egress keeps the mutable copy). The
session-row test still mutated a nested result array, so it failed on main
with 'Attempted to assign to readonly property'. Assert the new internal
contract: nested mutation throws and the stored entry is unchanged.
@clawsweeper

clawsweeper Bot commented Oct 27, 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.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 27, 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-27T17:52:34.186824Z 51fab1e PR opened
ℹ️ 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.

@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. P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed 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 27, 2026
@clawsweeper

clawsweeper Bot commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR changes an existing session-store test to expect nested patch-result mutation to throw while preserving the stored-state assertion.

Example: The session-row test pushes a skill named caller-only into a returned skills snapshot.

  • Before: The frozen array throws an uncaught TypeError and fails the test.
  • After: The test expects TypeError and then verifies the stored snapshot remains unchanged.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The patch is minimal and source-consistent; validation evidence consists of the reported focused test results rather than independently inspected execution output.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored test-only repair changes no shipped behavior; the supplied evidence reports the real session-store test failing before and passing after the assertion update.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Test only · Worth it: Yes · Fix scope: Complete
User problem: Session-store validation fails because an existing test assumes nested internal patch results remain mutable.
Reason: The maintainer-authored repair aligns an existing test with an explicitly intentional contract and preserves its meaningful assertions.

Regression provenance

Regression provenance — verified: source commit 126c3b55f470 by Peter Steinberger; canonical PR #186051 (blame-to-merge-commit).

Merge readiness

✅ Ready for maintainer review

Keep this PR open: it makes the smallest correct test repair for an intentional internal contract change, with no actionable code or security findings.

Priority: P2
Reviewed head: 51fab1e5adc29498e6f6f9a3b1162fe81689c642

Before merge

None.

Findings

None.

Agent review details

How this fits together

Session accessors send metadata patches through the SQLite worker and publication owner; internal callers receive independently mutable top-level results with frozen nested facts.

flowchart LR
  A[Session row test] --> B[Session accessor]
  B --> C[SQLite patch worker]
  C --> D[Frozen publication]
  D --> E[Internal patch result]
  E --> F[Mutation rejection assertion]
Loading

Technical review

Best possible solution:

Retain this focused assertion repair and the existing ordering and persistence checks without changing production mutability.

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

The current-main test performs an unguarded push into nested data frozen by the patch decoder, directly explaining the reported TypeError; execution was not repeated during this read-only review.

Is this the best way to solve the issue?

This is the smallest complete fix: expect the intentional mutation rejection while retaining the independent checks of publication ordering and unchanged stored data.

AGENTS.md: found and applied where relevant.

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

Provenance checked

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 126c3b5 adds src/config/sessions/session-entry-patch.ts:122 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 126c3b55f470; files: src/config/sessions/session-entry-patch.ts)

PR surface

Tests +1. Total +1 across 1 file. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 2 1 +1
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 2 1 +1

Labels

Label changes:

  • add P2: This repairs a concrete test-suite failure without changing shipped runtime behavior.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P2: This repairs a concrete test-suite failure without changing shipped runtime behavior.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed October 27, 2026, 2:05 PM ET / 18:05 UTC.

@steipete

Copy link
Copy Markdown
Contributor Author

Admin-merging over checks-fast-baseline-ratchets (and the ci-gate that rolls it up). The only failing step is test-lines: "over by: 552; net delta: +1". main is already 551 lines over the ceiling, which is inherited from earlier landings, and ceiling raises are pending maintainer decision. This PR adds one line: the regression assertion for the #186051 frozen-result contract. Every other check is green at 51fab1e5adc2.

The fix is test-only and repairs the red main failure in session-accessor.sqlite-session-row.test.ts, so merging it now unblocks other PRs.

@steipete
steipete merged commit c90ff3d into main Oct 27, 2026
115 of 119 checks passed
@steipete
steipete deleted the steipete/fix-session-row-frozen-patch-result-test-20261027 branch October 27, 2026 18:15
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 28, 2026
 (openclaw#186180)

openclaw#186051 intentionally made internal session-entry patch results share the
frozen publication's nested facts (SDK egress keeps the mutable copy). The
session-row test still mutated a nested result array, so it failed on main
with 'Attempted to assign to readonly property'. Assert the new internal
contract: nested mutation throws and the stored entry is unchanged.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: XS 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