Skip to content

refactor: deslop small cross-cutting cleanups - #166427

Merged
steipete merged 2 commits into
mainfrom
deslop/bundle1-small-lenses-20261006
Oct 7, 2026
Merged

steipete merged 2 commits into
mainfrom
deslop/bundle1-small-lenses-20261006

Conversation

@steipete

@steipete steipete commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Several small cross-cutting cleanups independently repeated schema types, SDK helpers, callback bodies, and values already held by their owning inputs.

User Impact

No intended user-visible behavior change. This bundle keeps the existing protocol, configuration, persistence, public SDK, cancellation, and delivery contracts. It has no visual changes.

Why This Change Was Made

Combines four reviewed cleanup lanes into one PR and one hosted CI head, in this order:

  • l422, deslop/l422-schema-mirrors-20261006 at 13f23a458f5a877e8feacea90b4fe18692ed1a7a: derive Gateway, plugin metadata, and Control UI types from existing schemas; move field comments to their owner without changing schemas.
  • l425, deslop/l425-derivable-infra-20261006 at c792d24fd189413a40def736d8fcbbb74d18040c (four commits): derive process and worker lifecycle facts, forward existing inputs, and remove unused values in outbound delivery, package updates, secrets, and skills.
  • l419, deslop/l419-gateway-async-20261006 at bcdcd44f9f64367ad291335cfd59f24f30c24d0c: simplify async forwarding and share identical pending-operation settlement callbacks.
  • l420, deslop/l420-sdkdupe-channels-20261006 at e3d9b28644aa18836d3fa2ce43bce520f378b03c: reuse existing public SDK parsing, normalization, sleep, and bounded-map helpers in bundled plugins.

Measured production reduction: 227 net lines removed (217 additions, 444 deletions across 56 production files), excluding tests, test support, fixtures, generated files, and declarations. The bundle has the requested campaign size exemption. Applied against c3c55eadb1c8dd201b4370e637f22ab8595a5230 without conflicts. Dropped the Buzz sleep-helper hunk: the bundled queue test failed while the same full file passed 19/19 on clean main. The test is unchanged. The Matrix assertion-safety baseline was regenerated with its sole now-unused entry removed (7201 to 7200 total).

Evidence

  • Frozen installation completed; both commits have verified signatures. Independent Codex review through P2 found no actionable findings.
  • All 62 selected core/Gateway/UI files executed: 1,474 tests passed and one Gateway cleanup wait failed locally. All 19 sibling worktree-spawn cases passed locally; the originally failing case passed on the same frozen head in isolated Linux (1 selected case, 19 filtered). No code or deadline was changed to obtain that result.
  • Channel proof: 105 passing tests on retained changes; WhatsApp's initial callback failure reproduced on both the bundle and clean main at c3c55eadb1c8dd201b4370e637f22ab8595a5230 (17 pass/1 fail each). Its FIFO hunk is retained. Feishu webhook E2E hit the unchanged import-hook deadline locally twice; clean main passed 20/20. The same frozen bundle then passed all 20 cases on isolated Linux without test or timeout changes. The initial local import timeouts remain recorded; no main-red or code-fix claim is made for them.
  • Exact full Knip production and full-tree export scans passed with zero findings; files/dependencies also passed. Final Madge: 0 cycles, matching clean main. Kysely generation, generator tests, guardrails, and deprecated-JSDoc checks passed. Final lint-suppression suite: 3/3 passed.
  • SDK API comparison (c3c55eadb1c8 → be0748b7c5db; later fixups only restore private Buzz polling and shrink the assertion baseline) completed: no added/removed entrypoints or exports; 150 reachable-declaration changes and three printed signature changes trace to the schema derivations. Exact-optional checks prove all four public aliases retain their old shapes and all nine optional fields reject explicit undefined. Inferred internal implementation declarations widen, while explicit public Gateway/WorkerProvider contracts preserve the aliases; no public widening was found.
  • Full node scripts/check-changed.mjs --base c3c55eadb1c8dd201b4370e637f22ab8595a5230 passed on head c4640e7ada84908f0b64c79f3afd4aa05ab0ce1c, tree 00788086872d90be6d5924b21558a53170ff51ca, in 1,055.92 seconds on isolated Linux/Node 24.19.0. This includes core/plugin/UI and selected test-graph types, file lint, all three bounded export scans, guards, and zero runtime cycles. Hosted CI run 37567186223 completed on this exact head with two failing test jobs (small-16 and small-22) and their downstream gates. Both jobs are inherited: unrelated hosted PR runs reproduce the same database-admission fixture failure and the exact chat-history replay assertion; the inspected causal paths are unchanged by this bundle. The four lifecycle failures share the reproduced fixture path, without a separate exact-title replay. The per-job evidence comment records the qualification and the inconclusive local baseline attempts. All ten concurrency-cancelled automation jobs have successful replacement runs; no source changed.

No cases, assertions, retries, skips, timeouts, or process boots were added. The changed writer-fence test only supplies its full typed fixture; its existing three cases and all assertions are retained.

Test cost: pnpm test src/infra/outbound/deliver-transcript.writer-fence.test.ts --maxWorkers=1 passed all three existing cases in 29.84s wall on isolated Linux with CI=true; no CI cases or per-test process boots were added.

Combine the l422 schema-mirror, l425 derivable-state, l419 async-callback, and l420 SDK-helper cleanups. Preserve runtime behavior and existing public contracts.
Drop the Buzz sleep-helper substitution after its queue test failed on the bundle and passed on clean main. Keep the test unchanged. Regenerate the exact shrink-only Matrix assertion baseline after removing the redundant cast.
@clawsweeper

clawsweeper Bot commented Oct 7, 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.

@openclaw-barnacle openclaw-barnacle Bot added channel: discord Channel integration: discord channel: matrix Channel integration: matrix channel: telegram Channel integration: telegram channel: voice-call Channel integration: voice-call channel: whatsapp-web Channel integration: whatsapp-web app: web-ui App: web-ui gateway Gateway runtime cli CLI command changes channel: feishu Channel integration: feishu channel: a2a size: L labels Oct 7, 2026
@steipete
steipete marked this pull request as ready for review October 7, 2026 03:31
@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 7, 2026
@clawsweeper

clawsweeper Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed October 7, 2026, 12:30 AM ET / 04:30 UTC (Revision 3).

ClawSweeper review

What this changes

The PR replaces repeated types, parsing helpers, callbacks, and redundant lifecycle values with existing schema and SDK owners across plugins, Gateway services, skills, and the Control UI.

Merge readiness

✅ Ready for maintainer review

Keep open: the cleanup remains useful and distinct from current main, and no actionable introduced defect was found. This maintainer-authored PR is outside automatic cleanup eligibility; failed CI remains subject to the normal landing workflow.

Priority: P3
Reviewed head: c4640e7ada84908f0b64c79f3afd4aa05ab0ce1c

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A useful, coherent cleanup with substantial reported validation and no actionable introduced finding.
Proof confidence 🌊 off-meta tidepool Not applicable: The contributor proof gate is exempt for this verified maintainer-authored cleanup. Supplied tests and compatibility checks are supplemental evidence; no material authority change or stored-format change requiring separate proof 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 contributor proof gate is exempt for this verified maintainer-authored cleanup. Supplied tests and compatibility checks are supplemental evidence; no material authority change or stored-format change requiring separate proof was identified.
Evidence reviewed 8 items Pinned introduction and merge ownership: Reviewed the merge-base-to-head introduced delta in bounded groups. Raw commit records confirm the original head parent and the test merge's ordered base/head parents; base-branch drift was not attributed to this PR.
Public schema aliases preserve inspected shapes: Worker picker metadata and link-reader descriptors derive from existing schemas through SchemaContract, which preserves exact optional-property contracts. The schemas retain the inspected fields; imports used for these aliases are type-only. The captured PR body additionally reports no added or removed SDK entrypoints or exports.
Secrets and authority boundaries: The secrets changes retain the same auth-store maps, provider scrub rules, projected validation, and write targets. Worker launch now reads the plan hash from the same claim previously passed separately. No material transfer or expansion of authority was identified.
Findings None None.
Security None None.

How this fits together

These shared contracts and lifecycle helpers connect channel messages, configuration, and UI requests to Gateway execution and delivery. The cleanup consolidates their implementation while preserving existing inputs and outputs.

flowchart LR
  A[Channel messages] --> C[Shared SDK helpers]
  B[Configuration and UI requests] --> D[Protocol schemas]
  C --> E[Gateway and lifecycle owners]
  D --> E
  E --> F[Process execution]
  E --> G[Message delivery and session updates]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source -227, Tests -1, Other -1. Total -229 across 59 files.

View PR surface stats
Area Files Added Removed Net
Source 56 217 444 -227
Tests 2 4 5 -1
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 0 1 -1
Total 59 221 450 -229

Review metrics

None.

Technical review

Best possible solution:

Consolidate the repeated implementation around existing schema, SDK, and lifecycle owners while retaining the established public and runtime contracts.

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

Not applicable: this PR proposes behavior-preserving cleanup, and source inspection found no concrete introduced failure to reproduce.

Is this the best way to solve the issue?

Yes: reusing existing schemas and SDK helpers removes competing implementations while preserving the inspected contracts.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

No label changes.

Label justifications:

  • P3: This is internal cleanup with no intended user-visible behavior change or identified 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 contributor proof gate is exempt for this verified maintainer-authored cleanup. Supplied tests and compatibility checks are supplemental evidence; no material authority change or stored-format change requiring separate proof was identified.

Evidence

What I checked:

  • Pinned introduction and merge ownership: Reviewed the merge-base-to-head introduced delta in bounded groups. Raw commit records confirm the original head parent and the test merge's ordered base/head parents; base-branch drift was not attributed to this PR. (c4640e7ada84)
  • Public schema aliases preserve inspected shapes: Worker picker metadata and link-reader descriptors derive from existing schemas through SchemaContract, which preserves exact optional-property contracts. The schemas retain the inspected fields; imports used for these aliases are type-only. The captured PR body additionally reports no added or removed SDK entrypoints or exports. (src/plugins/capability-provider.types.ts:57, c4640e7ada84)
  • Secrets and authority boundaries: The secrets changes retain the same auth-store maps, provider scrub rules, projected validation, and write targets. Worker launch now reads the plan hash from the same claim previously passed separately. No material transfer or expansion of authority was identified. (src/secrets/apply.ts:268, c4640e7ada84)
  • Existing SDK helper equivalence: Inspected the existing finite-number, string-filtering, lowercase normalization, JSON parsing, and insertion-order map-pruning owners. The substitutions preserve the relevant predicates and fallback behavior, including Telegram timestamp precedence and WhatsApp's bounded preparation map. (src/infra/map-size.ts:2, c4640e7ada84)
  • Still distinct from current main: The pinned fetched main still contains the handwritten link-reader types replaced by this branch. Local historical blob inspection encountered an HTTP 403 during lazy retrieval; an authenticated read-only GitHub contents request successfully supplied the exact main source. No merged fixing PR or release implementation was established. (src/shared/control-ui-link-reader.ts:2, a2330c046e56)
  • Validation and CI limitation: The captured body reports exact-head changed checks passing, selected core/channel tests, SDK compatibility checks, and unchanged test assertions. Live job metadata confirms two failed test jobs in https://github.com/openclaw/openclaw/actions/runs/37567186223; inspected annotations include database-execution admission failures. Their baseline attribution remains unproven in this review, and check status alone does not establish an introduced defect. No runtime tests were executed during this read-only review. (c4640e7ada84)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Vincent Koc: 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-07T03:31:15.121Z sha c4640e7 :: needs maintainer review before merge. :: none
  • reviewed 2026-10-07T03:36:56.634Z sha c4640e7 :: needs maintainer review before merge. :: none

@github-actions

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

These security sensitive changes were made:

  • src/secrets/apply.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.
  • src/secrets/resolve.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.
  • src/secrets/runtime-config-collectors-sandbox.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 commented Oct 7, 2026

Copy link
Copy Markdown
Contributor Author

Exact-head CI attribution for c4640e7ada84908f0b64c79f3afd4aa05ab0ce1c.

CI run 37567186223 tested merge 42e38ef85d49a416959fbe4766330842f8440bcf: main ac04ce8a219ccc922c52e371ae6e5a0332227e3b followed by this PR head. Checkout logs and Git parents agree. The actual test runtime was Node 24.19.0.

Failed check Observed failure Attribution and independent proof
checks-node-changed-compact-small-16, job 112617992000 19 chat fixture admission errors, four session-lifecycle fixture admission errors, and one chat-history replay assertion; 117 other tests passed in the affected leaf group. The 23 admission errors originate in the unchanged writeSessionStore fixture path and the config-retirement mechanism introduced on main by #165993. The watcher revokes synchronously and closes asynchronously; an immediate capture can still find the retired executor. The separate replay assertion predates this bundle: #166263 replaced oversized sibling groups with a placeholder, while this test still expects every first-page sequence to equal 2. Unrelated PR #166311 CI reproduces the admission family and the exact replay assertion. The four lifecycle cases fail before exercising lifecycle behavior through that same unchanged fixture chain (writeSessionStore → applySessionEntryLifecycleMutation → capture → borrow → assertCurrent); their exact test titles were not separately reproduced.
checks-node-changed-compact-small-22, job 112617992093 chat-send-global-identity.test.ts: config store changes after ACK throws Agent database execution admission is closed; 113 other tests passed in its primary group. The test changes session.store immediately before persistence, reaching the same main-owned retirement/capture race. Unrelated avatar-processing PR #166429 CI reproduces this exact case and error.
Actions openclaw/ci-gate, job 112620782333 Failed aggregate. Downstream of the two test jobs above; no additional failure.
Combined openclaw/ci-gate status Failed combined status. Publishes the same CI failure; no additional failing test or security gate.

