Repository navigation
fix(test): capture the SQLite close method without an unbound reference - #204397
Conversation
Co-authored-by: obviyus <[email protected]>
|
🦞👀 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: needs maintainer review before merge. What this changesThis PR captures SQLite’s native close method through Reflect.get while preserving its explicit receiver. Example: CI runs check-lint-core-3 against the reconciliation close-failure fixture.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Regression provenancePossible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readiness✅ Ready for maintainer review This PR fixes a current-main lint failure with a focused, behavior-preserving fixture change; no actionable defects were found. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe lifecycle test launches a worker fixture that injects one SQLite close failure before loading the compiled reconciliation worker, allowing cleanup and worker-exit behavior to be checked. flowchart LR
A[Lifecycle test] --> B[Worker fixture]
B --> C[Capture native close]
C --> D[Inject one close failure]
D --> E[Compiled reconciliation worker]
E --> F[Cleanup assertions]
Technical reviewBest possible solution: Keep the inline native-method capture and explicit receiver without restoring the source loader or adding another helper. Do we have a high-confidence way to reproduce the issue? The reported diagnostic matches the direct method reference still present on fetched main, with a clean-main reproduction recorded in the linked discussion; no target code was executed during this read-only review. Is this the best way to solve the issue? This is the smallest complete repair within the existing fixture: it preserves native receiver binding and the intentional compiled-worker boundary without adding suppression entries or test scaffolding. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 336a2d11e475. 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
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. 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 November 24, 2026, 12:07 AM ET / 05:07 UTC. |
…ce (#204397) ## Result `check-lint-core-3` on `main` passes again. Since #202514 (ad2f629) it fails type-aware oxlint: ``` src/config/sessions/session-transcript-reconcile.close-failure.test-support.mjs:3:38: error: Avoid referencing unbound methods ... (typescript(unbound-method)) ``` ## Cause #202514 rewrote this worker fixture to patch `DatabaseSync.prototype.close` directly, without the source loader. In the same PR it removed the fixture's lint-suppression entry as unused. The new line `const close = DatabaseSync.prototype.close;` is an unbound method reference, so the type-aware core stripe fails on every PR that runs it, and on `main`. ## Change Capture the method with `Reflect.get(DatabaseSync.prototype, "close")`. This is the same receiver-explicit pattern as `test/helpers/capture-method-call.ts`, which the worker cannot import because it deliberately loads no source graph. The call site already passes its receiver (`close.call(this)`). Behavior is unchanged. No suppression is added. ## Evidence - `node scripts/run-oxlint.mjs --tsconfig config/tsconfig/oxlint.core.json src/config/sessions`: the unbound-method error is reported on `main` and gone on this head. The remaining `max-lines` items are warnings, unchanged. - `session-transcript-reconcile.lifecycle-phases.test.ts`: 6 passed, including the close-failure scenario that runs this fixture. Co-authored-by: Ayaan Zaidi <[email protected]> (cherry picked from commit 3091ba8)
…ce (#204397) ## Result `check-lint-core-3` on `main` passes again. Since #202514 (ad2f629) it fails type-aware oxlint: ``` src/config/sessions/session-transcript-reconcile.close-failure.test-support.mjs:3:38: error: Avoid referencing unbound methods ... (typescript(unbound-method)) ``` ## Cause #202514 rewrote this worker fixture to patch `DatabaseSync.prototype.close` directly, without the source loader. In the same PR it removed the fixture's lint-suppression entry as unused. The new line `const close = DatabaseSync.prototype.close;` is an unbound method reference, so the type-aware core stripe fails on every PR that runs it, and on `main`. ## Change Capture the method with `Reflect.get(DatabaseSync.prototype, "close")`. This is the same receiver-explicit pattern as `test/helpers/capture-method-call.ts`, which the worker cannot import because it deliberately loads no source graph. The call site already passes its receiver (`close.call(this)`). Behavior is unchanged. No suppression is added. ## Evidence - `node scripts/run-oxlint.mjs --tsconfig config/tsconfig/oxlint.core.json src/config/sessions`: the unbound-method error is reported on `main` and gone on this head. The remaining `max-lines` items are warnings, unchanged. - `session-transcript-reconcile.lifecycle-phases.test.ts`: 6 passed, including the close-failure scenario that runs this fixture. Co-authored-by: Ayaan Zaidi <[email protected]> (cherry picked from commit 3091ba8) Co-authored-by: RomneyDa <[email protected]>
…ce (openclaw#204397) ## Result `check-lint-core-3` on `main` passes again. Since openclaw#202514 (312af24) it fails type-aware oxlint: ``` src/config/sessions/session-transcript-reconcile.close-failure.test-support.mjs:3:38: error: Avoid referencing unbound methods ... (typescript(unbound-method)) ``` ## Cause openclaw#202514 rewrote this worker fixture to patch `DatabaseSync.prototype.close` directly, without the source loader. In the same PR it removed the fixture's lint-suppression entry as unused. The new line `const close = DatabaseSync.prototype.close;` is an unbound method reference, so the type-aware core stripe fails on every PR that runs it, and on `main`. ## Change Capture the method with `Reflect.get(DatabaseSync.prototype, "close")`. This is the same receiver-explicit pattern as `test/helpers/capture-method-call.ts`, which the worker cannot import because it deliberately loads no source graph. The call site already passes its receiver (`close.call(this)`). Behavior is unchanged. No suppression is added. ## Evidence - `node scripts/run-oxlint.mjs --tsconfig config/tsconfig/oxlint.core.json src/config/sessions`: the unbound-method error is reported on `main` and gone on this head. The remaining `max-lines` items are warnings, unchanged. - `session-transcript-reconcile.lifecycle-phases.test.ts`: 6 passed, including the close-failure scenario that runs this fixture. Co-authored-by: Ayaan Zaidi <[email protected]>
Result
check-lint-core-3onmainpasses again. Since #202514 (ad2f629) it fails type-aware oxlint:Cause
#202514 rewrote this worker fixture to patch
DatabaseSync.prototype.closedirectly, without the source loader. In the same PR it removed the fixture's lint-suppression entry as unused. The new lineconst close = DatabaseSync.prototype.close;is an unbound method reference, so the type-aware core stripe fails on every PR that runs it, and onmain.Change
Capture the method with
Reflect.get(DatabaseSync.prototype, "close"). This is the same receiver-explicit pattern astest/helpers/capture-method-call.ts, which the worker cannot import because it deliberately loads no source graph. The call site already passes its receiver (close.call(this)). Behavior is unchanged. No suppression is added.Evidence
node scripts/run-oxlint.mjs --tsconfig config/tsconfig/oxlint.core.json src/config/sessions: the unbound-method error is reported onmainand gone on this head. The remainingmax-linesitems are warnings, unchanged.session-transcript-reconcile.lifecycle-phases.test.ts: 6 passed, including the close-failure scenario that runs this fixture.