Skip to content

refactor: localize single-consumer internal frames - #180363

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

steipete merged 8 commits into
mainfrom
deslop/z25-91-internal-surface-20261015

Conversation

@steipete

@steipete steipete commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Internal operations still route through private single-consumer functions that only prepare arguments, project a result, or supply one callback. The separate frames obscure the code that actually owns each operation.

User Impact

No intended user-visible change, migration, or operator action. Public contracts remain unchanged.

Why This Change Was Made

Localize those frames in their existing consumers across CLI input and diagnostics, secret setup, Gateway credentials and identity, execution finalization, channel ingress, memory-wiki queries, Discord monitoring, and meeting page-script construction. Shared helpers, public entry points, security checks, and lazy-import boundaries remain.

Net production LOC: 523 removed across 28 production files. Moved implementation bodies receive no deletion credit. Existing behavioral tests are unchanged; one stale suppression-allowlist row already removed on main is dropped (29 files total). No user-visible feature, configuration, CLI, protocol, SDK, persisted shape, or migration changes. The standalone session memory backend and all Phase E machinery and tests are untouched.

Best-effort tradeoffs accepted

No guards removed and no new behavioral compromise. Private function names and internal stack/async layering become shallower. Error classification, authorization and live-authority checks, response limits and release ordering, capture timing, recovery, exact diagnostics, and generated meeting-script template bytes remain intact.

Evidence

Each packet passed serial focused owner/consumer tests with one worker and isolated HOME/OpenClaw/XDG state, targeted native typechecks, typed lint, formatting, line caps, and independent Codex review through P2 with no actionable findings. Focused packet counts: memory-wiki 52 cases/5 files; setup and finalization 116/10; CLI 112/10; ingress and credentials 152/14; authenticated identity 69/4; execution and plan projection 136/11; Discord and meeting transports 261/15. Counts overlap where a retained public consumer is relevant to multiple packets.

Final pre-push suppression ratchet (14 cases), assertion ratchet, wrapper/eager-import closure (four selected cases), runtime/static cycles (zero each), and line caps passed. The suppression ratchet initially identified a stale allowlist row for a Gateway helper whose suppression main already removed; the shrink-only correction passed focused proof and independent review through P2. Hosted CI on the exact pushed head is the broad proof. No local build, broad suite, whole-graph typecheck, live provider, installed-service, browser, or performance result is claimed. This is implementation framing cleanup, not a change to rendering or generated page-script contents.

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

@steipete
steipete marked this pull request as ready for review October 22, 2026 06:18
@openclaw-barnacle openclaw-barnacle Bot added channel: discord Channel integration: discord gateway Gateway runtime commands Command implementations agents Agent runtime and tooling extensions: memory-wiki plugin: zoom Zoom plugin plugin: teams-meetings Teams Meetings plugin plugin: slack-huddles size: XL labels Oct 22, 2026
@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-22T06:22:30.817083Z ed22eba 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.

@github-actions

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: ed22eba4e857c41eb23f3014eca1a34ede45cd11
  • Maintainer: @steipete
  • Repository role: admin

These security sensitive changes were made:

  • src/agents/auth-profiles/external-cli-auth-selection.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.
  • src/agents/bash-tools.exec-approval-followup.ts: Controls sandbox containment or tool execution authority. Check filesystem and network isolation, approval scope, and command allowlists.
  • src/gateway/credentials.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.
  • src/secrets/channel-contract-api.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.
  • src/secrets/plugin-setup-plan.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.

@steipete
steipete merged commit e8cde75 into main Oct 22, 2026
217 of 227 checks passed
@steipete
steipete deleted the deslop/z25-91-internal-surface-20261015 branch October 22, 2026 06:28
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 23, 2026
* refactor(memory-wiki): localize single-use query and status frames

* refactor: localize single-use setup and finalization frames

* refactor(cli): fold single-use input and diagnostic frames

* refactor(core): fold single-consumer ingress and credential frames

* refactor(gateway): localize authenticated identity projections

* refactor(core): fold private execution and plan projection frames

* refactor(extensions): fold private transport and monitor frames

* test: drop stale Gateway suppression allowance
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling channel: discord Channel integration: discord commands Command implementations extensions: memory-wiki gateway Gateway runtime plugin: slack-huddles plugin: teams-meetings Teams Meetings plugin plugin: zoom Zoom plugin security-sensitive-changed size: XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant