Skip to content

refactor: keep internal preparation with its sole consumers - #180279

Merged
steipete merged 20 commits into
mainfrom
deslop/z25-89-internal-surface-20261015
Oct 22, 2026
Merged

steipete merged 20 commits into
mainfrom
deslop/z25-89-internal-surface-20261015

Conversation

@steipete

@steipete steipete commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Internal command and plugin implementations still expose single-consumer modules and private preparation frames that add indirection without sharing an operation.

User Impact

No intended user-visible change, migration, or operator action. Public SDK, CLI, configuration, protocol, and persisted-data contracts stay unchanged.

Why This Change Was Made

Keep preparation with its existing consumer: fold search configuration leaves into their clients, X reply delivery into its sending owner, canonical session-repair evidence into candidate preparation, and private command, provider, serialization, status, and UI preparation frames into their existing execution phases. Discord conversation callbacks now own their single-use preparation directly. Shared helpers and dynamic-import boundaries remain separate.

Tests that depended on retired internal exports now exercise the existing public request, repair-candidate, delivery, or plugin-callback entry point. Native plugin integrity/admission checks, provider acceptance observers, authority checks, cancellation, durable writes, output bytes, and prompt-prefix behavior remain.

Net production LOC: 502 removed across 55 production files; 68 files total. Tests grow by 209 net lines as internal-seam assertions move to public boundaries. The assertion-safety baseline shrinks by one to match the removed Discord assertion. Counts exclude tests, fixtures, generated files, and declarations; moved implementation bodies receive no deletion credit.

Best-effort tradeoffs accepted

None added: this is an internal ownership/surface cut, not removal of concurrency, security, durability, or integrity guards. Existing best-effort behavior remains unchanged. The standalone session memory backend and its factory, registry, expiry, federation, and tests are untouched.

Evidence

Each implementation packet received focused serial tests, targeted native typechecking, formatting, and independent P0–P2 review. Focused suites cover the affected command, provider/client, delivery, repair, plugin-callback, serialization, and UI owners; the stable prompt-prefix suite is included. All review findings were resolved before the corresponding commit.

Local proof gap: Mantle typed lint reports SimpleStreamOptions as an unresolved/error type in the unchanged resolveMantleReasoning declaration. Targeted native types pass; the SDK and llm-core source definitions are present, but local generated package declarations are absent. A narrow source-config attempt produces the same lint diagnostics. No cast, suppression, declaration build, or source workaround was added, and local typed lint for Mantle is not claimed green. Exact-head CI must qualify this owner.

Pre-push guards passed: suppression suite (14 cases), assertion-safety ratchet after the shrink-only update, wrapper/eager-import closure (4 selected cases), runtime cycles (0), static Madge cycles (0), and line caps. The final plugin/Mantle packet passed 39 cases across six files, plus one unchanged second-filesystem-dependent skip. Tests ran serially with one worker and isolated state.

Broad builds, full graph typechecking, cross-platform/browser execution, and live providers are intentionally left to exact-head PR CI under the campaign's host CPU budget. ci:full is requested for the existing UI shell/pairing paths; there is no markup, styling, or intended visual change.

CI attribution

Exact head: ecd4d85641161911ab1eaca101c7d46f57a64d44; completed CI run 39720334509, attempt 1. CI is red only on the two inherited leaves below and their downstream aggregate; this is not a green-CI claim.

Failed job Evidence and attribution
checks-node-compact-small-8 The unchanged source-owners case rejects src/auto-reply/reply/commands-plugin.native-subagents.test.ts as an unexpected cross-area consumer. That file was added on main and is absent from this PR head. The single case passes at exact PR head and fails with the identical extra path on clean CI main parent 6c00e67f5703c85f2aea88cf79f7ff702821fbb5. Actual CI checkout c5e24b078ba6ab808bbfc34710ddda2daaa09ec8 has that main parent followed by the PR head. This is inherited main-integration fallout, not a waived PR regression.
checks-node-changed-7 The unchanged quiet-child restart complete and reset cases with child replaced: false time out in waiting-for-continuation, with calls parent,parent,child,child. Both fail with the same case/phase/call-sequence/TimeoutError signature on the clean actual CI main parent in focused Blacksmith baseline 39721952754, lease tbx_01m5gxg031vwdj5f87m1nms7z5. Only those two cases were selected; three others were unselected. Baseline Vitest took 200.60s. Source was independently bound to 6c00e67f5703c85f2aea88cf79f7ff702821fbb5; state was isolated and one worker used. The test and determining restart/admission owners are unchanged by this PR.
openclaw/ci-gate Downstream aggregate of exactly the two failed leaves above. No other selected failing suite or pending job remains.

