Skip to content

refactor: fold private operation helpers into their callers - #177655

Merged
steipete merged 2 commits into
mainfrom
deslop/z25-44-internal-owner-operations-20261015
Oct 19, 2026
Merged

steipete merged 2 commits into
mainfrom
deslop/z25-44-internal-owner-operations-20261015

Conversation

@steipete

@steipete steipete commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Private single-consumer modules repeat their caller's inputs in factories and transfer objects. Their tests often bypass the actual install, registration, transport, or provider operation.

User Impact

No intended user-visible behavior change, migration, or operator action. Public SDK exports, config keys, protocol and persisted shapes, CLI behavior, and lazy imports remain intact. Phase E session memory is untouched.

Why This Change Was Made

Fold private approval presentation preparation, queued-registration settlement, authenticated exec socket framing, update campaign/install/readiness helpers, web-search execution, env auth discovery, LINE card rendering, speech transports, Feishu comment delivery, thaw recovery, and remote onboarding into their existing production owners. Keep the operations' security, authority, durability, cancellation, bounds, retry, and outcome handling. Move private-helper tests to the actual requester/provider/handler/CLI/scheduler entry points; remove the retired modules and obsolete exact ratchet rows.

Update behavior is unchanged: host-owned and immutable installation refusals, campaign admission and cancellation, the lazy update runner, supervisor inspection, install payload transactions, nested leases, rollback, and visible warnings remain. Remote onboarding uses the same source snapshot/hash and commit operation, retaining credential replacement and SecretRef handling.

Net production LOC: 511 removed (+1,751 / -2,262), excluding tests, fixtures, test support, generated files, declarations, and inventories.

Best-effort tradeoffs accepted

  • Remove the second internal presentation decision Set/copy after the existing runtime input filter, deduplication, and deny fallback. It originated in #103579's durable-approval implementation, not a human report of malformed internal decisions. The freshly prepared internal array has no intervening writer; it is trusted directly now. All durable lifecycle behavior, external metadata validation, sanitization, size/hash/scope checks remain.
  • The other folds remove transfer plumbing and private factory surfaces, not security, durability, realistic concurrency, or effect-authority guards. No additional rare failure scenario is accepted.

Evidence

  • The initial hosted extension-lint job found two owned Feishu issues: a shadowed catch variable and a meaningless void on a synchronous migrated-test callback. The repair only renames that local binding and removes the no-op operator. Selected typed lint and formatting passed; targeted extension types, 19 Feishu public delivery/handler cases, and the 14-case suppression audit passed again (170.14s test wrapper). The repaired exact head has fresh hosted CI; no CI job was rerun.
  • Initial focused owner proof: 76 cases across six suites passed (246.09s wrapper), including reviewer-safe approval bounds, signed socket framing, UTF-8 splits, deadlines, cancellation, response loss, no local replay after possibly completed execution, and queued registration/kill/settlement behavior.
  • Both targeted native typecheck graphs passed. Typed migration exposed two cast-hidden Feishu fixtures returning invalid chunk mode line; they now return the real newline mode without casts. Both affected suites passed their 19-case replay.
  • Extension owner/sibling proof: 155 cases in 15 suites passed (344.67s wrapper): Feishu 51, LINE 63, Microsoft 16, and Azure 25. This includes actual provider voice discovery, hanging-response cancellation, HTTP/SSRF bounds, native card actions, partial receipts, and typing cleanup. Cold imports/worker setup dominate several file durations; no speed claim is made.
  • Full isolated independent review through P2 completed. Its sole finding claimed a missing Azure asOptionalRecord import; this was rejected because the helper is already imported at line 14 (and was imported by the original provider). Actual Azure voice-discovery cases also passed in the extension proof above; no cosmetic review rerun was requested.
  • Web-search/auth/maintenance/onboarding proof: 163 cases in 15 suites passed (457.61s wrapper), including the Feishu replay above.
  • CLI/hooks/startup proof: 271 cases passed initially; two newly migrated hook-fallback expectations incorrectly named the external-include rejection instead of the fixture's unsupported-include rejection. After asserting the full correct existing message, both cases passed (61.85s focused replay). No production behavior or assertion coverage was weakened.
  • The changed post-update repair suite requires the wrapper's runtime build. Its automatic prerequisite was stopped to honor this campaign's no-local-build CPU limit; exact-head hosted CI must cover that suite. No local pass is claimed.
  • Line-cap ratchet (43 changed source files), mandatory suppression audit (14 cases), four selected wrapper/import-closure cases, runtime cycles (zero), and Madge cycles (zero) passed. Extension boundary lint passed. No new lint suppression or allowance was introduced.
  • The database-worker inventory was regenerated through its owner after the hook-install caller moved; it also refreshes stale base locations/counts. It is descriptive generated output, not a new runtime/database allowance. No schema or stored data changed.
  • Final targeted core types and all 24 repaired web-search/prompt-prefix cases passed (160.83s wrapper). Core typed lint passed after renaming the nested hook-persistence lease/config bindings introduced by the fold. Assertion safety passed (2,544 files / 5,842 existing assertions); the mock ratchet passed (8,205 existing factories) after ten exact obsolete rows were removed. No baseline allowance grew.
  • Exact-head hosted CI remains the broad gate, including the explicitly deferred build-dependent repair suite. Local focused suite durations above include compiler/import/worker setup and are not performance claims.

