Skip to content

refactor(core): remove vestigial private controls and test seams - #178807

Merged
steipete merged 2 commits into
mainfrom
deslop/z28-39-core-private-controls-20261015
Oct 21, 2026
Merged

steipete merged 2 commits into
mainfrom
deslop/z28-39-core-private-controls-20261015

Conversation

@steipete

@steipete steipete commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Private core helpers still exposed options, alternate signatures, and injected dependencies that no runtime caller used.

User Impact

No user-visible change. Existing defaults, authorization checks, plugin/config/CLI/protocol contracts, persisted data, and ordinary restart/settlement behavior stay intact. No migration is required. The standalone Phase E session-memory backend and its factory, registry, expiry/federation machinery, and tests are untouched.

Why This Change Was Made

Remove unused private arguments and the branches they kept alive across plugin metadata, Doctor diagnostics, agent bookkeeping, local-audio inspection, and one-shot setup. Tests use canonical module spies or the real production boundary instead of runtime-only test controls. Remove unread result members without removing their live computations or error handling.

This is the core/packages area of the widely imported core/plugin helper family, split from its extension area to keep CI attribution bounded. The campaign's area-split rule waives the usual size floor for these slices. Net production reduction: 217 lines; tests/support shrink 49 lines; 65 paths. No UI, dependency, generated schema, SDK export, or database schema/durability/retention change.

Best-effort tradeoffs accepted

  • Retired one-shot history/pending-proposal controls are gone after the interactive fallback retirement in fix(onboarding): keep Tauri setup recoverable and verify model results #139140; actual TUI history, verified inference, approval and terminal-error behavior stay. No current caller can request the abandoned prompt branch.
  • The deferred-install existing-token selector has no producer after refactor(update): simplify update execution and finalization #154160. Normal explicit/config/SecretRef precedence and token generation/persistence remain; the unreachable deferred-only error is removed.
  • Maintenance-lane prewarming has no producer after fix(subagents): recover healthy agents during slow database checks #176916. Foreground cold/cancellation/error handling and the underlying workers remain; no current boot path requested that extra prewarm.
  • The old expected-handle recovery argument originally protected real ownership in fix: secret requests preserve native answers and live requester authority #132122. refactor(sessions)!: give each session one controller for turns, queues, and Stop #175837 completed the cutover to registered-owner recovery; the present diagnostic never passes it. Current injection still checks registered ownership and live authority, including after callbacks. No live recovery guard is removed.
  • Plugin bundled-fallback disabling was introduced as a synthetic alternative in 8ddd9b8aac69; callers use default/true. Keep the full bundled resolution/secret-input policy. A future private caller cannot turn it off without defining a real contract.
  • Required-file hash diagnostics became orphaned when perf(plugins): unify progressive plugin cache ownership #131442 moved their actual caller to the cache-file reader. The remaining caller always passed false. File hashing/staleness/error handling and the cache reader's real diagnostics remain.
  • Workspace-compatibility and async effective-plugin selectors have one live value. Keep the actual fingerprint check and effective selection unconditionally, rather than retaining private bypass/full-report modes nobody selects.
  • Failed-ingress health has no worker-context supplier, so its cache branches never ran. Keep the measured Gateway cache from perf(gateway): park idle database maintenance behind owner receipts #171320 unchanged, including expiry, invalidation, and errors; the Doctor reader uses the same worker query and missing-database behavior.
  • Systemd prompt/title overrides have no suppliers. The same label and all Linux, service-owner, confirmation, sudo, and manual-recovery behavior remain. Private tool-model/auth-message overrides likewise had no suppliers; configured policy and real failover classification stay.
  • Test-only Doctor, upstream-monitor, planner, and local-audio substitutions now use their canonical dependencies. Keep currentness, read-error preservation, restrictive model policy, bounded subprocess output, idle/CAS/durable-event checks and settlement. Real local-STT repairs from fix(media): verify local STT acceleration before prioritizing it #104210/fix(media): discover whisper.cpp models instead of a test fixture path #124699 remain, with actual Windows/PATH/model and backend-observation assertions retained. Only an unnecessary synchronous-lookup aggregate microtask yield disappears.
  • Finalizer target-tracking forwarding is unread after fix: recovery compaction ignores Stop and loses committed counts #133260 moved the real accounting to its owner; execution tracking and compaction accounting stay. Unread fallback/log result fields and the unused two-argument random-integer form are removed; fallback text, stderr output bounds, errors, cryptographic randomness, and the public token/redaction APIs stay.
  • Verbose descriptions keep the real 320-character boundary and UTF-16 safety. Tests exercise that real limit instead of a private small-limit override; compact descriptions retain their independently live limit.