The coordinator flake catalog and the last six completed scheduled-main run inventories were checked; no listed-flake shortcut is claimed. The paginated exact-head census contains 322 checks and no pending job. Types, lint (including Mantle), security-fast, and all other selected suites pass. Sixteen historical cancelled metadata jobs are superseded by successful auto-response 119635813105, dispatch 119635813279, and PR-context 119635812395 replacements; no test suite is missing proof. The tested merge tree was independently reconstructed from its ordered main/head parents and matches exactly.

Peter's standing campaign authority selects the native inherited-failure exception with this complete failure table. No security, review, or PR-caused failure is waived; no CI rerun or synthetic push was used. The baseline requested the routine 8-class workflow but observed two usable CPUs and 8 GB RAM; its runtime preparation and focused tests were remote, not local broad proof.

@steipete steipete added the ci:full Keep ordinary native-locale CI selection on the next PR run. label Oct 22, 2026
@clawsweeper

clawsweeper Bot commented Oct 22, 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 22, 2026 04:04
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 22, 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-22T04:22:06.320186Z ecd4d85 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: discord Channel integration: discord app: web-ui App: web-ui gateway Gateway runtime cli CLI command changes commands Command implementations extensions: duckduckgo labels Oct 22, 2026
@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: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 22, 2026
@clawsweeper

clawsweeper Bot commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

What this changes

This PR moves private preparation logic into its existing consumers and removes the retired helpers and modules.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Source review supports behavior preservation, but the additional failed restart-continuation job prevents a fully qualified validation verdict.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored internal refactor is outside the ordinary contributor proof gate; supplied validation consists of focused tests and CI, with no shipped-entry-point run claimed.
Patch quality 🦐 gold shrimp (3/6) No actionable review findings were identified.

Product

Kind: Refactor · Worth it: Yes · Fix scope: Complete
Reason: The maintainer-authored direction removes private indirection using existing owners while preserving public contracts and behavior.

Merge readiness

⛔ Needs changes before merge - 1 item remains

Keep open: this maintainer-directed refactor has no confirmed introduced defect, but a newly failed restart-continuation CI job still needs attribution.

Priority: P3
Reviewed head: ecd4d85641161911ab1eaca101c7d46f57a64d44

Before merge

  • Complete next step - Compare the checks-node-changed-7 quiet-child restart failures against the base or a reverted candidate, then repair any demonstrated PR regression or establish inherited-failure attribution.

Findings

None.

Agent review details

How this fits together

CLI commands, provider plugins, channel delivery, Doctor, and UI owners prepare inputs for existing runtime operations and return the same outputs and receipts.

flowchart TD
  A[Commands and plugin callbacks] --> B[Existing operation owners]
  B --> C[Local preparation]
  C --> D[Existing runtime contracts]
  D --> E[Network and storage operations]
  E --> F[Results and delivery receipts]
Loading

Technical review

Best possible solution:

Retain the consolidated owners and resolve attribution of the additional failed CI job before landing.

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

This PR reports unnecessary internal indirection rather than a user-facing bug; source inspection confirms the helper-to-consumer moves.

Is this the best way to solve the issue?

