Repository navigation
refactor(gateway): share placement move matching - #140569
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: needs maintainer review before merge. Reviewed September 6, 2026, 9:21 PM ET / September 7, 2026, 01:21 UTC. ClawSweeper reviewWhat this changesShares the database identity check used when recording errors or deleting pending moves of sessions between the Gateway and workers. Merge readiness✅ Ready for maintainer review Keep open: this is a useful, behavior-preserving simplification with no actionable defect found. Current main retains the duplicated predicates, and the maintainer-owned PR is protected from cleanup closure. Priority: P3 Review scores
Verification
How this fits togetherThe Gateway persists session-move intentions while coordinating transfers between local execution and workers. Error recording, cancellation, and completion match the stored move identity before updating or removing that record. flowchart TD
A[Session move request] --> B[Persisted move intention]
B --> C[Error or completion handling]
C --> D[Shared nine-field identity check]
D --> E[Update error or delete intention]
E --> F[Verify affected row count]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource -19. Total -19 across 1 file. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Use one complete move-identity predicate while preserving existing encodings, transaction ownership, and stale-move rejection. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR proposes deduplication rather than a reported behavioral defect; the duplicated current-main predicates are directly observable. Is this the best way to solve the issue? Yes: sharing the complete value map removes duplication while retaining the existing Kysely path and NULL/1 encoding, without introducing another abstraction or migration. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 0cd1ca7552a0. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
…137098 * commit '8a540c252002878f3c3e9d8dfb837b83c8602a78': (2210 commits) perf(plugins): keep bundled catalog lookups lightweight (#140597) refactor: streamline skills JSON serialization (#140581) fix(feishu): expand quoted merged-forward messages (#136231) fix(talk): keep opaque realtime routes out of public config (#129144) fix(ci): avoid Linux packaging on pull requests (#140589) fix(usage): release completed request payloads (#140588) fix(tooling): omit Trae machine squash credit (#140562) fix(ui): stop catalog paging in hidden tabs (#140583) fix(portals): reach IPv6 loopback with IPv4-only localhost records (#140580) fix(transcripts): preserve fixed and legacy capture history (#140563) fix(ui): prevent Talk E2E audio capture stalls (#138803) fix(media): release completed document source buffers (#140561) fix(anthropic): preserve resumed CLI caches across Git changes (#140566) chore(ui): refresh control ui locales (#140586) fix(ui): keep usage exports bound to their session instance (#140573) refactor(exa): test response readers through tool execution (#140572) fix(macos): omit incompatible worker binaries from app bundles (#140557) fix: avoid retaining discarded tool output (#140570) refactor(gateway): share placement move matching (#140569) fix(gateway): preserve child turns during systemd drain (#140568) ... # Conflicts: # .agents/skills/release-openclaw-maintainer/SKILL.md # docs/reference/RELEASING.md
What Problem This Solves
Placement-move error recording and deletion duplicate the same complete move-identity predicate, including three nullable-field branches. This is a maintainer-requested production simplification in the #135868 split campaign.
Why This Change Was Made
Share the nine-field match and let the existing Kysely object predicate choose equality or
IS NULL. The same operation ID, session ID, source generation, environment, owner epoch, target kind/ID/machine class, and abandonment value remain required by both mutations.Deletion evidence: Kysely's existing filter-object parser uses
ISfor null and equality for strings/numbers.fromRow,targetValues, andabandonSourceValueproduce all nine defined values, so no criterion is omitted. The1/NULLabandonment encoding, synchronous transaction owner, state checks and affected-row checks are unchanged.User Impact
No behavior change. Stale placement moves still fail their exact identity checks, and error recording and completion retain the same persistence behavior.
Evidence
Real SQLite owner suites before: 3 files, 31 cases, 35.54s; after: 3 files, 31 cases, 19.99s. Move, abandonment and schema-compatibility cases are unchanged.
A compiler comparison covered 16 target/flag/update/delete encodings: predicate SQL matches apart from one grouping parenthesis, with identical bound parameters. The changed map preserves that field order.
Production +19/−38 = −19. Tests/tooling/docs zero; no tests removed.
No schema, protocol, migration, retention or transaction change.
Full
node scripts/check-changed.mjs: exit 0, including both typecheck lanes, lint and all selected guards.Independent autoreview: scoped-clean, no accepted/actionable findings.
No build required: internal query construction only; no packaging, lazy-loading or public API changes.