Skip to content

refactor: consolidate cross-directory duplicate code - #161352

Merged
steipete merged 12 commits into
mainfrom
deslop/l182-cross-directory-clones
Sep 30, 2026
Merged

steipete merged 12 commits into
mainfrom
deslop/l182-cross-directory-clones

Conversation

@steipete

@steipete steipete commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Equivalent operations across core, packages, scripts, and plugins had separate implementations or forwarding functions with no policy of their own. This sweep consolidates those operations at their existing owners.

User Impact

The refactors preserve accepted values, error text, callback and evaluation order, chunking, persisted state, wire formats, and the public plugin SDK. No intended user-visible behavior change.

Simplifications

  • Reuse canonical map eviction, numeric/string normalization, record/JSON coercion, hashing, and first-wins deduplication; retain different malformed-input and fallback contracts.
  • Share literal-schema merging for MCP and provider tools, the parenthesis-aware breakpoint scanner, and the Responses web-search predicate; preserve consumer-specific policies.
  • Reuse the Gateway client's WebSocket transport and remove superseded per-consumer worker transforms.
  • Reuse installed dependency-name parsing and listener lifecycle helpers.
  • Remove the internal frontmatter-list, Anthropic cache-control, CLI drain, decoding, and normalization forwarders while migrating their callers.
  • Share approval span selection between Gateway and UI, preserving UI sparse-array materialization and identical rendering.
  • Consolidate media-provider lookup, failover-probe status mapping, TTS persona projection and reserved keys under their existing runtime owners.
  • Consolidate no-output service writers and equivalent Gateway/CLI response and help construction; preserve service admission and restart ordering.
  • Reuse documented SDK text-result construction across tools and channels, preserving compact JSON where required, details references, property order and error flags.
  • Consolidate Discord private media-operation forwarding, channel-entry checks and skipped-reply diagnostics; share Slack delivery-hook construction and equivalent MS Teams error responses.
  • Share release diagnostic sub-schemas, artifact-validation primitives, argument parsing and phase projection in existing script owners.

Production measurement: 927 net production lines removed.

Retained differences include promise-observer timing, mutable schema identity, bootstrap/deployment closures, and case-distinct channel-ID normalization. Plugins use existing documented SDK seams; no public SDK export is added. Protected audit, cron, PR-tooling and wrapper-closure paths are unchanged.

Scope reductions during validation

Overlapping build-fence, channel-status, Diffs-tool, and transport changes were dropped when rebasing onto newer main behavior. The new SQLite scope/cache helper extractions and optional Discord spelling fix were dropped under the maintainer's quick-validation limit. The earlier PR-caused declaration-fixture gap no longer applies because its new build-fence dependency was dropped too.

Evidence

The maintainer's final shipping policy uses hosted CI on the exact PR head as the test gate.

  • Candidate: e730db997a5c3e4d2425ea16f9ca261cd96afdb6.
  • Local Madge cycle check after the final rebase: 0 cycles. The prior inherited updater cycle was fixed on main by 2a0a65c4ae6 and that fix is included.
  • Local runtime cycle check after the final rebase: 0 runtime value cycles.
  • Focused MCP schema selection after the final rebase: 3 passed; 60 unrelated cases were excluded by the name filter. Vitest reported 1081.22 seconds, dominated by cold worker compilation and transformation.
  • Focused retained tests: 111 passed across five files (provider-tools, command-explainer formatting, tool results, agent display, and approval-card rendering).
  • Earlier broader local selections stalled in compiled-worker preparation. They produced no assertion failure. Unvalidated SQLite helper changes and the optional Discord diagnostic change were dropped; the retained passing suites are recorded above.
  • Hosted exact-head CI: run 36665590030 failed in main-owned preflight before the test/check lanes. Pinned squash auto-merge is enabled; the PR is ready and mergeable.
  • Restart outcome VM fixture: the focused wrapper passed all 19 unchanged native cases in 59.88 seconds locally.

Optional Blacksmith validation was stopped under the revised maintainer policy. Every confirmed owned lease is stopped, including tbx_01m3qq95eg6knq0mgzz3hx9d9g; no fresh remote pass is claimed for this head.

Independent Codex review covered the combined candidate at P2 severity. Two reported findings were rejected against complete source and the actual index: Discord event creation still falls through to the identical channelId reader, and both WebSocket consumers were already committed on the shared transport. No accepted actionable findings remained. Subsequent changes kept newer main behavior and removed clone groups rather than adding scope.

Detector discovery on the earlier 0f6e8d0 candidate measured 2,360 to 2,240 duplicated production lines (12-line/80-token scan). That is historical discovery evidence, not a final-head measurement after subsequent overlap removals.

The final diagnostic revert restores the main-branch log text and test file. It changes no runtime import edges and only removes a test import edge from the already-verified acyclic static graph. The five passing test files are unchanged by that revert.

First CI run and repair

Run 36657935561 tested head 457f5917173a4afe161105f96b5e4bf7fb91965c and reported:

Job Attribution and resolution
check-lint-core-1, check-prod-types, check-test-types PR-owned: unused isDeepStrictEqual and normalizeOptionalString imports; removed.
checks-fast-baseline-ratchets PR-owned: assertion counts shrank from 5→3, 6→4, and 2→0; tightened those three baseline entries, with no new exceptions.
checks-node-compact-small-20 PR-owned fixture gap: Unexpected dependency call: ../../shared/null-writer.js:createNullWriter; the VM linker now loads the real leaf. All 19 existing native cases pass.
checks-node-compact-small-12 Inherited deterministic fixture drift: unexpected src/gateway/server.mcp-session-owner.test.ts in the operator-authority owner plan. The exact failing base already contained that new consumer; main fixed the expected target in #161511, commit c79a1285bab5.
checks-node-changed-extensions-bundle-8 Unattributed teardown-only failure: run-attempt.reasoning-effort.test.ts retained worker ID 5 after its assertions passed. No independent witness was found, so this is not claimed inherited or fixed. The Codex environment-reader, session timestamp/reconciliation, and runtime-session-scope substitutions were withdrawn; the test and all assertions remain intact.
openclaw/ci-gate Aggregate failure from the above lanes.

The repair adds no runtime import edges: obsolete imports and the unproven helper edges are removed, and the VM fixture change is one entry in its existing real-module list. The zero-cycle proof remains valid for the reduced graphs.

The final rebase onto 87abb5e76f1 resolves an import/comment conflict while retaining main's newer schema logic. Main's sandbox string filtering is also retained, so the withdrawn Codex process group has no remaining diff.

Final-head CI classification

Run 36665590030 tested head e730db997a5c3e4d2425ea16f9ca261cd96afdb6 through merge e1e27676f02bc65e91f3cb9e36cc8b7e4ab4cdb7 with base 4c17f2570de8f62b64512de7606022ea100269a1.

  • Main-owned — preflight (job 109729455976): Error: Cannot find module '/home/runner/_work/openclaw/openclaw/.ci-harness/scripts/ci-build-manifest.mjs' (MODULE_NOT_FOUND). The trusted harness export pathspec omits the manifest entrypoint. This PR changes neither .github/actions/git-owner/owner.py, .github/workflows/ci.yml, nor scripts/ci-build-manifest.mjs.
  • Independent witness: unrelated run 36665780070, head 10b4f4b66adf8b8590da7bec97f5b4d3d7b3e4f2, failed in preflight job 109730025540 with the identical missing-module error. Existing repair #161569 exports the missing entrypoint from the canonical checkout owner.
  • Downstream — openclaw/ci-gate (job 109729847765): checks-node-core-test-nondist-shard finished with skipped (selected=missing) and corresponding missing-selection errors because preflight could not produce its manifest.
  • Coverage: 1 job passed, 2 failed, and 34 were skipped. Skipped product/test lanes are unrun, not passing evidence. No PR-owned failure was reported on this head because preflight stopped those lanes.

Per the coordinator's shipping order, this inherited CI failure is left to the coordinator for landing disposition. No workflow rerun or new remote proof was started.

@clawsweeper

clawsweeper Bot commented Sep 29, 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: slack Channel integration: slack gateway Gateway runtime scripts Repository scripts commands Command implementations agents Agent runtime and tooling extensions: codex extensions: onepassword 1Password plugin plugin: imap size: L labels Sep 29, 2026
@steipete
steipete marked this pull request as ready for review September 29, 2026 19:27
@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 Sep 29, 2026
@clawsweeper

clawsweeper Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 30, 2026, 12:19 AM ET / 04:19 UTC (Revision 9).

ClawSweeper review

What this changes

The branch consolidates repeated parsing, tool-result, approval-display, service, channel, provider, and release-verification helpers across OpenClaw core, plugins, packages, scripts, and the Control UI.

Merge readiness

⛔ Blocked before merge - 7 items remain

This is still a useful, unique cleanup that current main does not contain. I found no confirmed line-level defect, but the upgrade proof and resolved-head release-verifier evidence requested in the previous review remain unresolved.

Priority: P3
Reviewed head: db33af7e2d375a0a3c5c0493ac6df998043d200c
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The refactor has useful source and focused-test evidence, but its broad upgrade and publication boundaries remain insufficiently demonstrated.
Proof confidence 🦐 gold shrimp (3/6) Not applicable: The maintainer-authored PR is exempt from the ordinary external-contributor proof gate; its focused tests and restart fixture do not establish the separate published-driver upgrade outcome required by repository guidance. Inspection found no changed stored-data format or schema.
Patch quality 🦐 gold shrimp (3/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The maintainer-authored PR is exempt from the ordinary external-contributor proof gate; its focused tests and restart fixture do not establish the separate published-driver upgrade outcome required by repository guidance. Inspection found no changed stored-data format or schema.
Evidence reviewed 8 items Pinned introduced change: The merge-base-to-head diff retains substantial changes across runtime, plugin, UI, update, and release-tooling owners; the branch has not been replaced by current main.
Update and Doctor boundary: Doctor primes the service-maintenance module before package replacement; the PR replaces its output sink with the shared writer. The root AGENTS.md requires a published-driver × candidate cell for changes touching update, Doctor, service lifecycle, or state migration.
Persisted-state reader: The legacy archive collision path now calls the existing path-based SHA-256 helper; inspection found no new serialized format or schema, but this remains part of upgrade behavior.
Findings None None.
Security None None.

How this fits together

Channel events, CLI requests, and UI actions enter the Gateway and agent runtime, which use shared helpers before invoking plugins, providers, and session or reply owners. Separate release scripts inspect publication artifacts before a release is accepted.

flowchart LR
  A[Channel, CLI, and UI inputs] --> B[Gateway and agent runtime]
  B --> C[Shared parsing and policy]
  C --> D[Plugins and providers]
  D --> E[Replies and session state]
  F[Release artifacts] --> G[Publication checks]
Loading

Decision needed

Question Recommendation
Does the stated hosted-CI shipping direction explicitly waive the published-driver upgrade cell for this PR's Update, Doctor, service, and migration changes? Require upgrade evidence: Capture a v2026.9.6-to-candidate run using existing operator state before accepting the touched recovery paths.

Why: The PR body describes a CI-only direction, while the applicable repository guidance and previous review require upgrade proof; the available discussion does not explicitly accept this specific tradeoff.

Before merge

  • Resolve merge risk (P1) - No published v2026.9.6 updater × candidate run with existing operator state shows that the touched Doctor, service-recovery, and migration paths preserve Gateway availability and state through upgrade.
  • Resolve merge risk (P1) - The shared release diagnostic schema changes two publication readers, but no resolved-head verifier output demonstrates that release artifacts retain their previous classification.
  • Complete next step (P2) - Confirm the upgrade-proof requirement or its explicit waiver, then provide the chosen upgrade evidence and resolved-head release-verifier output before merge.
  • Resolve review confidence - ClawSweeper must reach high confidence before merge readiness is known.
  • Resolve maintainer decision - Resolve the maintainer decision shown above 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: serialized state: extensions/onepassword/src/tool.ts, unknown-truncated-pull-files. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Prove an installed upgrade (recommended)
    Record the published-updater-to-candidate outcome for Doctor, service restart, and retained operator state.
  2. Accept the upgrade gap
    A responsible maintainer may explicitly accept CI-only coverage for this specific upgrade surface.
  3. Narrow the sweep
    If upgrade proof is disproportionate, defer the update and recovery edits to a separately proven change.

Technical review

Best possible solution:

Keep the consolidation if an existing-state upgrade trace and resolved-head release diagnostic establish the preserved contracts, while retaining the present approval and Plugin SDK boundaries.

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

Not applicable: this PR claims behavior-preserving cleanup rather than a current-main product defect.

Is this the best way to solve the issue?

Unclear: consolidating these operations under existing owners fits the stated goal, but the upgrade and release-verifier boundaries need the evidence identified above.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 3ba18eca2c85.

Labels

Label changes:

No label changes.

Label justifications:

  • P3: This is an internal cleanup with no intended user-facing behavior change.
  • merge-risk: 🚨 compatibility: The diff touches installed update, Doctor, service recovery, and persisted-state reading without the repository's published-upgrade proof.
  • merge-risk: 🚨 automation: The diff changes release publication diagnostics whose resolved-head output has not been supplied.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🦐 gold shrimp.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The maintainer-authored PR is exempt from the ordinary external-contributor proof gate; its focused tests and restart fixture do not establish the separate published-driver upgrade outcome required by repository guidance. Inspection found no changed stored-data format or schema.

Evidence

What I checked:

  • Pinned introduced change: The merge-base-to-head diff retains substantial changes across runtime, plugin, UI, update, and release-tooling owners; the branch has not been replaced by current main. (db33af7e2d37)
  • Update and Doctor boundary: Doctor primes the service-maintenance module before package replacement; the PR replaces its output sink with the shared writer. The root AGENTS.md requires a published-driver × candidate cell for changes touching update, Doctor, service lifecycle, or state migration. (src/cli/update-cli/update-command-service-maintenance.ts:59, db33af7e2d37)
  • Persisted-state reader: The legacy archive collision path now calls the existing path-based SHA-256 helper; inspection found no new serialized format or schema, but this remains part of upgrade behavior. (src/infra/state-migrations.storage.ts:76, db33af7e2d37)
  • Release diagnostic owner: The new shared schema supplies the publication-status script and beta verifier. The PR body reports focused tests but no resolved-head output from this verifier. (scripts/lib/release-postpublish-diagnostic-schema.mts:33, db33af7e2d37)
  • Approval security review: The inspected approval-binding refactor retains rejection for absent or mismatched environment bindings and for mismatched command, working directory, agent, and session. (src/infra/system-run-approval-binding.ts:130, db33af7e2d37)
  • Current-main comparison: The fetched main commit differs from the pinned PR base only in Telegram E2E skill files, not in the central consolidation paths. (3ba18eca2c85)

Likely related people:

  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Dallin Romney: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Alix-007: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Capture a published v2026.9.6 upgrade trace using existing operator state, including Doctor and service recovery.
  • Record resolved-head output from the release diagnostic verifier.

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 (8 earlier review cycles)
  • reviewed 2026-09-29T19:34:52.047Z sha 0f6e8d0 :: blocked before merge. :: none
  • reviewed 2026-09-29T20:08:46.408Z sha 0f6e8d0 :: blocked before merge. :: [P2] Include the new fence dependency in the declaration fixture
  • reviewed 2026-09-30T00:02:04.929Z sha 27597aa :: blocked before merge. :: none
  • reviewed 2026-09-30T02:10:39.725Z sha 457f5917173a4afe161105f96b5e4bf7fb91965c :: blocked before merge. :: none
  • reviewed 2026-09-30T03:14:24.447Z sha 43859364d5e5eccc20cf57a28791a5e4211184c1 :: blocked before merge. :: none
  • reviewed 2026-09-30T03:25:05.594Z sha 43859364d5e5eccc20cf57a28791a5e4211184c1 :: blocked before merge. :: none
  • reviewed 2026-09-30T03:50:24.372Z sha e730db9 :: blocked before merge. :: none
  • reviewed 2026-09-30T04:00:40.511Z sha e730db9 :: blocked before merge. :: none

@clawsweeper clawsweeper Bot added merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed 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 Sep 29, 2026
@steipete
steipete marked this pull request as draft September 29, 2026 23:53
@steipete
steipete force-pushed the deslop/l182-cross-directory-clones branch from 0f6e8d0 to 27597aa Compare September 29, 2026 23:54
@openclaw-barnacle openclaw-barnacle Bot added channel: mattermost Channel integration: mattermost channel: msteams Channel integration: msteams channel: whatsapp-web Channel integration: whatsapp-web channel: zalouser Channel integration: zalouser app: web-ui App: web-ui labels Sep 29, 2026
Reuse canonical parsing, bounded-map, session-scope and service-binding owners. Share Markdown breakpoint scanning and Responses web-search detection; route lazy WebSocket consumers through the existing portable transport and remove their obsolete build rewrites. Preserve SDK, wire and persisted-state contracts.
Keep schema guards and provider-specific flattening intact. Isolate the shared web-search predicate from exported projection types so its private declaration does not enter SDK type closures.
Reuse existing listener, normalization, setup-visibility and cache-control owners. Preserve callback ordering, error propagation, string filtering and public SDK exports. Remove obsolete internal aliases and their stale test mocks.
Drop the setup-visibility cleanup group after the strict SDK comparison identified its namespace declaration in 123 reachable export closures. Preserve the existing API without acknowledgement or baseline changes.
Reuse result, numeric, string, filesystem, blocked-key, and map-eviction owners while preserving caller policy and output. Remove redundant private branches and repeated comments. Doctor inputs, transformations, warnings, and persisted state remain unchanged.
Preserve per-caller validation, ordering, diagnostics and public SDK contracts while reusing canonical owners. Correct the Discord plural reply-count diagnostic with an existing handler regression.
Drop the new SQLite scope and cache invalidation extractions after their local fixture preparation exceeded the maintainer quick-validation budget.
Drop the optional diagnostic spelling change and its unvalidated new test under the maintainer quick-validation limit. Runtime import edges are unchanged; the reverted test only removes an import edge from the verified acyclic graph.
Remove two obsolete imports, tighten assertion counts after cast removal, and load the real null-writer in the restart outcome VM fixture. The focused restart fixture passes all 19 existing native cases.
Keep the original Codex environment reader and session-runtime helpers after an unattributed worker teardown failure. Preserve the test assertions and leave worker lifecycle repairs to their owner.
@steipete
steipete force-pushed the deslop/l182-cross-directory-clones branch from db33af7 to d56eaa6 Compare September 30, 2026 06:05
@steipete

Copy link
Copy Markdown
Contributor Author

Conflict-only rebase of approved head db33af7e2d375a0a3c5c0493ac6df998043d200c onto 93776fdc8b9, producing d56eaa67c077e96c0f76ec0b405e653d5e837572.

Resolved files, preserving newer main behavior:

  • packages/ai/src/transports/openai-responses-replay-messages-internal.ts: retained main's ID normalization in the conflicting hunk.
  • extensions/discord/src/monitor/message-handler.process.ts: retained main's complete file, including its removed abort branch.
  • src/gateway/server-methods/doctor.ts: retained main's complete file and dreaming-entry selection implementation.

Requested gates ran sequentially at nice -n 15:

  • node --import ./scripts/tsx.mjs scripts/check-madge-import-cycles.ts: PASS, 0 cycles (local).
  • node --import ./scripts/tsx.mjs scripts/check-import-cycles.ts: PASS, 0 runtime value cycles.
  • Core tsgo lane (tsconfig.core.json): PASS.
  • Extensions tsgo lane (tsconfig.extensions.json): PASS.
  • git diff --check: PASS. No UI conflicts; UI typecheck and check-changed were not run, as requested.

Host contention delayed the local scan. The unfinished second scan was stopped; that gate and the two typechecks completed on Blacksmith Testbox tbx_01m3re4nj7ar09cyp54tcm3hj8 after installing frozen-lockfile dependencies in its task-owned checkout. The remote Git tree was verified as 849e7b95aad78cc0cec733cab60a0e138e6c5ae5, identical to the candidate. Testbox run: https://github.com/openclaw/openclaw/actions/runs/36675707742. The validation command exited 0; a runner-portal reporting timeout did not affect the checks.

The coordinator-approved prior-head CI evidence and independently attributed Codex settlement timeout remain documented above; this comment does not claim new-head hosted CI. No Codex files were changed. Proceeding with the explicitly authorized pinned squash merge.

@steipete
steipete merged commit 4b9e0b3 into main Sep 30, 2026
7 checks passed
@steipete
steipete deleted the deslop/l182-cross-directory-clones branch September 30, 2026 06:05
MarMarLabs added a commit to MarMarLabs/openclaw that referenced this pull request Sep 30, 2026
49 upstream commits, including a Slack fallback progress card change
(openclaw#161472) that regenerated the channel config baseline, and a
consolidation of duplicate code (openclaw#161352) that touched
extensions/feishu/src/channel.ts.

Two conflicts, both in generated files:
docs/.generated/config-baseline.sha256 and
src/config/bundled-channel-config-metadata.generated.ts. openclaw#161472 changed
Slack's entries in the channel config metadata, and this branch changes
the Feishu entries, so both sides moved the same hashes and the same
wrapped lines of the generated metadata. Both files were
regenerated from this merge rather than hand-merged. build:docker ran in
a separate detached checkout of this commit outside the nested
node_modules install. The counts stay at core 2475, channel 3788, plugin
4444, as predicted, and the three generated-file checks pass there.

extensions/feishu/src/channel.ts merged cleanly. openclaw#161352 replaced the
local JSON action result builder with the shared textResult helper, away
from the lines this branch changes.

Feishu: 102 files and 1521 tests in the extension project, 17 files and
247 tests in the database-workers project. The forwarder test and the
routing guards pass, 437 tests. tsgo:core, tsgo:extensions,
tsgo:extensions:test, tsgo:test:root, the line-cap, max-lines and
assertion-safety 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 1, 2026
* refactor: consolidate cross-directory duplicate code

Reuse canonical parsing, bounded-map, session-scope and service-binding owners. Share Markdown breakpoint scanning and Responses web-search detection; route lazy WebSocket consumers through the existing portable transport and remove their obsolete build rewrites. Preserve SDK, wire and persisted-state contracts.

* refactor: reuse allow-from projections in channel setup

* refactor: share literal schema merging through an internal owner

Keep schema guards and provider-specific flattening intact. Isolate the shared web-search predicate from exported projection types so its private declaration does not enter SDK type closures.

* refactor: reuse shared listeners and remove forwarding helpers

Reuse existing listener, normalization, setup-visibility and cache-control owners. Preserve callback ordering, error propagation, string filtering and public SDK exports. Remove obsolete internal aliases and their stale test mocks.

* refactor: retain SDK-reachable setup visibility wrapper

Drop the setup-visibility cleanup group after the strict SDK comparison identified its namespace declaration in 123 reachable export closures. Preserve the existing API without acknowledgement or baseline changes.

* refactor: reuse canonical helpers across runtime consumers

Reuse result, numeric, string, filesystem, blocked-key, and map-eviction owners while preserving caller policy and output. Remove redundant private branches and repeated comments. Doctor inputs, transformations, warnings, and persisted state remain unchanged.

* refactor: consolidate shared runtime and tooling operations

Preserve per-caller validation, ordering, diagnostics and public SDK contracts while reusing canonical owners. Correct the Discord plural reply-count diagnostic with an existing handler regression.

* refactor: narrow consolidation to retained runtime owners

Drop the new SQLite scope and cache invalidation extractions after their local fixture preparation exceeded the maintainer quick-validation budget.

* refactor: keep Discord cleanup behavior neutral

Drop the optional diagnostic spelling change and its unvalidated new test under the maintainer quick-validation limit. Runtime import edges are unchanged; the reverted test only removes an import edge from the verified acyclic graph.

* fix: repair consolidation checks and restart fixture

Remove two obsolete imports, tighten assertion counts after cast removal, and load the real null-writer in the restart outcome VM fixture. The focused restart fixture passes all 19 existing native cases.

* refactor: drop unproven session-runtime clone groups

Keep the original Codex environment reader and session-runtime helpers after an unattributed worker teardown failure. Preserve the test assertions and leave worker lifecycle repairs to their owner.

* refactor: preserve main sandbox string filtering
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 channel: feishu Channel integration: feishu channel: matrix Channel integration: matrix channel: mattermost Channel integration: mattermost channel: msteams Channel integration: msteams channel: slack Channel integration: slack channel: whatsapp-web Channel integration: whatsapp-web channel: zalouser Channel integration: zalouser cli CLI command changes commands Command implementations extensions: agentsapi extensions: browser extensions: copilot extensions: google extensions: onepassword 1Password plugin gateway Gateway runtime merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. plugin: file-transfer plugin: imap plugin: visitor-access rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. scripts Repository scripts 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