Skip to content

refactor(core): deslop forwarding layers - #165567

Merged
steipete merged 3 commits into
mainfrom
deslop/l386-forwarding-core-20261005
Oct 5, 2026
Merged

steipete merged 3 commits into
mainfrom
deslop/l386-forwarding-core-20261005

Conversation

@steipete

@steipete steipete commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Private core flows rebuild parameter bags and result objects through forwarding functions that add no decision or invariant.

User Impact

No user-visible change is intended. Configuration, persisted data, protocol payloads, CLI output, model-facing text, public Plugin SDK surfaces, and runtime authority/lifecycle boundaries remain unchanged.

Why This Change Was Made

One batch removes 1,001 net production lines across 63 changed files, excluding tests and baselines:

  • Route node catalog, inventory, invocation, and artifact HTTP callers through their existing owners; remove private request/event projections.
  • Inline outbound send, poll, media-parameter, and approval projections while retaining durable delivery, current authority, error text, and cleanup ordering.
  • Collapse plugin discovery, install-summary, catalog, runtime-ID result, and provider-selection forwarding. Keep metadata-first discovery and dynamic runtime imports lazy.
  • Remove duplicate isolated-completion and PDF inference context/result adapters, preserving invocation snapshots, resource leases, fallback order, prompt bytes, and cancellation checks.
  • Inline single-use model-diagnostic, CLI-log, and Talk configuration/override adapters; keep bounded diagnostics, redaction, provider projection, and secret-owner checks intact.
  • Inline eligible private update/package and approval adapters without changing validation, process options, or rollback custody.

Four private forwarding modules are removed. Existing consumer/schema fixtures remain; assertions for deleted node DTO builders are covered by retained NodeRegistry wire tests. No skips, timeout increases, retries, or weakened failure thresholds are added. Assertion baselines only shrink. The protected PR-tooling closure, private node-queue pruning boundary, and peer-owned paths are unchanged from the base.

Evidence

  • Independent Codex autoreview completed at P1+. The original batch's sole finding concerned a supposedly missing cross-context guarded-action check. The complete enforceCrossContextPolicy still returns immediately for actions outside CONTEXT_GUARDED_ACTIONS; the removed helper repeated that check. The finding was rejected on source evidence. Both corrective deltas received fresh scoped-clean reviews.
  • Original focused owner/entry-point proof: 97 files, 1,887 passed, one existing Linux-only shell-session case skipped on macOS; six Vitest shards in 2,364.68s. No test cases or CI lanes are added. Existing single-file cost sample: pnpm test src/plugins/config-policy.test.ts --maxWorkers=1, 8.50s wall time.
  • Full pnpm build passed in 3,395.92s before the final protected-boundary restoration and replacement inlining. Targeted lint and both import-cycle checks passed before that correction. Final affected proof is recorded below when complete.
  • Plugin contracts: 46 files passed; the full reduced-priority run reported a 180s repository-scan setup timeout and a session-patch registry test crossing the existing five-second forced-retirement deadline (1,138 cases passed, one failed, one did not run). The test and directly executed owners are byte-identical on base and candidate. The same isolated selector passed on both; no flake fix or matching baseline failure is claimed. The canonical check-deprecated-api-usage.mts --rule=internal-config-api scan passed directly. Original failures remain recorded; hosted CI supplies Linux acceptance.
  • Blacksmith Testbox never supplied a usable runner; all owned leases are stopped. AWS and Hetzner capacity was unavailable, including AWS vCPU quota exhaustion on the last retry. Authorized fallback checks run locally at nice -n 15, one heavy command at a time.
  • Initial CI exposed a deleted file still required by the protected PR-tooling closure. All seven touched closure files were restored, including config-policy.ts; the closure inventory was not changed. The node-queue refactor also triggered the current-policy scanner at four internal maintenance calls, so the original private pruning/public read distinction was restored without changing or suppressing the scanner.
  • No live Gateway, deployment, or release was changed.

Initial hosted failures and correction

The previous CI run used merge ref 2d24037341d218e1a3e9644621f169c428a5d311 (PR head c085dec018381803ae67d032b04425bc119d8ea0 merged into main 223f6e44). Its state-migration import cycle was fixed on main by 21901766c53433f1f269e996055ffc617a1766e7; none of the 17 cycle members are changed in this PR. Main 2fec39f57319be5b6e0b20b5305665ed1ff5e685 also contains the Copilot cancellation and Codex thread-cleanup fixes corresponding to four provider-harness failures. The next hosted merge-ref run must verify those fixes; these commits are not substitutes for passing CI. A separate 120s session-projection timeout remains unclassified, with no inherited-failure waiver claimed.

A supplemental local PR-provisioning run recorded a 120s macOS sparse-transition timeout and was interrupted. Its source-integrity check also detected a restoration made during the run, so that run is not accepted as final proof. No fixture, assertion, timeout, scanner, or protected tooling source was changed to accommodate it. Final focused proof runs against the unchanged committed source.

Final correction proof