Inlining the private preparation into existing owners is a coherent simplification, and the reviewed diff removes the replaced paths without adding competing state or policy.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • X reply delivery keeps the original intent (9666c02: The X channel introduced weighted public reply chains; subsequent native-media work retained guarded uploads and partial-delivery reporting, all preserved in the sending owner.)
  • Radius authentication and streaming keeps the original intent (f89fa78: Radius requires plugin-owned device authorization and native streamed-message conversion; the moved logic retains validation, current-authority checks, terminal events, and cancellation cleanup.)
  • Canonical session repair keeps the original intent (de291a3: Durable transcript ownership repair follows inventoried owner evidence; the later iterative resolver in 9fb7ba2 avoids deep-chain stack overflow and remains intact.)
  • Stable serialization keeps the original intent (53fedc7: Shared serialization consolidated deterministic handling of cycles and special values; the refactor retains the canonical serializer and its stack cleanup, normalized ordering, and streaming writer.)
  • Native plugin admission keeps the original intent (c19dc23: Admission reuses verified members and placements while reporting progress; inlining preserves those caches, integrity checks, and host validation.)
  • Pairing refresh lifecycle keeps the original intent (c7d9291: Pairing state survives reconnects while rejecting stale or unauthorized refresh results; generation, client, connection, disposal, and access checks remain.)
  • Gateway health JSON routing keeps the original intent (ba8bccb: The successful JSON route avoids loading presentation code; the inlined options preparation preserves that lazy boundary.)
  • Service environment rendering keeps the original intent (2b01bcf: Install planning owns managed environment rendering; relocation retains platform-specific value sources and existing SecretRef precedence.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

  • Pinned introduction reviewed: The merge-base-to-head diff contains the internal moves and removals described in the PR; endpoint drift was excluded from authorship assessment, and the checkout remained clean. (ecd4d8564116)
  • Delivery and authority preserved: X delivery retains media preparation, per-request authority callbacks, cancellation, sequential replies, and partial-delivery receipts; the transport still checks current authority immediately before dispatch. (extensions/x/src/send.ts:316, ecd4d8564116)
  • Verified no-migration case: Canonical session-owner resolution is relocated without changing its algorithm, database scoping, cycle handling, or repair outputs; service environment precedence and the local-avatar storage key and parsing remain unchanged. (src/commands/doctor-session-canonical-candidates.ts:100, ecd4d8564116)
  • New failed check remains unattributed: The completed checks-node-changed-7 job reports quiet-child restart-continuation failures for reset and complete at test/gateway-subagent-restart.e2e.test.ts:693, beyond the source-owner failure discussed in the PR body; the aggregate CI gate remains failed. (test/gateway-subagent-restart.e2e.test.ts:693, ecd4d8564116)
  • Existing CI attribution corroborated: The checks-node-compact-small-8 annotation names the same unexpected native-subagents test reported by the maintainer; history shows that test arrived through feat(plugins): let authenticated commands launch native subagents #180173 on main, while this PR does not introduce it. (test/scripts/ci-changed-node-test-plan.source-owners.test.ts:229, ecd4d8564116)
  • Validation and inspection limits: Current-head production types, lint, and security checks pass; no tests were run during this read-only review. Job-log downloads were blocked by the storage-host allowlist, so failure inspection used GitHub annotations; the supplied test-merge object and installed Solid cheatsheet were unavailable locally. (ecd4d8564116)

Likely related people:

  • Peter Steinberger: Raw commit c19dc23 adds src/plugins/plugin-native-reference.ts:92 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: c19dc239d20b; files: src/plugins/plugin-native-reference.ts)
  • Vincent Koc: Raw commit c6ca11e adds extensions/duckduckgo/src/ddg-client.ts:18 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: c6ca11e5a5d0; files: extensions/duckduckgo/src/ddg-client.ts)
  • qingminlong: Raw commit d6f097b adds src/agents/stable-stringify.ts:13 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: d6f097b3de01; files: src/agents/stable-stringify.ts)

PR surface

Source -502, Tests +209, Other 0. Total -293 across 68 files. Added test files: 2.

View PR surface stats
Area Files Added Removed Net
Source 55 1461 1963 -502
Tests 12 371 162 +209
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 1 1 0
Total 68 1833 2126 -293

Review metrics

Metric Value Why it matters
Production versus test LOC Production −502 net; tests +209 net The reduction removes private handoff surfaces, while test growth moves coverage to retained request, delivery, repair-candidate, and plugin-callback boundaries.

Labels

Label changes:

  • add P3: This is internal cleanup with no intended user-visible behavior change or established urgent regression.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🌊 off-meta tidepool and patch quality is 🦐 gold shrimp.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Label justifications:

  • P3: This is internal cleanup with no intended user-visible behavior change or established urgent regression.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🌊 off-meta tidepool and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

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 22, 2026, 12:34 AM ET / 04:34 UTC.

@steipete

Copy link
Copy Markdown
Contributor Author

Exact-head inherited-failure evidence for ecd4d85641161911ab1eaca101c7d46f57a64d44, CI 39720334509, attempt 1:

Failed job Baseline attribution
119632509425, checks-node-compact-small-8 The unchanged source-owner case rejects main-added commands-plugin.native-subagents.test.ts. It passes at exact PR head and fails identically on clean actual CI main parent 6c00e67f5703c85f2aea88cf79f7ff702821fbb5 (one selected case, 25.86s / 24.97s). The added consumer is absent at PR head.
119632509262, checks-node-changed-7 Both unchanged quiet-child restart cases (complete / reset, child replaced false) fail identically on that clean main parent in focused Blacksmith baseline 39721952754: waiting-for-continuation, parent,parent,child,child, TimeoutError. Two cases failed, three unselected; 200.60s Vitest. Isolated state, one worker, source verified independently before execution.
119638361052, openclaw/ci-gate Aggregate of exactly those two leaves.

All 322 paginated exact-head checks are complete. Types, lint including Mantle, security-fast 119632508026, and every other selected suite pass. Sixteen historical metadata cancellations have successful auto-response 119635813105, dispatch 119635813279, and context 119635812395 replacements; no cancelled test-suite proof is missing. The coordinator flake catalog and last six completed scheduled-main inventories were inspected; no listed-flake shortcut is claimed.

Actual CI checkout c5e24b078ba6ab808bbfc34710ddda2daaa09ec8 has ordered parents [6c00e67f5703c85f2aea88cf79f7ff702821fbb5, ecd4d85641161911ab1eaca101c7d46f57a64d44]; independent merge-tree reconstruction matches tree 971f47f5171afb602ad7091d18a59db31ee90365. The failed test/helper and determining restart/admission owners are unchanged by this PR. The baseline Testbox was stopped and its cleanup reconciled.

Peter's standing campaign authority selects the native inherited-failure exception, pinned to this exact reviewed head. CI remains red; no PR-caused failure, security gate, or enforced review is waived. No CI rerun, synthetic push, timeout, retry, or skip change was used.

@steipete
steipete merged commit 6384f87 into main Oct 22, 2026
320 of 340 checks passed
@steipete
steipete deleted the deslop/z25-89-internal-surface-20261015 branch October 22, 2026 04:39
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via explicitly authorized admin squash with attributed pre-existing CI failures.

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

* refactor: keep Gemini preparation and ACP tails with their callers

* refactor: keep Perplexity tool construction with its callback

* refactor: keep canonical owner evidence with repair candidates

* refactor: inline private serialization and health filter frames

* refactor(diffs): inline sole-consumer language alias accessor

* refactor(infra): inline private platform preparation frames

* refactor(x): keep reply delivery with its sole owner

* refactor(doctor): inline single-consumer environment preparation

* refactor(commands): inline private diagnostic preparation frames

* refactor(radius): inline private auth and stream preparation

* refactor(cli): inline private completion and update presentation

* refactor(core): inline private schema routing and error frames

* refactor(core): fold private status and runtime preparation frames

* refactor(duckduckgo): keep search configuration in its sole client

* refactor(ui): inline private pairing and avatar frames

* refactor(cli): inline private request and presentation frames

* refactor(runtime): inline single-use preparation frames

* refactor(discord): own conversation callbacks in the plugin

* refactor(plugins): inline private activation and transport frames

* chore: shrink Discord assertion baseline after surface cleanup
lonexreb added a commit to lonexreb/paloa-claw that referenced this pull request Oct 28, 2026
…retired

Main removed resolveGatewayServiceEnvForPlatformNotes in openclaw#180279; the rebase
kept a copy nothing calls, which failed the prod-types, test-types and lint
gates.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
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: discord Channel integration: discord channel: x ci:full Keep ordinary native-locale CI selection on the next PR run. cli CLI command changes commands Command implementations extensions: amazon-bedrock-mantle extensions: diffs extensions: duckduckgo extensions: google extensions: perplexity extensions: radius extensions: searxng 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. size: XL status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant