Skip to content

refactor(runtime): deslop runtime configuration knobs - #164268

Merged
steipete merged 3 commits into
mainfrom
deslop/x06-env-flags-knobs-20261002
Oct 3, 2026
Merged

steipete merged 3 commits into
mainfrom
deslop/x06-env-flags-knobs-20261002

Conversation

@steipete

@steipete steipete commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Private runtime helpers still expose options and alternate paths that no production caller selects, duplicating decisions already made by their callers.

User Impact

Users retain the same behavior, documented configuration and environment variables, persisted data, protocol shapes, tool descriptions, and UI output. Shipped SDK exports remain intact.

Why This Change Was Made

  • Require the embedded session owner's selected model, thinking level, and prepared resources. Remove unreachable default model selection and ambient resource discovery while retaining explicit extension resource hooks, model clamping, and session identity fences.
  • Collapse Discord command deployment to its existing global reconciliation path and make the private REST scheduler own its fixed production limits. Preserve application-scoped deployment hashes, rate-limit retries, lane scheduling, request authority, and settlement.
  • Remove unused legacy-store read maintenance, write hooks, force overrides, and reporting branches. Retain current configuration, live admission preservation, artifact cleanup, disk-budget commits, and the shared maintenance ordering.
  • Replace the unused generic source-delivery builder with Cron's concrete projection. Remove smaller unused CLI, QA, redaction, and UI knobs; reuse the existing QA credential environment reader.

The batch removes 1,068 net production lines and 639 net test/support lines. Tests exercise the retained production paths using real admission scopes and fixed scheduler defaults. The max-lines exception for the now-smaller resource loader and the reduced cast count are pruned.

Evidence

  • Independent Codex autoreview: scoped clean through P2; supplied diff and caller evidence reviewed.
  • Both import-cycle checks: 0 cycles after rebasing onto current main.
  • Production and test types, all three Knip export scans, database/authorization guards, and targeted core/UI/plugin/script lint passed. The broad core lint fallback timed out after 900 seconds; the native targeted route covered every existing changed core/UI file and passed.
  • Focused runtime proof: 106 files / 2,270 tests passed, including all 48 plugin contract files / 1,132 tests. The repository runner completed 11 serial shards in 2,723 seconds with one Vitest worker. Existing SQLite/session migration and ownership tests dominate this elapsed time on the shared Mac; their real failure and preservation assertions remain intact.
  • UI proof: 3 files / 27 tests passed in 11.20 seconds, covering settings controls and toast placement/lifecycle.
  • The test preparation build compiled the worker generation successfully (12,187 inputs, 18,098 outputs; 115.5 seconds). Hosted build-artifacts, architecture, dependency, source-contract, and core lint checks passed on 7b85ca91a64124b4dbf5be6436269c85c53adc8f in CI run 37119615795. After the fixture corrections below, final-head CI run 37121056677 passed on 5f5e9ac40d92c67d3be8e624db59065f3f0b5b2d; squash merge e8df9f33024f6370978e49310abee4f2f63b9023 completed on October 3, 2026.
  • Main advanced during publication and conflicted in the resource-loader test. The resolution preserves main's constructor helper, no-ambient-resolution assertion, and exact prompt-name/path assertion while exercising explicit extension resources. Fresh P0-P2 review passed; all three resource-loader/root-help test files passed again in 117.15 seconds. Production changes remain unchanged.
  • Blacksmith remained queued; AWS first refused allocation and a later provisioning attempt was canceled without a ready machine. Validation uses the explicitly authorized local fallback at nice -n 15, one heavy command at a time.

Fixes Found Along the Way

Hosted CI exposed two fixture dependencies on the retired session defaults. The shared fixture now carries its configured thinking level into session creation, preserving the existing high-reasoning and compaction assertions. Worker lifecycle tests now assert that prepared turns avoid policy rediscovery, then explicitly exercise the real policy resolver in the same subprocess to retain the source-policy and compiled SDK identity regression checks. All shutdown, authority, transcript, and settlement assertions remain. The four affected and sibling suites pass 118 tests in 312.11 seconds with one worker. The two reasoning suites also pass 14 tests under Bun in 74.03 seconds, matching the failed CI runtime. Fresh independent review is clean through P2.

@clawsweeper

clawsweeper Bot commented Oct 3, 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 3, 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: 5f5e9ac40d92c67d3be8e624db59065f3f0b5b2d
  • Maintainer: @steipete
  • Repository role: admin

These security sensitive changes were made:

  • src/agents/sessions/auth-guidance.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.
  • src/logging/redact-bounded.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 channel: discord Channel integration: discord app: web-ui App: web-ui cli CLI command changes commands Command implementations agents Agent runtime and tooling extensions: qa-lab size: XL labels Oct 3, 2026
@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 3, 2026
@clawsweeper

clawsweeper Bot commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed October 3, 2026, 7:58 AM ET / 11:58 UTC (Revision 3).

ClawSweeper review

What this changes

The PR removes unused private runtime options and alternate paths across session assembly, Discord, session maintenance, CLI, QA, redaction, and UI helpers.

Merge readiness

⛔ Blocked before merge - 2 items remain

This remains useful, unmerged cleanup with no blocking defect found. Retained production callers and the public SDK boundary do not support the earlier generic compatibility blocker.

Priority: P3
Reviewed head: 5f5e9ac40d92c67d3be8e624db59065f3f0b5b2d

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) Useful, coherent internal simplification with retained production defaults and no actionable correctness finding.
Proof confidence 🌊 off-meta tidepool Not applicable: The ordinary external-contributor proof gate does not apply to this repository-admin cleanup. Source inspection connects the changed helpers to retained production callers; supplied test results are supplemental. No stored-data contract change or material authority transfer 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 ordinary external-contributor proof gate does not apply to this repository-admin cleanup. Source inspection connects the changed helpers to retained production callers; supplied test results are supplemental. No stored-data contract change or material authority transfer was identified.
Evidence reviewed 10 items Pinned introduction and clean checkout: Reviewed the merge-base-to-head introduction rather than endpoint drift. The final checkout remained clean; the supplied test merge is stale and was not used to infer removal of current-main behavior.
Prepared session callers: The embedded attempt, compaction, and worker session creators already provide model, thinking level, and resource loader explicitly. Removing their unused fallback assembly does not replace those callers' selected settings.
Public SDK boundary: The public agent-sessions SDK explicitly exports selected persistence and extension operations; it does not expose createAgentSession or DefaultResourceLoader. The removed options therefore do not change this public plugin contract.
Findings None None.
Security None None.

How this fits together

Runtime owners prepare models, resources, delivery policy, and maintenance settings before passing them to internal helpers. These helpers assemble agent sessions, schedule Discord requests, and maintain session artifacts.

flowchart TD
  A[Configuration and admitted work] --> B[Runtime owners]
  B --> C[Prepared session inputs]
  C --> D[Agent sessions]
  B --> E[Discord request scheduler]
  E --> F[Discord transport]
  B --> G[Session maintenance]
  G --> H[Session rows and artifacts]
Loading

Before merge

  • 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 decisions with the existing runtime owners and let private helpers consume their prepared inputs while preserving public configuration and storage contracts.

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

Not applicable: this is behavior-preserving cleanup, and no introduced failing path was identified; tests were not executed during this read-only review.

Is this the best way to solve the issue?

Yes: the inspected production callers already own the removed decisions, and the explicit public SDK exports and persisted identities remain intact.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

No label changes.

Label justifications:

  • P3: This removes unused internal configuration paths without an identified user-facing behavior change.
  • 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 ordinary external-contributor proof gate does not apply to this repository-admin cleanup. Source inspection connects the changed helpers to retained production callers; supplied test results are supplemental. No stored-data contract change or material authority transfer was identified.

Evidence

What I checked:

  • Pinned introduction and clean checkout: Reviewed the merge-base-to-head introduction rather than endpoint drift. The final checkout remained clean; the supplied test merge is stale and was not used to infer removal of current-main behavior. (5f5e9ac40d92)
  • Prepared session callers: The embedded attempt, compaction, and worker session creators already provide model, thinking level, and resource loader explicitly. Removing their unused fallback assembly does not replace those callers' selected settings. (src/agents/embedded-agent-runner/run/attempt-session-prepare.ts:160, 5f5e9ac40d92)
  • Public SDK boundary: The public agent-sessions SDK explicitly exports selected persistence and extension operations; it does not expose createAgentSession or DefaultResourceLoader. The removed options therefore do not change this public plugin contract. (src/plugin-sdk/agent-sessions.ts:4, 5f5e9ac40d92)
  • Discord defaults and persisted identity retained: The scheduler retains four workers, a 1000-request limit, three rate-limit retries, and the existing lane weights. Global command reconciliation retains the exact application-scoped persisted hash key and failure-tolerant cache handling. (extensions/discord/src/internal/command-deploy.ts:44, 5f5e9ac40d92)
  • Security boundary retained: Queued requests still carry captured authority into execution and recheck it before transport. Revised authority tests saturate the actual four-worker default and retain revoked-caller rejection assertions. Redaction retains its existing production thresholds and replacement algorithm. (extensions/discord/src/internal/rest.ts:145, 5f5e9ac40d92)
  • Storage compatibility scope: Legacy-store callers remain Doctor-owned. The patch removes unused read-maintenance and reporting options while retaining write validation, persisted projection, durable atomic writes, admission preservation, artifact cleanup, and maintenance configuration. No stored schema or serialized format changes were identified. (src/infra/state-migrations.legacy-session-store.ts:290, 5f5e9ac40d92)

Likely related people:

  • steipete: 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-03T11:12:09.544Z sha 9799463c6d40dc51b806b53b458e6788dc25a1d6 :: blocked before merge. :: none
  • reviewed 2026-10-03T11:32:40.649Z sha 7b85ca9 :: blocked before merge. :: none

Remove private option branches with no production setters across embedded session assembly, Discord scheduling/deployment, legacy-store maintenance, and source delivery. Keep documented configuration and environment semantics, public SDK exports, persisted shapes, and current admission ownership unchanged.
Remove orphan warning and model guidance helpers, exercise real tool and maintenance boundaries in fixtures, and prune resolved line/assertion baselines. Keep warning delivery types, admission preservation, and migration failure assertions intact.
@steipete
steipete force-pushed the deslop/x06-env-flags-knobs-20261002 branch from 9799463 to 7b85ca9 Compare October 3, 2026 11:25
@steipete
steipete enabled auto-merge (squash) October 3, 2026 11:28
@steipete
steipete disabled auto-merge October 3, 2026 11:43
@steipete
steipete enabled auto-merge (squash) October 3, 2026 11:53
@steipete
steipete merged commit e8df9f3 into main Oct 3, 2026
165 of 167 checks passed
@steipete
steipete deleted the deslop/x06-env-flags-knobs-20261002 branch October 3, 2026 12:03
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 4, 2026
## What Problem This Solves

Private runtime helpers still expose options and alternate paths that no production caller selects, duplicating decisions already made by their callers.

## User Impact

Users retain the same behavior, documented configuration and environment variables, persisted data, protocol shapes, tool descriptions, and UI output. Shipped SDK exports remain intact.

## Why This Change Was Made

- Require the embedded session owner's selected model, thinking level, and prepared resources. Remove unreachable default model selection and ambient resource discovery while retaining explicit extension resource hooks, model clamping, and session identity fences.
- Collapse Discord command deployment to its existing global reconciliation path and make the private REST scheduler own its fixed production limits. Preserve application-scoped deployment hashes, rate-limit retries, lane scheduling, request authority, and settlement.
- Remove unused legacy-store read maintenance, write hooks, force overrides, and reporting branches. Retain current configuration, live admission preservation, artifact cleanup, disk-budget commits, and the shared maintenance ordering.
- Replace the unused generic source-delivery builder with Cron's concrete projection. Remove smaller unused CLI, QA, redaction, and UI knobs; reuse the existing QA credential environment reader.

The batch removes **1,068 net production lines** and 639 net test/support lines. Tests exercise the retained production paths using real admission scopes and fixed scheduler defaults. The max-lines exception for the now-smaller resource loader and the reduced cast count are pruned.

## Evidence

- Independent Codex autoreview: scoped clean through P2; supplied diff and caller evidence reviewed.
- Both import-cycle checks: **0 cycles** after rebasing onto current main.
- Production and test types, all three Knip export scans, database/authorization guards, and targeted core/UI/plugin/script lint passed. The broad core lint fallback timed out after 900 seconds; the native targeted route covered every existing changed core/UI file and passed.
- Focused runtime proof: **106 files / 2,270 tests passed**, including all **48 plugin contract files / 1,132 tests**. The repository runner completed 11 serial shards in **2,723 seconds** with one Vitest worker. Existing SQLite/session migration and ownership tests dominate this elapsed time on the shared Mac; their real failure and preservation assertions remain intact.
- UI proof: **3 files / 27 tests passed** in **11.20 seconds**, covering settings controls and toast placement/lifecycle.
- The test preparation build compiled the worker generation successfully (**12,187 inputs, 18,098 outputs; 115.5 seconds**). Hosted `build-artifacts`, architecture, dependency, source-contract, and core lint checks passed on `7b85ca91a64124b4dbf5be6436269c85c53adc8f` in [CI run 37119615795](https://github.com/openclaw/openclaw/actions/runs/37119615795). Final-head hosted CI remains the landing gate.
- Main advanced during publication and conflicted in the resource-loader test. The resolution preserves main's constructor helper, no-ambient-resolution assertion, and exact prompt-name/path assertion while exercising explicit extension resources. Fresh P0-P2 review passed; all three resource-loader/root-help test files passed again in 117.15 seconds. Production changes remain unchanged.
- Blacksmith remained queued; AWS first refused allocation and a later provisioning attempt was canceled without a ready machine. Validation uses the explicitly authorized local fallback at `nice -n 15`, one heavy command at a time.

## Fixes Found Along the Way

Hosted CI exposed two fixture dependencies on the retired session defaults. The shared fixture now carries its configured thinking level into session creation, preserving the existing high-reasoning and compaction assertions. Worker lifecycle tests now assert that prepared turns avoid policy rediscovery, then explicitly exercise the real policy resolver in the same subprocess to retain the source-policy and compiled SDK identity regression checks. All shutdown, authority, transcript, and settlement assertions remain. The four affected and sibling suites pass **118 tests in 312.11 seconds** with one worker. The two reasoning suites also pass **14 tests under Bun in 74.03 seconds**, matching the failed CI runtime. Fresh independent review is clean through P2.
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 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 cli CLI command changes commands Command implementations extensions: qa-lab P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. 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