Skip to content

refactor: share current-conversation binding row serialization - #152134

Merged
vincentkoc merged 2 commits into
mainfrom
refactor/current-conversation-binding-row
Sep 18, 2026
Merged

vincentkoc merged 2 commits into
mainfrom
refactor/current-conversation-binding-row

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Sep 18, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

Current-conversation binding writes and migration preparation duplicate the same stored-row serialization.

User Impact

No user-visible change. Update behavior, SQL schema, stored values, configuration, and public SDK contracts remain unchanged; no migration or operator action is required.

Why This Change Was Made

Use one internal serializer for the existing 15 fields while retaining migration normalization and key preparation, runtime query caching, write fences, and transactions. Remove the now-unused file-length suppression and its matching baseline entry.

Evidence

  • Original and candidate: 44 passed each across real SQLite query/owner tests and selected migration cases; 116 unrelated migration cases were filtered, not passed. Coverage includes all stored columns and a cyclic-metadata update failure that preserves the committed row.
  • Configured Linux Testbox: the same 44 passed, 116 filtered, command exit 0 and lease cleanup completed. Its portal-sync deadline warning is retained; this is command proof, not a claim about the associated Actions conclusion.
  • 32 selected check stages covered. The initial aggregate stopped at an unused max-lines suppression after 22 passing stages. Exact shrink-only maintenance, affected format/lint/ratchet checks, and the remaining guards passed separately; the original aggregate is not represented as successful.
  • Scoped P0-P2 review was clean. The later production delta was only deletion of that stale EOF comment, independently byte-verified and reviewed with the baseline shrink.
  • Published 2026.9.4 updater -> candidate c3a8964526251a96c5ce5a39bbdb0e9d256baaff: passed in one isolated synthetic legacy-binding cell. The genuine candidate package was built before private harness overlays, and installed payload/build identity plus Doctor entrypoint hashes were verified. The released updater's first candidate Doctor on the seeded state imported all 15 stored columns, preserved a pre-existing conflicting row, and archived the exact legacy input before any standalone Doctor. Three later same-state Doctors preserved rows, timestamps and archive; two isolated canary observations were explicitly excluded. Testbox run: command exit 0, owned checkout removed, lease stopped and children joined. Earlier failed harness attempts remain failed evidence; the portal-sync warning does not establish the backing Actions conclusion.
  • Exact-head PR CI: passed on c3a8964526251a96c5ce5a39bbdb0e9d256baaff. The signed main merge incorporated the upstream duplicate-declaration repair without changing this PR's patch.

This is a refactor PASS/PASS comparison, not a bug reproduction. The updater cell uses a synthetic isolated state directory; it is not operator/live-state validation or a full release matrix.

@vincentkoc vincentkoc self-assigned this Sep 18, 2026
@clawsweeper

clawsweeper Bot commented Sep 18, 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.

@vincentkoc
vincentkoc marked this pull request as ready for review September 18, 2026 20:11
@openclaw-barnacle openclaw-barnacle Bot added size: S maintainer Maintainer-authored PR labels Sep 18, 2026
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. 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 18, 2026
@clawsweeper

clawsweeper Bot commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 18, 2026, 4:52 PM ET / 20:52 UTC (Revision 2).

ClawSweeper review

What this changes

Shares SQLite row serialization between conversation-binding writes and legacy imports, expands persistence tests, and removes an obsolete file-length exemption.

Merge readiness

⛔ Blocked before merge - 2 items remain

The refactor remains useful and introduces no identified correctness defect. Current main still duplicates serialization; the repository-required published-updater validation remains outstanding.

Priority: P3
Reviewed head: c3a8964526251a96c5ce5a39bbdb0e9d256baaff

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, behavior-preserving extraction with meaningful persistence coverage and no identified code defect.
Proof confidence 🌊 off-meta tidepool Not applicable: The MEMBER-authored PR is exempt from the external-contributor proof gate and does not materially change authority. Its reported SQLite tests cover both serialization callers; the separate repository-required published-updater check remains outstanding.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The MEMBER-authored PR is exempt from the external-contributor proof gate and does not materially change authority. Its reported SQLite tests cover both serialization callers; the separate repository-required published-updater check remains outstanding.
Evidence reviewed 8 items Serialization preserves the stored contract: The extracted serializer retains all 15 fields, null handling, JSON encoding order, and timestamp generation. Its only import is a local type import; it adds no dependency runtime or authority decision.
Runtime ownership remains intact: The runtime caller still normalizes the conversation, rereads the committed row inside the synchronous transaction, rejects changed conversation ownership, and passes the serialized row to the existing prepared upsert.
Migration retains normalization and conflict handling: The migration adapter retains its normalization and key preparation. Existing SQLite records retain precedence, imports remain transactional, and source archival still follows commit.
Findings None None.
Security None None.

How this fits together

Conversation bindings connect a channel conversation to its target session. Runtime updates and legacy-file imports serialize those links into SQLite, where subsequent routing lookups read them.

flowchart TD
  A[Runtime binding update] --> C[Normalize conversation and prepare key]
  B[Legacy binding file] --> C
  C --> D[Shared row serializer]
  D --> E[Transactional SQLite write]
  E --> F[Conversation routing lookup]
Loading

Before merge

  • Resolve merge risk (P1) - The changed legacy-import path has controlled SQLite coverage, but its operation through a published updater remains unverified under the repository's explicit update-proof requirement.
  • Complete next step (P2) - Add the repository-required published-driver × candidate update evidence for the affected legacy binding import.
Agent review details

Security

None.

PR surface

Source -26, Tests +61, Other -1. Total +34 across 5 files.

View PR surface stats
Area Files Added Removed Net
Source 3 35 61 -26
Tests 1 71 10 +61
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 0 1 -1
Total 5 106 72 +34

Review metrics

Metric Value Why it matters
Persistence contract consolidation 15 fields shared by 2 write paths Runtime writes and legacy imports now use one encoding contract without changing schema or stored values.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Retain one internal serializer with unchanged persistence semantics and establish the required installed-updater compatibility evidence.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Retain one internal serializer with unchanged persistence semantics and establish the required installed-updater compatibility evidence.

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

Not applicable: this is a behavior-preserving refactor, and the PR explicitly reports a PASS/PASS comparison rather than a bug reproduction.

Is this the best way to solve the issue?

Yes: sharing the existing field encoding while retaining caller-owned normalization, transactions, and query caching is a narrow solution to the duplication.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P3: This is bounded internal cleanup with no intended user-visible behavior change.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The MEMBER-authored PR is exempt from the external-contributor proof gate and does not materially change authority. Its reported SQLite tests cover both serialization callers; the separate repository-required published-updater check remains outstanding.

Evidence

What I checked:

  • Serialization preserves the stored contract: The extracted serializer retains all 15 fields, null handling, JSON encoding order, and timestamp generation. Its only import is a local type import; it adds no dependency runtime or authority decision. (src/infra/outbound/current-conversation-binding-row.ts:3, c3a896452625)
  • Runtime ownership remains intact: The runtime caller still normalizes the conversation, rereads the committed row inside the synchronous transaction, rejects changed conversation ownership, and passes the serialized row to the existing prepared upsert. (src/infra/outbound/current-conversation-bindings.ts:260, c3a896452625)
  • Migration retains normalization and conflict handling: The migration adapter retains its normalization and key preparation. Existing SQLite records retain precedence, imports remain transactional, and source archival still follows commit. (src/infra/state-migrations.runtime-state.ts:665, c3a896452625)
  • Meaningful persistence coverage: The changed tests exercise the production binding owner against SQLite, verify all stored columns for insert and replacement, and verify that cyclic metadata leaves the committed row unchanged. Existing migration tests also cover imports, conflicting rows, and failed-commit retry. Tests were inspected, not executed during this read-only review. (src/infra/outbound/current-conversation-bindings.queries.test.ts:117, c3a896452625)
  • Current main and release comparison: Fetched main still contains separate runtime and migration serializers. The shared serializer is also absent from the supplied latest-release commit, so there is no evidence that the requested consolidation has already landed or shipped. (src/infra/state-migrations.runtime-state.ts:666, 56173343fe59)
  • Previous review concern remains independently applicable: AGENTS.md requires a published-driver × candidate check for changes touching state migration. The captured PR body explicitly limits its reported 44 passing cases to controlled SQLite tests and excludes published-driver validation. Comparison with the earlier reviewed head found no changes in the four binding production/test files; the previous review had no code findings. (AGENTS.md:69, c3a896452625)

Likely related people:

  • vincentkoc: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Peter Steinberger: 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.

  • Record the required published-driver × candidate update result covering the legacy binding import.

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-18T20:18:06.732Z sha b3ea760 :: blocked before merge. :: none

…/current-conversation-binding-row

* commit 'f5276e5a54c088dd23475f08479acd9738d959bd': (46 commits)
  perf(plugins): combine runtime and tool call scopes (#152101)
  test(memory): seed restart fixtures with the Gateway stopped (#152038)
  perf(gateway): avoid session list stalls on broad updates (#152074)
  fix: preserve model failure causes and worker fallback runtime (#152028)
  perf(logging): reduce Gateway hot-path info log volume (#152080)
  improve(gateway): reduce duplicate worker data fetched from SQLite (#151878)
  improve: format messages with many links faster (#152112)
  perf(cron): avoid unused SQL binding in config projections (#152029)
  fix: explain cloud worker startup failures (#152043)
  refactor(discord): share Markdown edit projection (#149214)
  refactor(media): remove unreachable geometry metadata backfills (#149272)
  chore(autoreview): sync mirror to agent-skills a7e91e1 (#152039)
  fix(ui): restore sidebar and chat test collection (#152099)
  fix(clickclack): finish SQLite cleanup between persistence tests (#152061)
  fix(workboard): isolate board deletion from unrelated subscriptions (#152102)
  refactor(agents): unify tool availability and plugin work ownership (#152073)
  fix: session group moves lag while requests are pending (#151689)
  fix(agents): preserve active cleanup during requester settlement (#151907)
  perf(sessions): keep deletion responsive under disk pressure (#152092)
  fix: preserve successful direct replies without serializing bookkeeping keys (#151870)
  ...
@vincentkoc
vincentkoc merged commit a277d7b into main Sep 18, 2026
213 checks passed
@vincentkoc
vincentkoc deleted the refactor/current-conversation-binding-row branch September 18, 2026 22:39
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Sep 18, 2026
…pr-149099-main-20260918

* commit '795e460278d4f8f41545dc8b4a66da1d12defd90': (1902 commits)
  refactor(slack): share Markdown preparation (#149129)
  fix(tooling): release completed PR operations with exited loaders (#152209)
  fix(release): allow stable npm bootstrap under an operator soak waiver (#152206)
  fix(daemon): avoid false restart timeouts during slow startup (#151387)
  feat: read agent documents from a host-owned workspace (#150584)
  improve(startup): skip redundant single-agent directory checks (#152192)
  test(ui): await board widget readiness before size reports (#152198)
  perf(browser): move dashboard event discovery to SQLite worker (#151952)
  improve(auth): reduce pauses during concurrent credential reads (#152140)
  improve(ui): load older chat history in smaller pages (#152093)
  fix(release): reject incomplete legacy npm install trees (#152186)
  refactor: share current-conversation binding row serialization (#152134)
  test(tooling): preserve Node and terminal fixture ownership under Bun (#152187)
  fix(sqlite): service worker admission through retained path aliases (#152190)
  improve: reduce CPU work for long CLI reasoning streams (#152191)
  chore(ui): refresh control ui locales (#152196)
  test(subagents): align lifecycle retries with durable completion owners (#152184)
  perf(gateway): defer participant maps for owned sessions (#152097)
  refactor(stream): share auxiliary queue overflow handling (#149282)
  fix(test): execute CLI fixture preloads on Node and Bun (#152076)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S 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