On edf83589ba4f1af0bcfde27088830b4bd70edeec, eight focused files passed: 299 tests in 483.35s wall time. This covers CLI spawning/log redaction, model diagnostics/hooks, Talk handlers/configuration, ClawHub install validation, package installation, and the restored config-policy boundary. The runner verified the unchanged source generation at completion.

The final local lint invocation was interrupted during Plugin SDK declaration preparation after 345.43s; no final lint pass is claimed. Hosted lint on the pushed head remains required.

Both final import-cycle checks passed on edf83589ba4f1af0bcfde27088830b4bd70edeec: Madge zero cycles (144.36s), runtime values zero cycles (173.34s).

Inline private forwarding functions and parameter/result adapters into existing runtime owners. Remove five internal forwarding modules while preserving public SDK, lazy loading, authority, cleanup, prompt text, and wire/config/state contracts.
@clawsweeper

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

These security sensitive changes were made:

  • src/gateway/server-http.ts: Controls Gateway authentication, pairing, or caller permissions. Check identity validation, scope checks, and revocation.
  • src/infra/exec-approval-command-display.ts: Controls sandbox containment or tool execution authority. Check filesystem and network isolation, approval scope, and command allowlists.
  • src/infra/exec-approval-forwarder.messages.ts: Controls sandbox containment or tool execution authority. Check filesystem and network isolation, approval scope, and command allowlists.
  • src/infra/exec-approvals-effective.ts: Controls sandbox containment or tool execution authority. Check filesystem and network isolation, approval scope, and command allowlists.

Carefully review these changes before merging.

@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime agents Agent runtime and tooling size: XL labels Oct 5, 2026
Comment thread src/gateway/node-runtime-state.ts Fixed
Comment thread src/gateway/node-runtime-state.ts Fixed
Comment thread src/gateway/node-runtime-state.ts Fixed
@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 5, 2026
@clawsweeper

clawsweeper Bot commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed October 5, 2026, 9:36 AM ET / 13:36 UTC (Revision 3).

ClawSweeper review

What this changes

The branch removes private forwarding helpers across agent execution, Gateway requests, message delivery, plugin loading, and updates while preserving their existing behavior.

Merge readiness

✅ Ready for maintainer review

Keep open: the refactor remains useful, and no concrete introduced defect was found. The earlier migration-proof warning is unsupported by the current diff and should not remain a blocker. Required CI still gates landing.

Likely related people: steipete (medium-confidence routing) and obviyus (low-confidence routing), based on prior merged work.

Priority: P3
Reviewed head: edf83589ba4f1af0bcfde27088830b4bd70edeec

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) Useful, coherent cleanup with preserved owner boundaries and substantial reported validation; no actionable correctness finding remains.
Proof confidence 🌊 off-meta tidepool Not applicable: The verified trusted author is exempt from external-contributor runtime proof; reported focused tests are supplemental validation. The diff does not materially change authority or stored-data contracts, so neither additional authority proof nor migration proof is required.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The verified trusted author is exempt from external-contributor runtime proof; reported focused tests are supplemental validation. The diff does not materially change authority or stored-data contracts, so neither additional authority proof nor migration proof is required.
Evidence reviewed 8 items Pinned introduction: Reviewed the merge-base-to-head delta, preserving the distinction between introduced edits and base-branch drift. The supplied test merge is stale relative to the pinned base; no claim that merging removes current-main behavior was made.
Prior queue findings resolved by restoration: The current node-runtime-state module retains its private pruning helper and public read distinction and has no introduced delta. The historical Opengrep comments therefore do not establish an outstanding defect in this head.
Preserved authorization boundary: The complete cross-context policy still rejects unguarded actions before target selection. Artifact HTTP callers supply the same classifiers, prefixes, callbacks, and rate-limit attribution to the existing transfer owner, which retains current-authorization checks after file opening and during streaming. Approval binding comparisons retain their ordering and mismatch outcomes.
Findings None None.
Security None None.

How this fits together

Core runtime owners turn agent requests, configuration, and connected-device state into model calls, messages, plugin operations, and update steps. This refactor moves parameter and result construction directly into those owners.

flowchart TD
  A[Agent and operator requests] --> B[Runtime configuration]
  B --> C[Existing core owners]
  D[Connected devices and plugins] --> C
  C --> E[Authorization and lifecycle checks]
  E --> F[Model and transport operations]
  F --> G[Replies and operation results]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source -1001, Tests +16, Other -1. Total -986 across 63 files.

View PR surface stats
Area Files Added Removed Net
Source 56 1726 2727 -1001
Tests 6 44 28 +16
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 1 2 -1
Total 63 1771 2757 -986

Review metrics

None.

Technical review

Best possible solution:

Keep parameter construction with the existing runtime owners while preserving lazy loading, prompt bytes, wire contracts, authorization, and cleanup ordering.

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

Not applicable: this PR proposes behavior-preserving cleanup rather than a reported runtime defect; no tests or target code were executed during this read-only review.