These are unused-argument cuts, not permission to discard incident fixes or security/durability guards. No live failure scenario is intentionally dropped.

Evidence

  • All production callers were checked across core, packages, extensions, UI, and scripts; SDK/barrel escapes, introducing changes, and in-flight activations were checked before each cut.
  • Fresh-main targeted native typecheck passed for the original selected changed roots. Sixty-three cleanup file blobs are identical to the individually reviewed/proved collector; the one overlapping Doctor file preserves main's newer JSON-with-comments parser and was replayed separately. The additional direct Doctor test is covered by the CI repair below.
  • Focused owner/sibling tests were run serially with one worker and isolated HOME/OpenClaw/XDG state. Retained groups include plugin metadata/status/hash fixtures, Doctor/token/repair sequencing, agent diagnostics/liveness, real upstream reader/transcript fixtures, system-agent behavior, ingress health, description boundaries, crypto/slug/telemetry, and gateway-client projection.
  • Latest local-audio proof passed 27 selected cases across four files, including the nine-case production language-forwarding table; real PATH/PATHEXT and backend-observation checks remain. Its initial fixture type error was fixed without casts or weakened assertions. No live GPU/provider claim.
  • Final fresh-main Doctor replay: 139 cases passed across seven focused suites. Typed lint, formatting, whitespace and all 14 lint-suppression cases passed. Runtime and Madge cycle checks both reported zero cycles.
  • Independent full-area review completed with no actionable P0–P2 findings. The original 64-file cleanup is a strict subset of that reviewed candidate: two duplicate meeting-clock files already owned by refactor(core): remove unused private helper arguments #178666 were removed before publication and are not counted here. The additional direct-test repair was independently reviewed with no actionable P0–P2 finding.
  • CI repair: run 39506351602, job 118917140531 (check-test-types-core-5), found a missed direct Doctor test still passing the removed private pluginProviderIds option. This is attributable to this PR. Remove only that argument member; retain the same JSONC fixture, warning/model/fallback assertions, and byte-exact catalog preservation. Its selected native typegraph and real canonical-discovery test passed; no replacement mock, production change, weakened assertion, or test growth.
  • Named-gate integration: run 39511959813, job 118936204233, found an inherited unbound HealthCheck.repair extraction introduced by newer main in fix(doctor): show progress while checks and repairs run #178767. Main e6b866d3adb8 reproduced the exact lint failure; four strengthened existing repair-flow cases also failed before the fix. Direct main repair 5d80482379b3 binds the method to its check. This branch now includes that fix after a conflict-free rebase; both cleanup commits are patch-identical by range comparison, and all 65 PR file blobs are identical to the previous head. The selected changed-root native typegraph and all 10 focused Doctor flow/startup cases pass on the integrated head. Prior-head CI remains prior-head evidence; the new exact head must pass its own hosted gates.
  • PR CI on the exact pushed head is the broad gate. No full local typecheck, build, broad suite, E2E, live service mutation, or CI rerun was used.

@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 22:12
@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-20T23:52:58.812721Z bca164f New commits
ℹ️ 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 the gateway Gateway runtime label Oct 20, 2026
@github-actions

github-actions Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ Security sensitive changes

This maintainer PR changes sensitive security components.

No secops approval is required. This comment is informational because the PR author has Maintain or Admin access.

  • Current SHA: bca164fcdb21a9c6252bcf7f591337f2caf8c6eb
  • Maintainer: @steipete
  • Repository role: admin

These security sensitive changes were made:

  • src/agents/embedded-agent-runner/run/auth-controller.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.
  • src/secrets/runtime-config-collectors-plugins.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.

Carefully review these changes before merging.

@openclaw-barnacle openclaw-barnacle Bot added the cli CLI command changes label Oct 20, 2026
@openclaw-barnacle openclaw-barnacle Bot added commands Command implementations agents Agent runtime and tooling size: XL labels Oct 20, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. 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. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. 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 removes unused private options, dependency substitutions, alternate branches, and unread result fields from core helpers.

Example: Automatic transcription uses language pt-BR with whisper-cli installed.

  • Before: The runner passes a private options object and produces --language pt.
  • After: The runner passes the language directly and still produces --language pt.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Source and focused owner-level evidence support the cleanup, with no actionable finding; available proof remains harness-based.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored behavior-preserving refactor is outside the ordinary contributor proof gate; supplied evidence exercises production helpers through focused tests, while inspected historical setup screenshots do not establish current cleanup coverage.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Refactor · Worth it: Yes
Reason: The maintainer-approved direction reduces private maintenance surface without introducing another owner, configuration option, or supported behavior change.

Merge readiness

✅ Ready for maintainer review

This maintainer-authored PR provides useful internal cleanup with no actionable introduced defects found; exact-head CI remains pending.

Priority: P3
Reviewed head: bca164fcdb21a9c6252bcf7f591337f2caf8c6eb

Before merge

None.

Findings

None.

Agent review details

How this fits together

CLI, Gateway, Doctor, and agent callers use these helpers to derive plugin metadata, inspect runtime state, prepare setup operations, and report diagnostics.

flowchart TD
  A[CLI and Gateway requests] --> B[Core helper callers]
  B --> C[Plugin metadata owners]
  B --> D[Agent and session owners]
  B --> E[Doctor and setup owners]
  C --> F[Existing results and effects]
  D --> F
  E --> F
Loading

Technical review

Best possible solution:

Retain the smaller private interfaces and canonical owners while preserving existing runtime behavior and completing ordinary CI gates.

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

No product bug reproduction is claimed; source inspection supports the stated unused-private-control cleanup.

Is this the best way to solve the issue?

Removing unused controls at their existing owners is the smallest coherent approach, and the changed tests retain real limits, platform behavior, currentness, and failure handling.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Bundled plugin contract fallback changes intended behavior with a stated reason (8ddd9b8: The disabling selector was introduced to narrow plugin config test surfaces; production callers retain the default bundled-resolution policy.)
  • Gateway metadata workspace compatibility keeps the original intent (dde140c: Compatible Gateway metadata reuse required the workspace fingerprint check; the sole caller selected that check and the PR makes it unconditional.)
  • Registered recovery ownership keeps the original intent (9e302fb: Recovery needed live requester ownership; the later controller cutover moved actual injection checks to the exact registered owner.)
  • Auth-profile failure copy keeps the original intent (64a946a: Exhausted auth-profile failover needed actionable diagnostics; both current callers use error-derived or generated copy and never supply the removed message override.)
  • One-shot planner history changes intended behavior with a stated reason (07bf384: Conversational onboarding originally supplied planner history; the merged single-loop onboarding repair retired that interactive planner path while retaining one-shot planning.)
  • Deferred install token selector keeps the original intent (000af98: The selector supported deferred update/service recovery; the merged updater simplification retired its producer, leaving ordinary token precedence and persistence intact.)
  • History maintenance prewarming keeps the original intent (aa154c3: Reader preparation supported restored requester admission; the later independent-recovery change removed the aggregate producer.)
  • Installed plugin file hashing keeps the original intent (71e361a: The split index helper supported required-file diagnostics; the progressive-cache cutover moved that responsibility, and its remaining caller always selected optional hashing.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

PR surface

Source -217, Tests -49. Total -266 across 65 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 37 174 391 -217
Tests 28 319 368 -49
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 65 493 759 -266

Review metrics

Metric Value Why it matters
Production versus test reduction Production +174/-391; tests/support +319/-368 The net production reduction removes private branches and controls; test changes replace injection plumbing while retaining distinct behavioral assertions.

Labels

Label changes:

No label changes.

Label justifications:

  • P3: This is behavior-preserving internal cleanup with no established user-facing regression.
  • 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.

History

Review history (2 earlier review cycles)
  • reviewed 2026-10-20T22:31:50.892Z sha c7f9f060f84c5c14fef88f4838ae40248da114e2 :: needs maintainer review before merge. :: none
  • reviewed 2026-10-20T23:06:56.177Z sha 2e6247da3f905b4cc6326adbaa091cdb978316c2 :: needs maintainer review before merge. :: none

Reviewed October 20, 2026, 7:56 PM ET / 23:56 UTC (Revision 3).

@steipete

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. labels Oct 20, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

The remaining failure on head 2e6247da3f905b4cc6326adbaa091cdb978316c2 is inherited from newer main, not from this cleanup:

Run / job Failure Attribution
39511959813 / 118936204233 check-lint-core-2: doctor-repair-flow.ts:73:28, typescript(unbound-method) on check.repair This PR does not change that file or the public HealthCheck method declaration. Main commit c6f14b27a938 (#178767) introduced the exact line after the PR branch point. Focused lint on main e6b866d3adb8 reproduced the exact diagnostic.

The progress wrapper had detached the repair method from its check. The existing normalized test fixture happened to preserve the receiver, masking the bug. A raw, valid receiver-dependent check makes all four existing repair-flow table cases fail before the fix. Binding the method restores those cases, config carry, and change output while preserving progress, dry-run, and repair validation.

The direct red-main repair is 5d80482379b376f9ad921b6acff0df9bc2ce8c80. Focused proof passed: selected native noEmit graph, 10 cases across the repair-flow and startup suites, typed lint, format, 14 suppression checks, runtime cycles 0, and Madge cycles 0. Independent review found no actionable P0–P2 issues. The patch remained identical through the conflict-free main refresh.

I am integrating that repair for this named failing gate. No CI rerun, empty push, test weakening, or cleanup hunk removal is being used to chase green. The earlier PR-owned test-type failure was fixed separately on the current head and its replacement type jobs passed.

@steipete
steipete force-pushed the deslop/z28-39-core-private-controls-20261015 branch from 2e6247d to bca164f Compare October 20, 2026 23:48
@steipete

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@steipete
steipete enabled auto-merge (squash) October 21, 2026 00:06
@steipete
steipete disabled auto-merge October 21, 2026 00:24
@steipete

steipete commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor Author

Exact-head CI attribution for bca164fcdb21a9c6252bcf7f591337f2caf8c6eb, run 39517358789, attempt 1:

Failed job Attribution and proof
checks-node-changed-compact-large-8 / 118953151050 Inherited stale assertion in doctor-core-checks.test.ts: expects Groq name-only model replacement removed intentionally by #178722. Serial isolated replays of this exact case fail identically on the PR head and actual CI main baseline 4213136ceea79e9c39e3aa9f15f8c2f52df7a183. The test, detection owner, migration resolver, normalization bridge and normalizer are byte-identical in baseline and captured CI merge 0e65316501864e09118de6e8525263495eed4857.
openclaw/ci-gate / 118963383793 Downstream of that sole leaf failure. All 127 planned jobs completed; no cancelled coverage. Independent security-fast passed.

All exact-head check runs were enumerated. The old cancelled PR-context job 118952612417 is superseded by successful job 118952712160. The main-flake registry and six latest completed scheduled-main job inventories were checked; no matching-signature shortcut is claimed. The independent baseline replay establishes attribution. No CI rerun, empty push or relabeling of failed CI as green.

The stale Groq expectation is corrected separately on main in signed commit 8d9e341071be, preserving the intended model-choice behavior. The existing input moves from the migration table to the unconfirmed-model advisory table; no production code or cases change. All 14 Doctor flow cases passed after integration, as did targeted native types, typed lint, formatting, whitespace and 14 suppression cases. Independent P0–P2 review found no actionable defect. The unchanged cleanup head landed through the native inherited-failure admin exception, with captured checkout, artifact hashes, exact failed-attempt review, and complete failure accounting. Focused cleanup tests, targeted native typechecks, lint/format, suppression and cycle checks passed; the independent review is clean. Public/security/durability contracts and Phase E remain unchanged.

@steipete
steipete merged commit 6f8ca36 into main Oct 21, 2026
180 of 184 checks passed
@steipete
steipete deleted the deslop/z28-39-core-private-controls-20261015 branch October 21, 2026 00:35
@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 21, 2026
…nclaw#178807)

* refactor(core): remove vestigial private controls and test seams

* test(doctor): use canonical provider discovery in catalog repair
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling cli CLI command changes commands Command implementations 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. security-sensitive-changed 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