Skip to content

refactor: simplify runtime adapters and remove obsolete code - #152277

Merged
steipete merged 5 commits into
mainfrom
codex/deslop-prod-2k-round2
Sep 19, 2026
Merged

steipete merged 5 commits into
mainfrom
codex/deslop-prod-2k-round2

Conversation

@steipete

@steipete steipete commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Removes duplicate runtime adapters, retired paths, and generated filename narration left after earlier ownership migrations. Follow-up to #151973, requested as a broader maintainer cleanup.

User Impact

Internal cleanup with no intended changes to CLI output, public SDK contracts, session storage, permissions, or UI appearance. No migration or operator action is required.

Storage/config compatibility is confirmed: canonical SQL, agent/state schema versions (21/17), configuration defaults, and migration logic remain unchanged. The real preference-write owners remain active; the removed optional upsert branch had no callers. Existing-database migration, lease, board, progress-card, and preference tests passed.

Why This Change Was Made

The runtime cleanup reuses existing lazy loaders, canonical session/TTS types, SQLite schema extraction, and Workboard registration helpers. It also removes obsolete native configuration plumbing, retired styles, and unused preference-writing code, and moves Reef's test-only memory stores out of production.

A separate comment-only commit removes only filename-restating plugin headers. Meaningful ownership, lifecycle, and contract comments remain.

The net production-file reduction is 2,128 lines excluding formatting-only deletions: 1,025 code/type/style lines and 1,103 comment headers. The code count includes 135 lines moved into test support, rather than deleted behavior. Two leading blank-line deletions are excluded. This is a maintainability and unnecessary-work cleanup; no end-to-end latency improvement is claimed.

Evidence

  • Full production build, changed-scope type/lint/boundary checks, Swift lint, and macOS test compilation passed. The changed check's CSS duplication and unused file-size exemption findings were repaired and the affected checks completed.
  • Focused owner run: 814 passing tests across 35 files, with four existing skips. Additional UI/QA runs: 236 passing test cases, including the final QA forwarding and desktop/mobile plugin flows.
  • Compiler-based comparison preserves all 7,897 resolved exports across 362 configured SDK subpaths and the exact touched session/TTS parameter shapes. All eleven SQL outputs, including the legacy widget derivative, are byte-identical. The shared session parameter declarations now live in the existing leaf contract module: both types and their documentation are unchanged, and emitted JavaScript is identical across all four affected modules. Both runtime and type-aware import-cycle checks pass.
  • Sixteen synthetic desktop/mobile UI states have zero pixel, computed-style, or geometry differences. The affected model-settings states were rechecked after the CSS rule consolidation.
  • All 1,103 header changes preserve nontrivia tokens, ASTs, and parse diagnostics; each original blob reconstructs exactly from its approved prefix and remaining bytes. The same proof passed after integration onto the code-cleanup commit.
  • The startup import guard now parses actual static imports instead of relying on a removed type-alias sentinel. Its focused suite passes all 11 cases, and both deliberately injected forbidden imports fail the intended assertions.
  • An encountered iOS voice-negotiation test raced cold startup against a five-second waiter and left its task unjoined on failure. It now awaits startup directly; the mock stops the session before replying, preserving all nine capability combinations without opening media or contacting a provider. The request expectation and production timeouts are unchanged.
  • The memory retained-queue regression now injects an exact SQLite publication failure instead of blocking the entire agent database. It retains the real write/rollback and recovery assertions; removing idle queue adoption makes it fail at the missing retained-target result. In full-suite order, the local test case drops from 16.4 seconds to 1.2 seconds. This is a test-fixture improvement, not a production lock or latency claim.
  • Independent P0–P2 reviews completed without accepted/actionable findings. Exact-head hosted CI passed, including Linux/Windows Node lanes and macOS/iOS native suites.

Desktop before CSS cleanup

Desktop after CSS cleanup

Mobile before CSS cleanup

Mobile after CSS cleanup

@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.

@openclaw-barnacle openclaw-barnacle Bot added channel: discord Channel integration: discord channel: imessage Channel integration: imessage channel: line Channel integration: line channel: matrix Channel integration: matrix channel: msteams Channel integration: msteams channel: slack Channel integration: slack channel: telegram Channel integration: telegram channel: voice-call Channel integration: voice-call channel: whatsapp-web Channel integration: whatsapp-web app: ios App: ios app: macos App: macos app: web-ui App: web-ui gateway Gateway runtime extensions: memory-core Extension: memory-core agents Agent runtime and tooling channel: feishu Channel integration: feishu extensions: device-pair extensions: qa-lab plugin: workboard channel: reef Channel integration: reef size: XL maintainer Maintainer-authored PR labels Sep 18, 2026
@steipete
steipete marked this pull request as ready for review September 18, 2026 23:59
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. 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 19, 2026
@clawsweeper

clawsweeper Bot commented Sep 19, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 18, 2026, 9:34 PM ET / September 19, 2026, 01:34 UTC (Revision 5).

ClawSweeper review

What this changes

The branch consolidates runtime adapters and shared types, removes unused native helpers and UI styles, moves Reef memory stores into test support, and updates affected tests.

Warning

SQLite table change

This PR modifies persisted SQLite tables in src/state/openclaw-agent-board-schema.ts, src/state/openclaw-agent-db-lease.ts, src/state/openclaw-agent-progress-card-schema.ts, src/state/openclaw-agent-session-sharing-schema.ts, and 1 more. Prefer a design that avoids changing persisted SQLite tables. If the change is necessary, verify migration and upgrade compatibility against an existing database before merge.

Merge readiness

⛔ Blocked before merge - 2 items remain

Keep open as useful, maintainer-requested cleanup. No actionable introduced defect was found, and the source and compatibility response resolve the previous review’s blocker.

Priority: P3
Reviewed head: e68b5f3ab62bbbc6b8489351fc7cdf8827dc8f6c

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A sound cleanup supported by visual parity evidence, explicit compatibility confirmation, and focused reported validation, with no actionable findings.
Proof confidence 🐚 platinum hermit (4/6) Not applicable: The external-contributor gate does not apply to this maintainer-authored internal cleanup. Inspected synthetic desktop/mobile screenshots support CSS parity; reported build, test, SQL, and SDK comparisons supplement source review without establishing live backend or native execution.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The external-contributor gate does not apply to this maintainer-authored internal cleanup. Inspected synthetic desktop/mobile screenshots support CSS parity; reported build, test, SQL, and SDK comparisons supplement source review without establishing live backend or native execution.
Evidence reviewed 10 items Introduced changes and review continuity: Reviewed the merge-base-to-head changes. Since the previous reviewed head, only the memory queued-sync test changed; there were no prior concrete findings to re-raise.
Previous compatibility concern addressed: The captured body and #152277 (comment) explicitly confirm unchanged configuration defaults, schema versions, migration logic, and eleven SQL outputs. Source inspection supports the extraction equivalence; these are reported execution results, not tests rerun during this review.
Active preference writes preserved: Before the patch, both callers of mutateUserPreference omitted the optional value and therefore only deleted preferences. The replacement preserves those deletions, while writeUserPreferences retains the actual upsert path.
Findings None None.
Security None None.

How this fits together

OpenClaw’s runtime adapters connect agent commands and plugin requests to existing execution and storage owners. This cleanup simplifies those connections while retaining their configuration, authorization, and output contracts.

flowchart LR
  A[Agent commands] --> C[Lazy runtime adapters]
  B[Plugin requests] --> C
  C --> D[Existing runtime owners]
  D --> E[Channel delivery]
  D --> F[Session and preference storage]
  F --> G[Native apps and Control UI]
Loading

Before merge

  • Review config compatibility - Confirm compatibility and upgrade impact for the changed config or default surface before merge.
  • Add data-model compatibility proof - Confirm migration or upgrade compatibility proof before merge.
Agent review details

Security

None.

PR surface

PR surface statistics unavailable: the file list is incomplete.

Review metrics

None.

Stored data model

Persistent data-model change detected: database schema: src/state/openclaw-agent-board-schema.ts, database schema: src/state/openclaw-agent-db-lease.ts, database schema: src/state/openclaw-agent-progress-card-schema.ts, database schema: src/state/openclaw-agent-session-sharing-schema.ts, database schema: src/state/openclaw-state-lease-storage.ts, unknown-data-model-change: src/state/openclaw-agent-board-schema.ts, and 2 more. Confirm migration or upgrade compatibility proof before merge.

Technical review

Best possible solution:

Keep runtime and storage decisions with their existing owners and remove only redundant adapters, unused branches, and retired presentation code.

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

Not applicable: this is a behavior-preserving cleanup, and source review found no concrete introduced failure to reproduce.

Is this the best way to solve the issue?

Yes. Reusing existing lazy loaders, storage helpers, and leaf types reduces duplication without introducing a competing owner or changing the inspected public contracts.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P3: This is internal cleanup with preserved user behavior and no established urgent defect.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit 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 external-contributor gate does not apply to this maintainer-authored internal cleanup. Inspected synthetic desktop/mobile screenshots support CSS parity; reported build, test, SQL, and SDK comparisons supplement source review without establishing live backend or native execution.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. The external-contributor gate does not apply to this maintainer-authored internal cleanup. Inspected synthetic desktop/mobile screenshots support CSS parity; reported build, test, SQL, and SDK comparisons supplement source review without establishing live backend or native execution.

Evidence

What I checked:

  • Introduced changes and review continuity: Reviewed the merge-base-to-head changes. Since the previous reviewed head, only the memory queued-sync test changed; there were no prior concrete findings to re-raise. (extensions/memory-core/src/memory/index.test.ts:1563, e68b5f3ab62b)
  • Previous compatibility concern addressed: The captured body and refactor: simplify runtime adapters and remove obsolete code #152277 (comment) explicitly confirm unchanged configuration defaults, schema versions, migration logic, and eleven SQL outputs. Source inspection supports the extraction equivalence; these are reported execution results, not tests rerun during this review. (src/infra/sqlite-schema-sql.ts:4, e68b5f3ab62b)
  • Active preference writes preserved: Before the patch, both callers of mutateUserPreference omitted the optional value and therefore only deleted preferences. The replacement preserves those deletions, while writeUserPreferences retains the actual upsert path. (src/state/user-preferences.store.ts:131, e68b5f3ab62b)
  • No material storage or package contract change: The introduced diff leaves canonical agent/state schema files, package metadata, lockfile, workflow definitions, and the SDK entrypoint registry unchanged. The native browser parameter was explicitly discarded before removal. (apps/macos/Sources/OpenClaw/NodeMode/MacNodeModeCoordinator.swift:1263, e68b5f3ab62b)
  • Pairing and workspace authority preserved: The pairing URL producers return one URL, so removing the unused fallback-array branch does not broaden issued grants. QR account/thread options remain equivalent. Workboard reuses its existing registration helper with the same scopes, workspace checks, and store calls. (extensions/device-pair/index.ts:553, e68b5f3ab62b)
  • Visual evidence inspected: Inspected all four downloaded PR images: desktop/mobile before-and-after galleries covering welcome, plugins, model settings, side chat, hovercard, and loading states. They support unchanged visible layout in synthetic fixtures, not backend or native runtime coverage. (ui/src/styles/plugins.css:1116, e68b5f3ab62b)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Dallin Romney: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

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 (4 earlier review cycles)
  • reviewed 2026-09-19T00:08:20.415Z sha 6cbf618 :: blocked before merge. :: none
  • reviewed 2026-09-19T00:20:54.885Z sha a63dbc4 :: blocked before merge. :: none
  • reviewed 2026-09-19T00:50:08.127Z sha a63dbc4 :: blocked before merge. :: none
  • reviewed 2026-09-19T01:14:05.959Z sha dcca41e :: blocked before merge. :: none

@steipete

Copy link
Copy Markdown
Contributor Author

Compatibility checklist confirmed for a63dbc4ebf5f8aea50045eb6714968cec6b816b2. Canonical SQL and agent/state schema versions (21/17) are unchanged. Independently executing the exact before/after pure extraction code produced byte-identical output for all 11 SQL fragments, including complements, both lease schemas, and the legacy widget derivative; runtime statements outside extraction are unchanged.

Configuration defaults and active preference-write owners are retained. The removed native browser setting value was explicitly ignored, and browser configuration remains owned by the existing CLI worker. Existing-database migration, lease, board, progress-card, and preference tests passed. No migration or backfill is required. The PR body now records this compatibility confirmation.

@steipete
steipete merged commit 2e02e44 into main Sep 19, 2026
237 checks passed
@steipete
steipete deleted the codex/deslop-prod-2k-round2 branch September 19, 2026 02:35
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 19, 2026
…w#152277)

* refactor: consolidate runtime adapters and retire obsolete code

* style(plugins): remove redundant filename headers

* refactor(sessions): keep shared mutation contracts in a leaf module

* test: remove startup timing and source sentinel coupling

* test(memory): target queued-sync publication failures
steipete added a commit that referenced this pull request Sep 19, 2026
Memory sync could time out after SQLite contention prevented cleanup of a completed local task's workspace lock: the 60-second stale threshold exceeded the next caller's 10-second wait.

Record bounded settled-grant facts in Memory Core's existing lock owner so the next caller can reclaim that exact grant through the existing atomic comparison. Unique owner IDs prevent grant reuse; contention identifies its holder and unavailable storage retains the original SQLite cause without replacing task failures. Wait bounds, foreign-owner protection, and the persisted lock schema remain unchanged.

Validation: exact-head CI passed; campaign proof reports 1,964 passing Memory Core tests and all four published/candidate lock-reader combinations. Independent review found no actionable P0/P1 issue.

Related: #152277
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 20, 2026
…w#152430)

Memory sync could time out after SQLite contention prevented cleanup of a completed local task's workspace lock: the 60-second stale threshold exceeded the next caller's 10-second wait.

Record bounded settled-grant facts in Memory Core's existing lock owner so the next caller can reclaim that exact grant through the existing atomic comparison. Unique owner IDs prevent grant reuse; contention identifies its holder and unavailable storage retains the original SQLite cause without replacing task failures. Wait bounds, foreign-owner protection, and the persisted lock schema remain unchanged.

Validation: exact-head CI passed; campaign proof reports 1,964 passing Memory Core tests and all four published/candidate lock-reader combinations. Independent review found no actionable P0/P1 issue.

Related: openclaw#152277
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling app: ios App: ios app: macos App: macos app: web-ui App: web-ui channel: discord Channel integration: discord channel: feishu Channel integration: feishu channel: imessage Channel integration: imessage channel: line Channel integration: line channel: matrix Channel integration: matrix channel: msteams Channel integration: msteams channel: reef Channel integration: reef channel: slack Channel integration: slack channel: telegram Channel integration: telegram channel: voice-call Channel integration: voice-call channel: whatsapp-web Channel integration: whatsapp-web extensions: device-pair extensions: memory-core Extension: memory-core extensions: qa-lab gateway Gateway runtime maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. plugin: workboard proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XL 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