Skip to content

refactor(runtime): deslop single-use adapters - #165109

Merged
steipete merged 1 commit into
mainfrom
deslop/l371-single-use-rest-20261004
Oct 4, 2026
Merged

steipete merged 1 commit into
mainfrom
deslop/l371-single-use-rest-20261004

Conversation

@steipete

@steipete steipete commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Private command, channel, provider, and UI flows carry single-use factories, option bags, and result adapters that duplicate facts their callers already own.

User Impact

No user-visible change. Config keys, persisted data, protocol payloads, CLI output, model-facing descriptions, and UI rendering remain unchanged. Public plugin SDK seams, lazy loading, and lifecycle/authority boundaries remain intact.

Why This Change Was Made

This second pass after #164806 removes 1,020 net production lines (2,114 added, 3,134 removed; tests and baselines excluded) in one batch:

  • Inline iMessage inbound/send projections and Slack send wrappers; keep target selection, authority checks, echo persistence, retry timing, and diagnostic text.
  • Build OpenAI/xAI transcription sessions at the provider entry point; retain reconnect credential resolution, transcript ordering, bounds, and terminal settlement.
  • Project Bedrock catalogs directly into the discovery result, reuse prepared Foundry capabilities, and use the existing SDK type for OpenRouter transport options.
  • Remove private capability CLI forwarding bags, Node diagnostic collection wrappers, allowlist adapters, and intermediate exec/queue/group parser results.
  • Run link processors directly in the existing link owner; preserve guarded fetch, fallback order, timeouts, and cancellation.
  • Inline one-use status projections, agent model staging helpers, chat display adapters, cached UI store factories, and MCP submission callback orchestration.

Existing group-parser assertions now exercise the retained parser entry point. Seven MCP tests now submit the rendered form and retain config-before-session, failure, and navigation checks. No tests were skipped or assertions weakened. The assertion baseline shrinks with a removed cast.

Evidence

  • Independent Codex autoreview of the final batch: scoped-clean at P1+, no accepted findings. A prior iMessage concern was checked against the parent: the attachment helper never received echoText; the separate caption send owns that text echo, and the persistence owner treats absent and undefined text identically.
  • Linux remote boundary proof: 44 focused files / 1,291 cases passed, including HTTP cancellation, descendant cleanup, iMessage attachment/caption custody, CLI output, provider state machines, parser spans, and UI stores. This combines the initial 20-case link proof with the 42-file batch.
  • Plugin contracts: 48 files / 1,135 cases passed. Both check-madge-import-cycles.ts and check-import-cycles.ts report zero.
  • The MCP fixture now uses the existing session-capability test owner with managed cleanup, preserving all 18 cases and the HTTP everywhere payload. Its dedicated UI-chat typecheck passes. The final Linux single-worker replay took 3.02s in Vitest; the group-parser file took 22.18s on its cold run (94% transform, 7 cases). No cases or CI lanes were added.
  • Core, UI, plugin, and test types passed. The dead-export scan found the internal moderation alias made unused by the CLI simplification; the identical union is now inline at its sole remaining field. The remaining changed-check gates passed in targeted replays: core/extension lint, UI styles, schema/store/media/runtime/auth guards, and Knip file/dependency checks. Inlining exposed naming collisions, which were corrected; both cycle checks still report zero.
  • Final correction replay: 6 files / 247 cases passed across CLI, allowlist, MCP form, and iMessage sends; the verified source tree matches commit 226e80a8a44.
  • Data-model compatibility: the embedding CLI diff only inlines runMemoryEmbeddingCreate into its single action handler. It keeps the same createEmbeddingProvider arguments, embedBatch(texts, { inputType: "document" }), cleanup, and transient { text, embedding, dimensions } output. It adds no storage write, schema, vector-index metadata, or migration. Existing capability-cli.test.ts provider-selection, JSON/vector ordering, dimension/text rendering, and cleanup-error cases passed on the exact head. The automated data-model flag is a path-based false positive; no upgrade transform is required.
  • No live Gateway was changed. These are internal refactors with focused owner/entry-point proof; no visual UI behavior changed.

Inline private forwarding bags, factories, and projections into their callers
across channels, providers, capability commands, reply parsing, and Control UI.
Preserve public contracts, output, lazy loading, and lifecycle/authority checks.

Exercise the retained parser and MCP form boundaries in existing tests.
@clawsweeper

clawsweeper Bot commented Oct 4, 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.

@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 Oct 4, 2026
@clawsweeper

clawsweeper Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed October 4, 2026, 5:22 PM ET / 21:22 UTC (Revision 2).

ClawSweeper review

What this changes

The PR inlines private adapters into existing channel, provider, CLI, reply-parser, and Control UI owners and moves existing tests to retained entry points.

Merge readiness

⛔ Blocked before merge - 1 item remains

Keep open with no blocking correctness findings. Source comparison resolves the previous migration concern: the refactor preserves stored-data contracts and remains distinct from work already on main.

Priority: P3
Reviewed head: 226e80a8a44e56a81ba5655dc84cb846602c5119

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A useful behavior-preserving cleanup with retained coverage, recorded validation, and no identified blocking defect.
Proof confidence 🌊 off-meta tidepool Not applicable: Verified repository-admin authorship exempts this internal refactor from external-contributor runtime proof. Recorded focused checks cover retained command, transport, parser, and UI entry points but were not rerun here. No material authority change or stored-data contract change was found; the previous migration request is resolved.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: Verified repository-admin authorship exempts this internal refactor from external-contributor runtime proof. Recorded focused checks cover retained command, transport, parser, and UI entry points but were not rerun here. No material authority change or stored-data contract change was found; the previous migration request is resolved.
Evidence reviewed 8 items Pinned introduction and merge ownership: Reviewed the introduced delta from b7645dd to the exact PR head. Raw test-merge records confirm parents e50a9d9 followed by that head; base-only changes were excluded from PR attribution.
Previous migration concern resolved: The embedding action retains provider selection, fallback:none, document batch embedding, cleanup, and transient text/vector/dimensions output. It introduces no storage writer, schema, index identity, or migration. Existing capability CLI tests cover provider selection, ordering, dimensions, and cleanup errors.
iMessage persistence and authority preserved: The parent attachment helper's sole caller never supplied echoText. Removing that undefined field preserves the persistence owner's normalized entry shape; the separate caption send still owns text echo. Target resolution, dispatch callbacks, and authority checks around awaited handoff remain present.
Findings None None.
Security None None.

How this fits together

OpenClaw routes commands, messages, provider events, and UI actions through runtime owners. These owners select targets, perform operations, and return replies, capability results, or UI state.

flowchart LR
  A[Messages and commands] --> C[Existing runtime owners]
  B[Provider events and UI actions] --> C
  C --> D[Target and lifecycle checks]
  D --> E[Channel and provider operations]
  E --> F[Replies and capability results]
  E --> G[UI state]
Loading

Before merge

  • Add data-model compatibility proof - Confirm migration or upgrade compatibility proof before merge.
Agent review details

Security

None.

PR surface

Source -1020, Tests +26, Other 0. Total -994 across 33 files.

View PR surface stats
Area Files Added Removed Net
Source 30 2072 3092 -1020
Tests 2 189 163 +26
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 1 1 0
Total 33 2262 3256 -994

Review metrics

None.

Stored data model

Persistent data-model change detected: unknown-data-model-change: src/cli/capability-cli/embedding.ts, vector/embedding metadata: src/cli/capability-cli/embedding.ts. Confirm migration or upgrade compatibility proof before merge.

Technical review

Best possible solution:

Keep the simplified flows in their existing owners while preserving public contracts, lifecycle checks, and observable outputs.

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

Not applicable: this PR proposes internal restructuring rather than a reported behavior defect; no introduced failure was established.

Is this the best way to solve the issue?

Yes: the diff removes private forwarding layers while retaining existing owners and meaningful boundary assertions, without adding parallel APIs or configuration.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 343e56d88714.

Labels

Label changes:

No label changes.

Label justifications:

  • P3: This is internal cleanup with preserved user-facing behavior and no identified urgent defect.
  • 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: Verified repository-admin authorship exempts this internal refactor from external-contributor runtime proof. Recorded focused checks cover retained command, transport, parser, and UI entry points but were not rerun here. No material authority change or stored-data contract change was found; the previous migration request is resolved.

Evidence

What I checked:

  • Pinned introduction and merge ownership: Reviewed the introduced delta from b7645dd to the exact PR head. Raw test-merge records confirm parents e50a9d9 followed by that head; base-only changes were excluded from PR attribution. (226e80a8a44e)
  • Previous migration concern resolved: The embedding action retains provider selection, fallback:none, document batch embedding, cleanup, and transient text/vector/dimensions output. It introduces no storage writer, schema, index identity, or migration. Existing capability CLI tests cover provider selection, ordering, dimensions, and cleanup errors. (src/cli/capability-cli/embedding.ts:56, 226e80a8a44e)
  • iMessage persistence and authority preserved: The parent attachment helper's sole caller never supplied echoText. Removing that undefined field preserves the persistence owner's normalized entry shape; the separate caption send still owns text echo. Target resolution, dispatch callbacks, and authority checks around awaited handoff remain present. (extensions/imessage/src/send.ts:616, 226e80a8a44e)
  • Retained UI boundary coverage: Seven existing MCP cases now submit the rendered form. Assertions retain global-before-session ordering, preserved sparse overrides, config/session failures, and navigation rejection. The shared session-capability fixture registers managed disposal. (ui/src/pages/chat/chat-composer-capability-host.test.ts:149, 226e80a8a44e)
  • Current main and release still retain removed adapters: Current main retains runMemoryEmbeddingCreate and the static MCP orchestration adapter. The embedding blob on main and latest release v2026.9.8 is the same parent blob, 2e2ab7fcf52c719da0073ca548383643a44d95d7. The requested cleanup is therefore not already implemented there. (src/cli/capability-cli/embedding.ts:18, 343e56d88714)
  • Trusted author and clean mergeability: GitHub REST confirms the pinned head remains open, unmerged, and cleanly mergeable. A separate collaborator-permission read verifies steipete has repository admin permission, establishing the trusted-author proof exemption despite inconsistent association fields. (226e80a8a44e)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • vincentkoc: 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 (1 earlier review cycle)
  • reviewed 2026-10-04T21:07:44.782Z sha 226e80a :: blocked before merge. :: none

@steipete
steipete merged commit 6938f6e into main Oct 4, 2026
157 of 167 checks passed
@steipete
steipete deleted the deslop/l371-single-use-rest-20261004 branch October 4, 2026 21:33
@steipete

steipete commented Oct 4, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 5, 2026
Inline private forwarding bags, factories, and projections into their callers
across channels, providers, capability commands, reply parsing, and Control UI.
Preserve public contracts, output, lazy loading, and lifecycle/authority checks.

Exercise the retained parser and MCP form boundaries in existing tests.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui channel: imessage Channel integration: imessage channel: slack Channel integration: slack cli CLI command changes commands Command implementations extensions: amazon-bedrock extensions: microsoft-foundry extensions: openai extensions: openrouter extensions: xai P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. 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