Skip to content

refactor(runtime): deslop unused internal options - #164810

Merged
steipete merged 5 commits into
mainfrom
deslop/l368-unused-options2-20261003
Oct 4, 2026
Merged

steipete merged 5 commits into
mainfrom
deslop/l368-unused-options2-20261003

Conversation

@steipete

@steipete steipete commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Unused internal options and result fields retain branches, forwarding layers, and state that no production caller needs. This continues the internal configuration cleanup in #164268.

User Impact

No user-visible change. Public plugin SDK signatures, configuration keys, CLI flags and output, persisted data, protocol fields, model-facing text, and visible UI behavior stay unchanged.

Why This Change Was Made

  • Specialize Discord's private REST, Gateway, command, and entity-cache settings to the values every production caller uses. Remove unread scheduler metrics and the history/counters maintained only for that projection; preserve actual queue, deadline, retry, rate-limit, and cache behavior.
  • Keep Nostr's live metric callbacks and remove the separate snapshot/reset accumulator that nobody consumes.
  • Make singular session patching call the existing canonical replacement owner directly. Remove the unused batch wrapper, per-operation policy callbacks, result array, and forwarding types while preserving projection, authorization, cloning, and commit order.
  • Remove reset transcript archival that July's in-place reset migration made unreachable, plus a maintenance-warning callback the receiver never read and its orphaned delivery helper. Retain reset results and lifecycle behavior.
  • Remove unread OAuth bootstrap inputs, keychain-option forwarding, transcript context fields, and unused private transcript-read options.
  • Remove always-enabled internal node-worker/duplex flags while preserving configuration, allowlist, and capability gates. Inline unused private skill-scanner switches to their existing traversal defaults.
  • Keep the typing circuit breaker with its sole callback owner, removing unused modes and an internal status-result protocol.
  • Give diagnostic failure-bundle writing one direct owner with its real event limit, retention count, and include-empty behavior. Keep persisted bundle readers and redaction unchanged. Test actual voice-digest policy limits instead of exposing a test-only policy override.
  • Use the existing terminal progress formatter directly, and put constant progress-line clearing in the stream writer rather than forwarding a callback.
  • Remove unused UI connection-timing adapters, avatar cache options, composer scope fallback, private snapshot-ID injection, divider callback, and unread send-timing fields.
  • Drop unused plugin startup artifact probes, MCP summary fields, bootstrap diagnostic opt-out, stale cache metadata, install-trust fields, package-inventory callback, and outbound context forwarding.

The overlap audit excludes active deslop PR files and the PR tooling closure. The shared CI inventory only loses the deleted test entry; assertion and mock baselines were regenerated shrink-only.

Evidence

  • Removes 1,157 net production lines and 2,141 lines overall across 137 files. Production counts exclude tests, fixtures, docs, generated files, and tooling.
  • Independent Codex autoreview is clean through P2, including the final test adaptations. The final base is 61ef2a47fdc5858a38f83f3f8d03af0bb8afe2ce. Fresh review after the required conflict repair is also clean through P2.
  • Linux focused proof passed 3,518 tests in 162 files across 18 shards (964.41s). Affected reruns passed the 117-test Gateway suite (75.13s), 18 tests in the two partial-mock fixtures (34.43s), and all 14 support-export tests (35.49s), with assertions preserved.
  • Both import-cycle checks report zero on the final source candidate. All 48 plugin contract files passed again on the refreshed base: 1,132 tests. A runtime build passed on the earlier candidate (20m39s); final-head build proof belongs to hosted CI.
  • The removed-export reference audit is clear across source, plugins, packages, UI, apps, scripts, and tests. Generated assertion/mock baselines only shrink. The final support-export test uses the canonical writer while retaining its ZIP-content and redaction checks.
  • Incorporated existing main fixes for the inherited XAI path-mapping failure (fix: restore XAI package boundary type mappings #164714) and memory-wiki Doctor import closure (4bac1493291); neither fix is duplicated in this diff. The refreshed Doctor closure checks pass.
  • Initial hosted CI identified three lint issues and obsolete option expectations in two test files. The correction preserves all test cases, canonical caller-authority assertions, and concurrent-client privacy assertions. Targeted lint is green, both cycle checks still report zero, and 1,290 tests across 55 files passed in 179.78s, including the full plugin contracts. The affected Gateway typecheck also passes. The corrected batch is preserved in the conflict-resolved head and passed exact-head CI.
  • Changed-file ratchets, formatting, plugin/SDK boundaries, and production core typechecking pass. The broader remote check reached the same obsolete keychain-option test assertion caught by CI; its owning test is corrected. Final hosted CI passed for the corrected head.

The required rebase preserved main's new pairing-failure precedence and pending-pairing cleanup while deleting only unused timing calls. All other commits replayed unchanged. Fresh integration proof passed 1,232 tests in 51 files (98.60s), including pairing/connection behavior, auth privacy, and plugin contracts; both cycle checks are zero.

Hosted CI run 37185994301 passed on d2b650b1c5e9690912ee8c524d531729b288ccd7, including the published-driver update contract and openclaw/ci-gate. Squash-merged as c071d238483a2aa9debc68095433c18e28ee138e.

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

@github-actions

github-actions Bot commented Oct 4, 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: d2b650b1c5e9690912ee8c524d531729b288ccd7
  • Maintainer: @steipete
  • Repository role: admin

These security sensitive changes were made:

  • src/agents/auth-health.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.
  • src/agents/auth-profiles/effective-oauth.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.
  • src/agents/auth-profiles/external-cli-sync.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.
  • src/agents/auth-profiles/oauth-manager.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.
  • src/agents/provider-auth-recovery-hint.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.
  • src/gateway/server-methods/models-auth-status-facts.ts: Controls Gateway authentication, pairing, or caller permissions. Check identity validation, scope checks, and revocation.
  • src/skills/security/scanner.ts: Controls product security checks or trust decisions. Check whether the change weakens detection, protection, or remediation.

Carefully review these changes before merging.

@openclaw-barnacle openclaw-barnacle Bot added channel: discord Channel integration: discord channel: nostr Channel integration: nostr app: web-ui App: web-ui gateway Gateway runtime cli CLI command changes scripts Repository scripts commands Command implementations agents Agent runtime and tooling size: XL labels Oct 4, 2026
@steipete
steipete enabled auto-merge (squash) October 4, 2026 06:55
@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, 3:36 AM ET / 07:36 UTC (Revision 3).

ClawSweeper review

What this changes

The branch removes unused private options, metrics, callbacks, and forwarding layers across runtime helpers, channel plugins, sessions, terminal output, and the Control UI, while adapting their tests.

Merge readiness

⛔ Blocked before merge - 3 items remain

Keep open: this remains useful internal cleanup that current main does not contain. The previous conflict blocker is resolved, and no concrete introduced regression was found in the reviewed paths.

Priority: P3
Reviewed head: d2b650b1c5e9690912ee8c524d531729b288ccd7

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) Useful, coherent cleanup with reported focused validation and no actionable defect found; hosted checks remain independent merge gates.
Proof confidence 🌊 off-meta tidepool Not applicable: The exact-head guard verifies repository-admin authorship, so the external-contributor proof gate does not apply. Reported tests cover retained behavior but are supplemental; no material authority expansion or stored-data contract change was identified.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The exact-head guard verifies repository-admin authorship, so the external-contributor proof gate does not apply. Reported tests cover retained behavior but are supplemental; no material authority expansion or stored-data contract change was identified.
Evidence reviewed 9 items Pinned introduction: Reviewed the merge-base-to-head delta using the pinned introduction identities, including files omitted from the prompt’s bounded list. Endpoint drift was not treated as PR ownership.
Conflict blocker resolved: The verified GitHub test merge records the pinned base as its first parent and the reviewed head as its second. Its UI delta retains pairing-failure precedence and pending-pairing cleanup while removing timing calls. A live GitHub read also reports the reviewed head as mergeable.
Session owner preserved: Singular patch projection still calls the canonical replacement owner, checks request authority after awaited projection, preserves label ownership and cloning, and retains alias-aware replacements. No schema or serialized session-format change was identified.
Findings None None.
Security None None.

How this fits together

OpenClaw’s runtime helpers connect CLI, UI, and channel requests to session storage, credentials, plugins, and execution services. This cleanup specializes those helpers to their existing production callers.

flowchart LR
  A[CLI and UI requests] --> C[Runtime helpers]
  B[Channel events] --> C
  C --> D[Existing authority and capability checks]
  D --> E[Session and credential owners]
  D --> F[Plugin and execution services]
  E --> G[Results and diagnostics]
  F --> G
Loading

Before merge

  • Resolve review confidence - ClawSweeper must reach high confidence before merge readiness is known.
  • 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: unknown-truncated-pull-files. Confirm migration or upgrade compatibility proof before merge.

Technical review

Best possible solution:

Keep one canonical owner for each retained behavior and preserve existing public contracts, settings, storage formats, and authority checks.

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

Not applicable: this PR proposes behavior-preserving cleanup rather than a reported bug; no runtime reproduction was executed during this read-only review.

Is this the best way to solve the issue?

Yes: specializing private helpers to their existing callers and retaining canonical owners is a maintainable direction; no concrete competing implementation or public-contract break was identified.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

No label changes.

Label justifications:

  • P3: This is internal cleanup with no established user-facing defect or urgent regression.
  • 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: The exact-head guard verifies repository-admin authorship, so the external-contributor proof gate does not apply. Reported tests cover retained behavior but are supplemental; no material authority expansion or stored-data contract change was identified.

Evidence

What I checked:

  • Pinned introduction: Reviewed the merge-base-to-head delta using the pinned introduction identities, including files omitted from the prompt’s bounded list. Endpoint drift was not treated as PR ownership. (d2b650b1c5e9)
  • Conflict blocker resolved: The verified GitHub test merge records the pinned base as its first parent and the reviewed head as its second. Its UI delta retains pairing-failure precedence and pending-pairing cleanup while removing timing calls. A live GitHub read also reports the reviewed head as mergeable. (ui/src/api/gateway.ts:209, f140feab35dd)
  • Session owner preserved: Singular patch projection still calls the canonical replacement owner, checks request authority after awaited projection, preserves label ownership and cloning, and retains alias-aware replacements. No schema or serialized session-format change was identified. (src/config/sessions/session-accessor.lifecycle.ts:39, d2b650b1c5e9)
  • Auth safeguards preserved: Removed bootstrap inputs were unread by the MiniMax bootstrap reader. Personal-profile exclusion, identity matching, usable-local-credential preference, and refresh-fence rejection remain in the effective credential path. (src/agents/auth-profiles/external-cli-sync.ts:70, d2b650b1c5e9)
  • Private extension boundary: Discord’s changed internal helpers and Nostr’s removed metric snapshot handle are absent from their public API barrels; terminal-core is explicitly private. This supports treating the removals as internal cleanup rather than plugin API removal. (extensions/nostr/api.ts:1, d2b650b1c5e9)
  • Still necessary on main: Fetched main still contains the batch session-patch wrapper, worker-run option, and UI connection-timing callback removed by this branch. The merged predecessor refactor(runtime): deslop runtime configuration knobs #164268 provides related cleanup context but does not supersede this contribution. (src/config/sessions/session-accessor.lifecycle.ts:43, 920820b202b4)

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 (2 earlier review cycles)
  • reviewed 2026-10-04T06:58:26.155Z sha 77abac9 :: blocked before merge. :: none
  • reviewed 2026-10-04T07:27:12.812Z sha 05d9521aead790de1cd10198588451ad7467c6b5 :: blocked before merge. :: none

@steipete
steipete force-pushed the deslop/l368-unused-options2-20261003 branch from 05d9521 to d2b650b Compare October 4, 2026 07:30
@steipete
steipete merged commit c071d23 into main Oct 4, 2026
204 of 205 checks passed
@steipete
steipete deleted the deslop/l368-unused-options2-20261003 branch October 4, 2026 07:50
steipete added a commit that referenced this pull request Oct 4, 2026
Remove invariant or unread private options, result fields, and forwarding layers across runtime owners, bundled plugins, Control UI, and private packages. Preserve configuration, CLI, SDK, persisted-data and wire contracts. Net production reduction: 1,421 lines.

Validation includes 6,489 focused tests, 139 exact-head integration cases, 1,135 plugin contracts, type/lint/guard checks, and zero static/runtime import cycles.

Land under the maintainer-authorized inherited-CI exception. Exact head 87d9ef3 has three inherited failed test shards. Auth/cron failures independently match main CI 37234906309; Google Meet matches scheduled main run 37235364849 and is fixed by #165133. The other executed checks passed. See the PR Evidence section for exact jobs and causal qualification.

Related: #164268, #164810.
steipete added a commit that referenced this pull request Oct 5, 2026
Specialize private agent, Gateway, infrastructure, and plugin flows to their actual callers. Remove unused options, fixed-value forwarding, and unread result fields while preserving public SDK, configuration, protocol, and lifecycle contracts. Preserve the new commentary-media ownership hook during conflict integration.

Net production reduction: 969 lines. Independent review was clean; focused owner tests passed and both import-cycle checks reported zero. Matching inherited main failures and exact-head CI evidence are recorded in PR #165198. Related prior batches: #164268, #164810, #165124.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 5, 2026
Remove fixed internal options, unread fields, and the forwarding layers and bookkeeping maintained only for them. Specialize Discord internals, preserve Nostr metric callbacks without unused snapshot state, simplify session patching through the canonical replacement owner, and remove private runtime, diagnostic, terminal, and UI options that callers never vary.

Public SDK, configuration, CLI, persisted-data, protocol, and visible behavior contracts stay unchanged. Lifecycle, authorization, rate-limit, and cleanup guarantees remain with their existing owners.

Validated with focused Linux tests, plugin contracts, both import-cycle checks, and independent review. Release-note context: internal simplification with no user-visible change.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 5, 2026
Remove invariant or unread private options, result fields, and forwarding layers across runtime owners, bundled plugins, Control UI, and private packages. Preserve configuration, CLI, SDK, persisted-data and wire contracts. Net production reduction: 1,421 lines.

Validation includes 6,489 focused tests, 139 exact-head integration cases, 1,135 plugin contracts, type/lint/guard checks, and zero static/runtime import cycles.

Land under the maintainer-authorized inherited-CI exception. Exact head 87d9ef3 has three inherited failed test shards. Auth/cron failures independently match main CI 37234906309; Google Meet matches scheduled main run 37235364849 and is fixed by openclaw#165133. The other executed checks passed. See the PR Evidence section for exact jobs and causal qualification.

Related: openclaw#164268, openclaw#164810.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 5, 2026
Specialize private agent, Gateway, infrastructure, and plugin flows to their actual callers. Remove unused options, fixed-value forwarding, and unread result fields while preserving public SDK, configuration, protocol, and lifecycle contracts. Preserve the new commentary-media ownership hook during conflict integration.

Net production reduction: 969 lines. Independent review was clean; focused owner tests passed and both import-cycle checks reported zero. Matching inherited main failures and exact-head CI evidence are recorded in PR openclaw#165198. Related prior batches: openclaw#164268, openclaw#164810, openclaw#165124.
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: web-ui App: web-ui channel: discord Channel integration: discord channel: nostr Channel integration: nostr cli CLI command changes commands Command implementations gateway Gateway runtime P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts 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