Repository navigation
test(sessions): assert frozen nested patch results after #186051 - #186180
Conversation
#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.
|
🦞👀 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. |
|
Codex review: needs maintainer review before merge. What this changesThis 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.
Review scores
ProductKind: Test only · Worth it: Yes · Fix scope: Complete Regression provenanceRegression provenance — verified: source 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 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherSession 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]
Technical reviewBest 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
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceTests +1. Total +1 across 1 file. Added test files: 0. View PR surface stats
LabelsLabel changes:
Label justifications:
Rating scale6/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. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 27, 2026, 2:05 PM ET / 18:05 UTC. |
|
Admin-merging over The fix is test-only and repairs the red |
(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.
Problem
Main is red.
src/config/sessions/session-accessor.sqlite-session-row.test.ts > records committed owner facts before cancellation observersfails withTypeError: Attempted to assign to readonly property. Bisect between r240 (7bce7a61, where the test passes) and main pins the first bad commit at126c3b55, "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