Is this the best way to solve the issue?

Yes: directly using the existing owners removes redundant projections without creating competing policy or API surfaces.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

No label changes.

Label justifications:

  • P3: This is internal cleanup with no intended user-visible behavior change or established 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 verified trusted author is exempt from external-contributor runtime proof; reported focused tests are supplemental validation. The diff does not materially change authority or stored-data contracts, so neither additional authority proof nor migration proof is required.

Evidence

What I checked:

  • Pinned introduction: Reviewed the merge-base-to-head delta, preserving the distinction between introduced edits and base-branch drift. The supplied test merge is stale relative to the pinned base; no claim that merging removes current-main behavior was made. (edf83589ba4f)
  • Prior queue findings resolved by restoration: The current node-runtime-state module retains its private pruning helper and public read distinction and has no introduced delta. The historical Opengrep comments therefore do not establish an outstanding defect in this head. (src/gateway/node-runtime-state.ts:24, edf83589ba4f)
  • Preserved authorization boundary: The complete cross-context policy still rejects unguarded actions before target selection. Artifact HTTP callers supply the same classifiers, prefixes, callbacks, and rate-limit attribution to the existing transfer owner, which retains current-authorization checks after file opening and during streaming. Approval binding comparisons retain their ordering and mismatch outcomes. (src/gateway/worker-environments/artifact-transfer-http.ts:49, edf83589ba4f)
  • No introduced stored-data contract: Session event construction remains an outbound projection with the same lifecycle filtering, tombstones, and active-run fields. Transcript mirror idempotency keys and update receipt matching are equivalent to their removed helpers. No schema, migration, persisted-format, or default change supports the previous generic upgrade-proof blocker. (src/gateway/session-event-payload.ts:10, edf83589ba4f)
  • Retained wire coverage and completed cutover: NodeRegistry tests retain observable input-frame and cancellation-frame assertions, including pairing-generation invalidation. Searches found no remaining references to the deleted DTO builders or forwarding modules. Changed artifact tests call the same production HTTP owner directly. (src/gateway/node-registry.test.ts:994, edf83589ba4f)
  • Validation and trusted-author proof treatment: The captured PR body reports 299 focused tests and both import-cycle checks passing on the reviewed head; its earlier build pass predates the final correction, and final local lint was interrupted. These are reported validation results, not reviewer execution or live proof. The security guard verifies steipete's admin access, so the external-contributor proof gate does not apply. No material authority change introduces a separate authority-proof requirement. (edf83589ba4f)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • obviyus: 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-05T12:26:03.601Z sha c085dec :: blocked before merge. :: none
  • reviewed 2026-10-05T12:39:16.982Z sha c085dec :: blocked before merge. :: none

Restore the PR tooling closure and private node-queue pruning boundary. Inline eligible agent diagnostics, Talk projections, and ClawHub result adapters instead, retaining behavior and the batch reduction.
@steipete

steipete commented Oct 5, 2026

Copy link
Copy Markdown
Contributor Author

Admin-merge evidence for head edf83589ba4f1af0bcfde27088830b4bd70edeec (coordinator, main-red-but-unrelated rule).

Every failing job on this head was attributed individually. The only non-aggregate failure is check-test-types-core-5:

test/gateway-rpc-exporters.test.ts(110,9): error TS2322: Type 'GatewayMethodDescriptorInput[]' is not assignable to type 'GatewayMethodDescriptor[]'.

This is main-red and unrelated to this PR:

  • Line 110 was added on main by 3e7f2d8 (test(gateway): register descriptors in RPC exporter fixture), which assigns createGatewayMethodDescriptorsFromHandlers(...) (returns GatewayMethodDescriptorInput[], src/gateway/methods/registry.ts:115) to registry.gatewayMethodDescriptors (typed GatewayMethodDescriptor[], src/plugins/registry-types.ts:467). That mismatch exists on main without this PR.
  • This PR does not touch test/gateway-rpc-exporters.test.ts, src/gateway/methods/**, or src/plugins/registry-types.ts, and its diff contains no reference to createGatewayMethodDescriptorsFromHandlers or gatewayMethodDescriptors.
  • openclaw/ci-gate is the downstream aggregate.

A main fix for the fixture is in progress separately.

@steipete
steipete merged commit 60c24e3 into main Oct 5, 2026
156 of 160 checks passed
@steipete
steipete deleted the deslop/l386-forwarding-core-20261005 branch October 5, 2026 13:49
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 6, 2026
* refactor(core): deslop forwarding layers

Inline private forwarding functions and parameter/result adapters into existing runtime owners. Remove five internal forwarding modules while preserving public SDK, lazy loading, authority, cleanup, prompt text, and wire/config/state contracts.

* refactor(core): avoid shadowing captured tool input

* refactor(core): preserve protected forwarding boundaries

Restore the PR tooling closure and private node-queue pruning boundary. Inline eligible agent diagnostics, Talk projections, and ClawHub result adapters instead, retaining behavior and the batch reduction.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling 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. 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.

2 participants