Local application proof uses isolated HOME/OpenClaw/XDG state, nice -n 10, one worker, and serial commands. No local broad suite, whole-graph typecheck, completed build, or E2E is claimed; the automatic runtime prerequisite described above was stopped. PR CI is the broad proof.

@clawsweeper

clawsweeper Bot commented Oct 19, 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 19, 2026 19:34
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation channel: line Channel integration: line gateway Gateway runtime cli CLI command changes scripts Repository scripts commands Command implementations agents Agent runtime and tooling channel: feishu Channel integration: feishu plugin: azure-speech Azure Speech plugin extensions: microsoft labels Oct 19, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 19, 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-19T19:40:18.454258Z c6c327a 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

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

These security sensitive changes were made:

  • src/agents/agent-auth-discovery-core.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.
  • src/agents/agent-auth-discovery.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.
  • src/gateway/exec-approval-manager.ts: Controls sandbox containment or tool execution authority. Check filesystem and network isolation, approval scope, and command allowlists.
  • src/gateway/exec-approval-registration.ts: Controls sandbox containment or tool execution authority. Check filesystem and network isolation, approval scope, and command allowlists.

Carefully review these changes before merging.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c6c327adb3

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".


if (mode === "remote") {
await runNonInteractiveRemoteSetup({ opts, runtime, baseConfig, baseHash: snapshot.hash });
const remoteUrl = normalizeOptionalString(opts.remoteUrl);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Remove the retired remote-onboarding code reference

When the remote setup implementation is folded into this file, qa/scenarios/cli/cli-onboarding.yaml:27 is left pointing at the deleted src/commands/onboard-non-interactive/remote.ts. Remove that stale codeRefs entry so the onboarding scenario no longer advertises a nonexistent implementation file; the new owner is already listed immediately above it.

AGENTS.md reference: AGENTS.md:L50-L51

Useful? React with 👍 / 👎.

@clawsweeper clawsweeper Bot added the clawsweeper:intake:feature Preliminary submission classification; full source review pending. label Oct 19, 2026
@steipete
steipete enabled auto-merge (squash) October 19, 2026 20:08
@clawsweeper

clawsweeper Bot commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

What this changes

This PR folds private helpers into their production callers and moves their tests to those callers.

Example: Remote onboarding to wss://gateway.example.test with password replacement-password.

  • Before: The onboarding command delegates credential preparation and persistence to remote.ts.
  • After: The onboarding command performs the same preparation and persistence directly.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Useful owner consolidation with substantial focused validation, but the QA catalog cutover is incomplete and the aggregate CI gate remains pending.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored refactor is outside the ordinary contributor proof gate; supplied evidence describes focused owner tests, including real socket transport, rather than a shipped-entry-point demonstration, and inspection found no material authority-contract change.
Patch quality 🦐 gold shrimp (3/6) 1 actionable review finding remain.

Product

Kind: Refactor · Worth it: Yes
Reason: The maintainer-approved direction removes private factories and transfer objects while retaining existing operation owners and public contracts.

Merge readiness

⛔ Needs changes before merge - 1 item remains

Keep open: this maintainer-owned consolidation is useful, but deleting the remote-onboarding module leaves a QA catalog reference that fails its existing contract test.

Priority: P3
Reviewed head: ef3e1f1068f2a846011388cee6cf3366f12a85c7

Before merge

  • Remove the deleted remote-onboarding path from the QA catalog (P2) - Deleting src/commands/onboard-non-interactive/remote.ts leaves this codeRefs entry pointing to a nonexistent file. The existing catalog test in extensions/qa-lab/src/scenario-catalog.test.ts:24-36 resolves every reference and asserts that it exists, so this PR introduces a deterministic failure when that suite runs. Remove this entry; the surviving onboard-non-interactive.ts owner is already listed directly above it. This also resolves the earlier review comment at refactor: fold private operation helpers into their callers #177655 (comment).

Findings

  • [P2] Remove the deleted remote-onboarding path from the QA catalog — qa/scenarios/cli/cli-onboarding.yaml:27
Agent review details

How this fits together

CLI commands, Gateway maintenance, agent discovery, and bundled plugins own these operations; they consume configuration and requests and produce persisted updates, transport results, or channel output.

flowchart TD
  A[CLI commands and Gateway requests] --> B[Existing production owners]
  C[Bundled plugin requests] --> B
  B --> D[Configuration and state operations]
  B --> E[Socket and provider transports]
  B --> F[Channel replies and cards]
Loading

Technical review

Best possible solution:

Keep the owner consolidation and remove the obsolete remote.ts reference from the onboarding QA scenario.

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

The existing catalog test deterministically rejects the deleted remote.ts reference; this was established from source without running tests.

Is this the best way to solve the issue?

Folding single-consumer transfer plumbing into existing owners is appropriate, and the remaining cutover repair needs only removal of the stale QA reference.

Full review comments:

  • [P2] Remove the deleted remote-onboarding path from the QA catalog — qa/scenarios/cli/cli-onboarding.yaml:27
    Deleting src/commands/onboard-non-interactive/remote.ts leaves this codeRefs entry pointing to a nonexistent file. The existing catalog test in extensions/qa-lab/src/scenario-catalog.test.ts:24-36 resolves every reference and asserts that it exists, so this PR introduces a deterministic failure when that suite runs. Remove this entry; the surviving onboard-non-interactive.ts owner is already listed directly above it. This also resolves the earlier review comment at refactor: fold private operation helpers into their callers #177655 (comment).
    Confidence: 0.99
    Late finding: first raised on code an earlier review cycle already covered.

Overall correctness: patch is incorrect
Overall confidence: 0.94

AGENTS.md: found and applied where relevant.

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

Provenance checked

Testing

Proof path: in-process harness.

Security

None.

Evidence

Acceptance criteria:

  • pnpm test extensions/qa-lab/src/scenario-catalog.test.ts --maxWorkers=1
  • git diff --check

What I checked:

PR surface

Source -511, Tests +24, Docs +6, Other -12. Total -493 across 63 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 32 1751 2262 -511
Tests 27 1099 1075 +24
Docs 1 526 520 +6
Config 0 0 0 0
Generated 0 0 0 0
Other 3 2 14 -12
Total 63 3378 3871 -493

Labels

Label changes:

  • add P3: This is internal consolidation without intended product changes; the identified repair concerns QA catalog integrity.
  • 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 consolidation without intended product changes; the identified repair concerns QA catalog integrity.
  • 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 19, 2026, 4:11 PM ET / 20:11 UTC.

@steipete
steipete merged commit c916135 into main Oct 19, 2026
175 of 176 checks passed
@steipete
steipete deleted the deslop/z25-44-internal-owner-operations-20261015 branch October 19, 2026 20:17
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash auto-merge.

vincentkoc added a commit that referenced this pull request Oct 19, 2026
* commit '08e32fdb4df002c9d4eea158b855d6521dd1e916': (52 commits)
  test(gateway): restore local probe deferred import
  fix(agents): release prompt diagnostics for retired sessions (#177614)
  fix(release): tag restart plugin cohorts consistently (#177725)
  refactor(ui): inline single-caller detail requests (#177705)
  chore(i18n): refresh native locales (#177721)
  refactor(codex): drop unread private runtime reports (#177689)
  refactor(ui): consolidate static artwork registries (#177692)
  refactor(ui): derive settings schema analysis in the view (#177624)
  refactor(media): consolidate capability defaults and compression grids (#177665)
  refactor(auth): bind OAuth managers to native provider operations (#177676)
  refactor(ui): remove redundant component rendering layers (#177607)
  fix(ios): model sign-in is a permanent row under the composer instead of an item in the model menu (#166082)
  fix(agents): report failed secret input prompt delivery (#177688)
  refactor(ui): share chat message render contracts (#177668)
  fix(ui): settle model status after overlapping publication (#177667)
  refactor(gateway): reuse native workspace and lifecycle facts (#177670)
  refactor(runtime): rely on canonical async lifecycle owners (#177635)
  refactor: fold private operation helpers into their callers (#177655)
  refactor(ui): remove unused chat leaf element adapters (#177582)
  perf(talk): use published authority for foreign voice writes (#177533)
  ...
@steipete

Copy link
Copy Markdown
Contributor Author

The QA catalog reference and folded-socket network-scan routing are repaired in merged #177733 (725c926). The routing regression tests were red on the prior source and green with the repair; the QA code-reference check passes. Fresh main ancestry of the squash is verified.

vincentkoc added a commit that referenced this pull request Oct 19, 2026
#167350)

* fix(pr): retain the admitted workflow across maintainer commands

* fix: refresh the reviewed correction baseline

Baseline-Refresh: a89bd166b79d54b343b93ad374f8ebfa4f3d1163

* fix(pr): preserve cold workflow admission and repository identity

* chore(pr): integrate canonical main CI repair

* commit '08e32fdb4df002c9d4eea158b855d6521dd1e916': (52 commits)
  test(gateway): restore local probe deferred import
  fix(agents): release prompt diagnostics for retired sessions (#177614)
  fix(release): tag restart plugin cohorts consistently (#177725)
  refactor(ui): inline single-caller detail requests (#177705)
  chore(i18n): refresh native locales (#177721)
  refactor(codex): drop unread private runtime reports (#177689)
  refactor(ui): consolidate static artwork registries (#177692)
  refactor(ui): derive settings schema analysis in the view (#177624)
  refactor(media): consolidate capability defaults and compression grids (#177665)
  refactor(auth): bind OAuth managers to native provider operations (#177676)
  refactor(ui): remove redundant component rendering layers (#177607)
  fix(ios): model sign-in is a permanent row under the composer instead of an item in the model menu (#166082)
  fix(agents): report failed secret input prompt delivery (#177688)
  refactor(ui): share chat message render contracts (#177668)
  fix(ui): settle model status after overlapping publication (#177667)
  refactor(gateway): reuse native workspace and lifecycle facts (#177670)
  refactor(runtime): rely on canonical async lifecycle owners (#177635)
  refactor: fold private operation helpers into their callers (#177655)
  refactor(ui): remove unused chat leaf element adapters (#177582)
  perf(talk): use published authority for foreign voice writes (#177533)
  ...

Co-authored-by: Vincent Koc <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 20, 2026
…#177655)

* refactor: fold private operation helpers into their callers

* fix: resolve Feishu owner-fold lint errors
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 20, 2026
openclaw#167350)

* fix(pr): retain the admitted workflow across maintainer commands

* fix: refresh the reviewed correction baseline

Baseline-Refresh: a89bd166b79d54b343b93ad374f8ebfa4f3d1163

* fix(pr): preserve cold workflow admission and repository identity

* chore(pr): integrate canonical main CI repair

* commit '4f8617589b6c71d754171052b603fe534901bfa1': (52 commits)
  test(gateway): restore local probe deferred import
  fix(agents): release prompt diagnostics for retired sessions (openclaw#177614)
  fix(release): tag restart plugin cohorts consistently (openclaw#177725)
  refactor(ui): inline single-caller detail requests (openclaw#177705)
  chore(i18n): refresh native locales (openclaw#177721)
  refactor(codex): drop unread private runtime reports (openclaw#177689)
  refactor(ui): consolidate static artwork registries (openclaw#177692)
  refactor(ui): derive settings schema analysis in the view (openclaw#177624)
  refactor(media): consolidate capability defaults and compression grids (openclaw#177665)
  refactor(auth): bind OAuth managers to native provider operations (openclaw#177676)
  refactor(ui): remove redundant component rendering layers (openclaw#177607)
  fix(ios): model sign-in is a permanent row under the composer instead of an item in the model menu (openclaw#166082)
  fix(agents): report failed secret input prompt delivery (openclaw#177688)
  refactor(ui): share chat message render contracts (openclaw#177668)
  fix(ui): settle model status after overlapping publication (openclaw#177667)
  refactor(gateway): reuse native workspace and lifecycle facts (openclaw#177670)
  refactor(runtime): rely on canonical async lifecycle owners (openclaw#177635)
  refactor: fold private operation helpers into their callers (openclaw#177655)
  refactor(ui): remove unused chat leaf element adapters (openclaw#177582)
  perf(talk): use published authority for foreign voice writes (openclaw#177533)
  ...

Co-authored-by: Vincent Koc <[email protected]>
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: feishu Channel integration: feishu channel: line Channel integration: line clawsweeper:intake:feature Preliminary submission classification; full source review pending. cli CLI command changes commands Command implementations docs Improvements or additions to documentation extensions: microsoft gateway Gateway runtime plugin: azure-speech Azure Speech plugin scripts Repository scripts security-sensitive-changed size: XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant