Skip to content

refactor: keep private runtime composition with callers - #178778

Merged
steipete merged 20 commits into
mainfrom
deslop/z25-67-cli-private-renderers-20261015
Oct 20, 2026
Merged

steipete merged 20 commits into
mainfrom
deslop/z25-67-cli-private-renderers-20261015

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Internal CLI, tool, and plugin flows expose private factories and result objects used by only one production owner, with some tests coupled to those private seams.

User Impact

User impact: no intended user-visible change, migration, or operator action.

Why This Change Was Made

Compose these operations where their inputs and lifecycle already live: CLI rendering/parsing, Doctor diagnostics, MCP serving, proxy capture, outbound media staging, native plugin authentication, provider registration, artifact pagination, and agent image/computer results. Retire the single-consumer modules and forwarding hops, and move useful private-helper coverage to the registered command, provider, or public operation.

Keep public SDK/config/protocol contracts, lazy runtime imports, effect authority, filesystem containment and permissions, image sanitization, cursor bindings and limits, encrypted-delivery worker operations, ordinary cancellation, and shutdown settlement. The standalone session memory backend is untouched.

Net production LOC: 512 removed (+1,761 / -2,273), excluding tests, fixtures, test support, generated files, declarations, and ratchet inventories. The candidate touches 76 paths. Test/support migration adds 244 net lines; the whole diff removes 272 net lines.

Best-effort tradeoffs accepted

  • Remove duplicate private Reef peer validation: since the factory's introduction in improve(reef): reduce native state database work #168340, its sole caller already synchronously validates and normalizes the same peer. The send boundary still performs that check before any worker work or dispatch; no external validation is removed.
  • Remove the factory's second copies of the caller-fresh message body and already-copied recipient identity. The same introducing caller constructs/captures those facts synchronously, and no reference to the private body escapes. The owner still snapshots external recipient/key/guard facts before awaits. No security, durability, ordinary-concurrency, recovery, or effect-authority guard is removed.

Evidence

  • Each committed slice passed focused owner/consumer proof, targeted native types, lint, formatting, and fresh independent review through P2. Retained proof is reused only for unchanged source inputs.
  • The media/channel forwarding slice passed 60 cases. Image/export proof passed 47 selected cases, including real filesystem writes, containment, overwrite permissions, collisions, corrupt-image handling, execution cancellation, and all five prompt-prefix cases. Artifact/X proof passed 40 cases, including image pagination, sharing/policy revalidation, registered request authority, redacted failure routing, and sticky outcomes.
  • The DeepInfra registered-source suites passed 28 cases and five prefix cases. Its unchanged built-provider contract requires runtime asset preparation and remains hosted-CI proof; no local build or passing built-artifact result is claimed.
  • Reef/computer proof passed 116 cases: 53 encrypted-delivery/worker/authority cases, 58 delivered-image/observation/frame cases, and all five prompt-prefix cases. Targeted native types, typed lint, formatting, and line caps pass. These include real storage and cryptography with synthetic relay/model boundaries, not live service or desktop-input proof.
  • Final assertion/mock ratchets pass with no new allowances. All 14 suppression-audit cases and four selected wrapper/import-closure cases pass; 18 unrelated closure cases were excluded by the focused name filter, with no test skip changes. Runtime and Madge checks both report zero cycles. Formatting, line caps, and whitespace pass.
  • All proof uses isolated HOME/OpenClaw/XDG state, nice priority, one worker, and serial heavy commands. No local broad suite, whole-graph typecheck, build, or E2E is claimed. Exact-head PR CI is the broad gate.

One local lint issue introduced by the computer projection fold was fixed by renaming a shadowed local; no suppression, timeout, retry, or skip was added.

@clawsweeper

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

@steipete
steipete marked this pull request as ready for review October 20, 2026 21:07
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-20T21:11:17.648539Z b8ca6f3 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@openclaw-barnacle openclaw-barnacle Bot added channel: mattermost Channel integration: mattermost channel: whatsapp-web Channel integration: whatsapp-web gateway Gateway runtime cli CLI command changes scripts Repository scripts commands Command implementations agents Agent runtime and tooling labels Oct 20, 2026
@steipete
steipete enabled auto-merge (squash) October 20, 2026 21:25
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 20, 2026
@clawsweeper

clawsweeper Bot commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR moves private runtime composition into existing production callers and migrates helper tests to those callers.

Example: An owner runs /export-session exports/session.html.

  • Before: The command delegates the confined file write to a separate private module.
  • After: The command performs the same confined write directly, preserving the output path and private file permissions.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The inspected patch is coherent and preserves contracts; confidence in runtime behavior rests on reported focused tests and harnesses while broad CI remains pending.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored refactor is outside the ordinary contributor proof gate; supplied tests exercise registered owners, real filesystem writes, storage, and cryptography, with synthetic transport/model boundaries.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Refactor · Worth it: Yes · Fix scope: Complete
User problem: No direct user-facing defect is claimed; private factories and forwarding modules add maintenance indirection.
Reason: The maintainer-authored direction is established, and the inspected changes remove private seams while retaining public behavior.

Merge readiness

✅ Ready for maintainer review

Keep open: this maintainer-directed refactor removes private forwarding paths while preserving the inspected contracts; no actionable introduced bug was found.

Priority: P3
Reviewed head: b8ca6f3192732146c8dbfa1f7d93253153673180

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: The supplied evidence covers owner tests and harnesses; live CLI, channel, and desktop E2E execution is expressly unclaimed.
Agent review details

How this fits together

CLI commands, agent tools, Gateway handlers, and bundled plugins compose existing runtime operations from validated inputs and return rendered output, tool results, or delivery outcomes.

flowchart TD
  A[CLI and runtime requests] --> B[Existing production callers]
  B --> C[Shared SDK and runtime owners]
  C --> D[Storage and transport operations]
  D --> B
  B --> E[Command and tool results]
  B --> F[Gateway and channel responses]
Loading

Technical review

Best possible solution:

Keep composition with the existing callers while preserving shared runtime contracts and completing the normal exact-head CI gate.

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

This is a behavior-preserving refactor; inspection establishes the private forwarding paths being removed, and no target code was executed.

Is this the best way to solve the issue?

The changes use existing owners, retire the replaced paths, and move useful coverage to production callers without introducing competing machinery.

AGENTS.md: found and applied where relevant.

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

Provenance checked

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

PR surface

Source -512, Tests +244, Other -4. Total -272 across 76 files. Added test files: 1.

View PR surface stats
Area Files Added Removed Net
Source 56 1761 2273 -512
Tests 18 656 412 +244
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 2 0 4 -4
Total 76 2417 2689 -272

Labels

Label changes:

  • add P3: This is internal ownership cleanup with no intended user-visible behavior change or demonstrated urgent defect.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P3: This is internal ownership cleanup with no intended user-visible behavior change or demonstrated urgent defect.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed October 20, 2026, 5:25 PM ET / 21:25 UTC.

@steipete
steipete merged commit ffd5377 into main Oct 20, 2026
251 of 263 checks passed
@steipete
steipete deleted the deslop/z25-67-cli-private-renderers-20261015 branch October 20, 2026 22:40
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash auto-merge.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 21, 2026
)

* refactor(cli): keep private rendering frames with their callers

* refactor(cli): fold one-use skill rendering definitions

* refactor(agents): keep CLI compaction projections private to owner

* refactor(reply): consolidate single-consumer display projections

* refactor(cli): inline single-use command parsing and presentation frames

* refactor(diffs-language-pack): keep asset delivery in plugin entry

* refactor(agent-guidance): load instructions in plugin registration

* refactor(cli): render secrets reload failures at caller

* refactor(doctor): read update marker at preflight sites

* refactor(gateway): bind message omission at publication

* refactor(proxy): keep child capture receiver in listener owner

* refactor(mcp): assemble channel server at public serving owner

* refactor(doctor): keep secret diagnostics with health owner

* refactor(outbound): stage gateway media in send owner

* refactor(plugins): compose model auth in native loader

* refactor(deepinfra): compose private provider factories at owners

* refactor(media): fold single-consumer CLI and channel forwarders

* refactor(agents): fold private image and export assembly

* refactor(runtime): fold private pagination and failure-report frames

* refactor(runtime): compose private delivery and observation frames
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling channel: mattermost Channel integration: mattermost channel: reef Channel integration: reef channel: whatsapp-web Channel integration: whatsapp-web channel: x cli CLI command changes commands Command implementations extensions: agent-guidance extensions: deepinfra extensions: diffs gateway Gateway runtime P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. scripts Repository scripts 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