The failing tests, fixture writer, config watcher, session projection mutation, user-turn recorder, and transcript persistence are unchanged by this PR. The affected history owners are unchanged too. The callback simplifications preserve their existing async/await scheduling, and the changed plugin imports introduce no database owner or configuration subscription. Main's later #166253 changes schema-preparation reuse without removing the retirement/capture mechanism.

All ten initially cancelled auto-response runs had zero steps and a recorded concurrency-supersession reason. Each was rerun serially and has a successful attempt 2. The cancellation reruns changed no source. All remaining failing checks identified by complete paginated enumeration are listed above; the automation triggered by the evidence update is also checked before merge.

Full changed checks, touched graph types, focused proof, the SDK API compatibility assessment, Knip, runtime/Madge cycles, and lint-suppression proof are recorded in the PR body. Independent exact-head review and the hosted review found no actionable defects. No tests, timeouts, retries, skips, suppressions, or baselines were weakened.

The broader local clean-main replay at e6fd21bc67ff64ad268ecad0420c52c4f84cb93d was inconclusive under heavy host contention and was stopped after 871.61 seconds with different request timeouts. AWS admission refused before creating a lease because the fleet was at capacity. A supplementary lifecycle-only replay was stopped after the source audit established the shared causal failure; neither local attempt is claimed as passing or as independent reproduction. The qualification above relies on the matching unrelated hosted runs plus the inspected, unchanged causal paths.

Every remaining failure is attributed above. Proceeding with the operator-authorized inherited-failure exception, pinned to this exact head. This is not a claim that hosted CI is green; the two main-owned failure families remain follow-ups for their owners.

@steipete
steipete merged commit 648c963 into main Oct 7, 2026
272 of 286 checks passed
@steipete
steipete deleted the deslop/bundle1-small-lenses-20261006 branch October 7, 2026 04:43
MarMarLabs added a commit to MarMarLabs/openclaw that referenced this pull request Oct 7, 2026
214 upstream commits. On the Feishu side, openclaw#166610 moves the streaming
preview queue into a new streaming-update.ts helper, openclaw#166427 replaces a
local JSON parse helper in dedupe-key.ts with the SDK's safeParseJson
and drops an unused import in monitor.transport.ts, and openclaw#166457 updates
fs-safe to 0.24.2 in extensions/feishu/package.json.

extensions/feishu/src/reply-dispatcher.ts conflicted only on the
imports: openclaw#166610 added queueFeishuStreamingUpdate next to this branch's
createFeishuTableRouting import. The merge keeps both. The rest of
openclaw#166610 merged on its own, and the streaming path still hands the table-
routed text to the new helper.

No upstream change touches a config schema, so the generated files were
regenerated from this merge and came out identical to the previous
branch head. build:docker ran in a separate detached checkout of this
commit. Counts are core 2494, channel 3876 and plugin 4524. The core and
plugin hashes match upstream/main. The generated metadata differs from
upstream/main only by the two Feishu markdown.tables entries. The three
generated-file checks pass there.

Feishu: 102 files and 1523 tests in the extension project, 17 files and
218 tests in the database-workers project, all passing. The forwarder
test and the routing guards pass, 503 tests. tsgo:core, tsgo:extensions,
tsgo:extensions:test, tsgo:test:root, the line-cap, max-lines,
assertion-safety, database-worker, test-timeout-race and test-mock-
exports ratchets against upstream/main, oxlint and oxfmt on the 43
changed code files all pass.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 8, 2026
* refactor: deslop small cross-cutting cleanups

Combine the l422 schema-mirror, l425 derivable-state, l419 async-callback, and l420 SDK-helper cleanups. Preserve runtime behavior and existing public contracts.

* refactor: retain Buzz polling and prune Matrix assertion ratchet

Drop the Buzz sleep-helper substitution after its queue test failed on the bundle and passed on clean main. Keep the test unchanged. Regenerate the exact shrink-only Matrix assertion baseline after removing the redundant cast.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui channel: a2a channel: discord Channel integration: discord channel: feishu Channel integration: feishu channel: matrix Channel integration: matrix channel: telegram Channel integration: telegram channel: voice-call Channel integration: voice-call channel: whatsapp-web Channel integration: whatsapp-web cli CLI command changes 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: L 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