Skip to content

perf(doctor): slim remaining heavy doctor contract closures - #120811

Merged
steipete merged 5 commits into
mainfrom
claude/doctor-closure-slimming
Aug 9, 2026
Merged

steipete merged 5 commits into
mainfrom
claude/doctor-closure-slimming

Conversation

@steipete

@steipete steipete commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

Follow-up to #120698. Doctor contract enumeration (src/plugins/doctor-contract-registry.ts) cold-loads each plugin's doctor closure via jiti, and after the runtime-doctor migration several closures still pulled multi-second module graphs — most reaching kysely — through other broad barrels. Measured per-plugin fresh-process enumeration (listPluginDoctorLegacyConfigRules + listPluginDoctorStateMigrationEntries, jiti loader, source checkout): discord ~52.6s, msteams ~30.9s, codex ~29.6s, zalouser ~28.8s, matrix ~27.2s, slack ~17.5s, reef ~9.9s, memory-core ~6.4s, memory-wiki ~5.5s, workboard ~3.4s.

Why This Change Was Made

Each closure was fixed at its owning boundary:

  • Lazy imports inside async migration bodies (voice-call pattern from perf(doctor): keep bundled doctor contract closures dependency-light #120698): codex session-binding-sidecars (session-store-runtime), msteams (session-store-runtime), zalouser (session-store-runtime), workboard (own sqlite-store), matrix inbound-dedupe-migration (persistent-dedupe, sqlite-runtime, local inbound-dedupe.js), memory-core doctor-host-events/doctor-host-event-sources (memory-host-events), doctor-memory-sidecar (memory-core-host-engine-schema, sqlite-runtime), doctor-vector-index-provider (sqlite-runtime).
  • Barrel-bypass to defining modules: reef doctor-durable-state/state/audit-state now import protocol/audit|encoding|canonical|envelope|identity|pipeline|receipts directly instead of protocol/index.js (whose guard-adapters re-export pulls provider-http → plugin metadata → kysely); memory-core dreaming migrations import short-term-promotion-{store,types,utils} instead of the short-term-promotion barrel.
  • Lighter existing subpaths: slack streaming-compat → channel-streaming (instead of channel-outbound's reply-pipeline graph); matrix sdk/logger → security-runtime for redactSensitiveText (instead of logging-core → diagnostic → config graph); memory-wiki config → agent-scope-runtime (which now also exports resolveSessionAgentId, previously only on memory-host-core).
  • One new narrow SDK subpath: openclaw/plugin-sdk/realtime-voice-activation re-exports the pure activation-name helpers from src/talk/activation-name.ts for discord's sync doctor rules; the broad realtime-voice barrel keeps composing from the same defining module.
  • Two core ownership splits: src/infra/kysely-sync-cache-state.ts holds the per-database Kysely cache state so sqlite-transaction can clear caches without value-loading kysely (this removed kysely from every sqlite-transaction/sqlite-strict consumer, including plugin-state-runtime); packages/memory-host-sdk/src/host/openclaw-runtime-kysely.ts splits the Kysely re-exports off the schema/transaction bridge.
  • Guard: doctor-contract-closure-guard.test.ts now forbids static value imports of session-store-runtime, logging-core, realtime-voice, channel-outbound, and memory-host-core in closures, with per-kind scoping (session-store-runtime/channel-outbound apply to doctor-contract closures only — telegram sent-message-cache/state-migrations and discord thread-bindings.state legacy-setup closures share sync runtime modules with those barrels and are a named follow-up).

Known remaining follow-ups (named, out of scope): llm-task (~11.5s) — parseModelRef → model-ref-shared statically requires manifest-model-id-normalization → plugin metadata snapshot → kysely; fixing that is core model-ref policy surgery. The legacy-setup closure slimming above. Residual 2–3.5s cold enumerations (matrix, memory-wiki, codex, zalouser) are now plain plugin-module jiti compile cost with no kysely.

User Impact

openclaw doctor and anything enumerating plugin doctor contracts no longer cold-loads the kysely/state-db/session/reply-pipeline graphs per plugin. After: discord 0.3s, msteams 0.5s, workboard 0.25s, reef 0.7s, slack 1.5s, zalouser 2.3s, codex 2.6s, matrix 3.2s, memory-core 3.6s (kysely-free), memory-wiki 3.6s. No behavior change to migrations; heavy helpers load exactly when a migration executes.

Evidence

  • Guard: node scripts/run-vitest.mjs src/plugins/doctor-contract-closure-guard.test.ts green with the six-barrel rule map; it caught reef/memory-core/matrix second-hop edges during development.
  • Focused tests green across all touched plugins: codex/msteams/zalouser/workboard/matrix (+capacity)/memory-core (vector-index, sidecar-fts)/memory-lancedb/reef (doctor + state + trust-store)/discord doctor/slack doctor(+contract)/memory-wiki/telegram state-migrations, plus src/infra kysely-sync and sqlite-transaction suites.
  • pnpm tsgo:core, pnpm tsgo:extensions, pnpm check:test-types, pnpm check:import-cycles (0 cycles), pnpm plugin-sdk:surface:check (budgets 151/4852/2924 with comments), API baseline regenerated, oxfmt/oxlint clean, full pnpm build exit 0 with no [INEFFECTIVE_DYNAMIC_IMPORT].
  • Timing proof: per-plugin fresh-process script calling both enumeration entry points with pluginIds: [id] and checking require.cache for node_modules/kysely through the jiti loader path (tsx/ESM imports don't land in require.cache; the check matches the module path, not filenames).

Follow-up to #120698: several doctor closures still cold-loaded multi-second
kysely-bearing graphs through other broad barrels (session-store-runtime,
realtime-voice, channel-outbound, logging-core, memory-host-core/-events,
sqlite-runtime, persistent-dedupe, and plugin-local barrels).

- lazy-import heavy helpers inside async migration bodies (codex, msteams,
  zalouser, workboard, matrix inbound-dedupe, memory-core migrations)
- bypass plugin-local barrels to defining modules (reef protocol,
  memory-core short-term-promotion)
- move to lighter existing subpaths (slack -> channel-streaming, matrix
  logger -> security-runtime, memory-wiki -> agent-scope-runtime, which now
  also exports resolveSessionAgentId)
- add narrow openclaw/plugin-sdk/realtime-voice-activation for discord's
  sync wake-name doctor rules
- split src/infra/kysely-sync-cache-state.ts so sqlite-transaction clears
  Kysely caches without value-loading kysely; split the memory-host-sdk
  kysely bridge off the schema/transaction bridge
- guard: forbid the heavy barrels in doctor closures with per-kind scoping

Cold enumeration per plugin: discord 52.6s->0.3s, msteams 30.9s->0.5s,
codex 29.6s->2.6s, zalouser 28.8s->2.3s, matrix 27.2s->3.2s,
slack 17.5s->1.5s, reef 9.9s->0.7s, memory-core 6.4s->3.6s,
workboard 3.4s->0.25s; all kysely-free except llm-task (named follow-up).
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation channel: discord Channel integration: discord channel: matrix Channel integration: matrix channel: msteams Channel integration: msteams channel: slack Channel integration: slack channel: zalouser Channel integration: zalouser extensions: memory-core Extension: memory-core scripts Repository scripts extensions: memory-wiki extensions: codex plugin: workboard channel: reef Channel integration: reef labels Aug 9, 2026
@steipete
steipete marked this pull request as ready for review August 9, 2026 01:45
@openclaw-barnacle openclaw-barnacle Bot added size: M maintainer Maintainer-authored PR labels Aug 9, 2026
@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. labels Aug 9, 2026
@clawsweeper

clawsweeper Bot commented Aug 9, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 8, 2026, 10:39 PM ET / August 9, 2026, 02:39 UTC.

ClawSweeper review

What this changes

The PR makes Doctor enumerate plugin migration contracts without cold-loading heavy database, session, reply-pipeline, and runtime dependency graphs.

Merge readiness

⚠️ Ready for maintainer review - 4 items remain

No concrete correctness regression remains after the two prior findings were addressed, but this maintainer-owned PR needs a deliberate decision on its new public Plugin SDK entrypoint and a reviewer with the required sibling Codex source available before a full merge verdict.

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

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The patch is coherent and resolves the prior review findings, with a remaining maintainer contract decision and unavailable Codex-source inspection.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-owned internal loading optimization is exempt from the external-contributor real-behavior-proof gate; the PR body reports focused timing and test evidence.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-owned internal loading optimization is exempt from the external-contributor real-behavior-proof gate; the PR body reports focused timing and test evidence.
Evidence reviewed 6 items Doctor loading boundary: The registry loads manifest-declared contract artifacts through a cached Jiti loader; the PR’s deferred imports occur inside asynchronous migration work rather than contract enumeration.
Prior review follow-up resolved: The new Memory Host SDK Kysely bridge is explicitly recorded in the strict core-bridge allow-list.
SDK classification follow-up resolved: The activation-name SDK path is exported JS-only and its declaration is excluded, matching its private-local classification rather than creating a public typed contract.
Findings None None.
Security None None.

How this fits together

Doctor reads lightweight plugin contract modules to discover legacy configuration and state migrations before executing any repair. Those migration entries later load their heavier helpers only when detection or repair actually needs them.

flowchart LR
  A[Plugin manifests] --> B[Doctor contract registry]
  B --> C[Light contract closures]
  C --> D[Migration detection]
  D --> E[Lazy runtime helpers]
  E --> F[Doctor repair results]
Loading

Decision needed

Question Recommendation
Should plugin-sdk/channel-streaming-config be accepted as a supported public Plugin SDK contract, or should it remain private-local to bundled Doctor closures? Accept the public streaming-config seam: Keep the documented typed subpath because its two generic config readers avoid forcing plugins through the heavier outbound runtime.

Why: A public SDK export becomes a compatibility commitment for external plugins; source inspection shows it is narrow and generic, but repository policy reserves that contract direction for maintainer-visible judgment.

Before merge

  • Resolve merge risk (P1) - plugin-sdk/channel-streaming-config is a new public, typed Plugin SDK contract; external plugins could depend on it after release, so its public status needs an explicit maintainer decision.
  • Resolve merge risk (P1) - The required direct Codex-source inspection is unavailable in this review environment, leaving the Codex migration’s external contract unverified despite sound OpenClaw-side lazy-import ordering.
  • Complete next step (P2) - A maintainer must settle the public Plugin SDK contract and complete the repository-required Codex dependency inspection; no mechanical repair is identified.
Agent review details

Security

None.

PR surface

Source +83, Tests +64, Docs +2, Config +11, Generated +1, Other +7. Total +168 across 39 files.

View PR surface stats
Area Files Added Removed Net
Source 30 189 106 +83
Tests 2 75 11 +64
Docs 1 2 0 +2
Config 2 11 0 +11
Generated 1 2 1 +1
Other 3 10 3 +7
Total 39 289 121 +168

Review metrics

Metric Value Why it matters
Plugin SDK surface 1 public typed subpath added; 1 private-local JS-only subpath added The public entrypoint creates an external compatibility commitment, while the private-local entrypoint avoids one.

Stored data model

Persistent data-model change detected: migration/backfill/repair: extensions/zalouser/doctor-contract-api.ts, migration/backfill/repair: src/plugins/doctor-contract-closure-guard.test.ts, persistent cache schema: src/infra/kysely-sync.ts, persistent cache schema: src/infra/sqlite-transaction.ts, serialized state: extensions/codex/src/migration/session-binding-sidecars.ts, unknown-data-model-change: extensions/matrix/src/matrix/monitor/inbound-dedupe-migration.ts, and 6 more. Confirm migration or upgrade compatibility proof before merge.

Root-cause cluster

Relationship: canonical
Canonical: #120811
Summary: This PR is the remaining-closure follow-up to the already merged Doctor contract loading optimization.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge-risk options

Maintainer options:

  1. Confirm the public SDK contract (recommended)
    Merge after a maintainer explicitly accepts channel-streaming-config as a supported external plugin API and the Codex-source gate is completed.
  2. Limit the seam to bundled plugins
    Reclassify the streaming-config entrypoint as private-local if external compatibility is not intended.

Technical review

Best possible solution:

Keep the dependency-light migration boundary, retain the narrow public streaming-config seam only if maintainers intend to support it for external plugins, and complete the Codex-source contract check before merge.

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

Not applicable: this PR optimizes contract-module loading; source inspection confirms the lazy imports sit behind asynchronous detection and migration paths.

Is this the best way to solve the issue?

Unclear: the lazy-import and direct-module approach fits the Doctor control-plane boundary, but maintainers must choose whether the new public SDK seam is the intended long-term contract.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-owned internal loading optimization is exempt from the external-contributor real-behavior-proof gate; the PR body reports focused timing and test evidence.
  • remove rating: 🧂 unranked krab: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P3: This is a Doctor control-plane performance optimization rather than a user-facing outage or regression.
  • merge-risk: 🚨 compatibility: The new public plugin-sdk/channel-streaming-config export can become a supported dependency for existing and future external plugins.
  • 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: This maintainer-owned internal loading optimization is exempt from the external-contributor real-behavior-proof gate; the PR body reports focused timing and test evidence.

Evidence

What I checked:

Likely related people:

  • steipete: Authored the current five-commit optimization series and the preceding merged Doctor contract closure work. (role: recent area contributor; confidence: high; commits: b392f868946b, 8cb53c7b5572; files: src/plugins/doctor-contract-closure-guard.test.ts, src/infra/kysely-sync-cache-state.ts, src/plugin-sdk/realtime-voice-activation.ts)
  • hixvac: Recent history connects this contributor to the Kysely cache lifecycle area split by the PR. (role: adjacent SQLite lifecycle contributor; confidence: medium; commits: 6b324386; files: src/infra/kysely-sync.ts, src/infra/sqlite-transaction.ts)

Rank-up moves

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

  • Confirm whether the new public streaming-config subpath is a supported external Plugin SDK commitment.
  • Complete the required direct ../codex source inspection in an environment where that checkout is available.

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 (1 earlier review cycle)
  • reviewed 2026-08-09T01:51:52.520Z sha b392f86 :: found issues before merge. :: [P1] Declare the Memory Host SDK core bridge | [P2] Classify the activation SDK subpath before exporting it

…g-config subpath

The channel-streaming compat barrel is deprecated for extension production
code (deprecated-api-usage guard + SDK package contract). Add the narrow
non-deprecated openclaw/plugin-sdk/channel-streaming-config subpath for the
pure streaming config readers, and drop the now consumer-less
short-term-promotion barrel re-exports knip flagged.
ClawSweeper P2: the subpath exports only a default target, which is the
private-local shape; register it in plugin-sdk-private-local-only-subpaths,
the package-boundary d.ts alias maps, and correct the public surface budgets
(realtime-voice-activation no longer counts as public).
… published package

Private-local subpaths ship without d.ts; register the files negation the
release pack-path check requires.
@clawsweeper clawsweeper Bot added 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. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Aug 9, 2026
@steipete

steipete commented Aug 9, 2026

Copy link
Copy Markdown
Contributor Author

Pre-merge verification (head c41da3759f372b33f6b8161ddca3cb4da430670f):

  • Exact-head CI green (run attached to this head; earlier reds were fixed in-branch: deprecated channel-streaming usage → new focused channel-streaming-config subpath, knip dead barrel re-exports removed, memory-host-sdk kysely bridge registered in the package boundary inventory, realtime-voice-activation classified private-local with corrected surface budgets/d.ts alias maps, and its declarations excluded from published package files).
  • ClawSweeper findings from its review of b392f868946: P1 memory-host-sdk bridge allow-list → fixed in 1aab344551f; P2 activation subpath classification → fixed in c6a3758a86f (private-local, matching the sibling realtime-voice entries); P1 Codex source gate → inspected sibling ../codex at 3b36665 (codex-rs/app-server-protocol/src/protocol/common.rs ThreadId plain-string serialization): the codex sidecar change only defers OpenClaw-owned SDK imports inside async migration bodies and touches no Codex protocol shape.
  • Local proof: closure guard + package-contract guardrails + boundary inventory + release pack-path + kysely-sync/sqlite-transaction suites, and doctor/migration suites for every touched plugin, all green via node scripts/run-vitest.mjs; pnpm tsgo:core/tsgo:extensions/check:test-types, check:import-cycles (0 cycles), plugin-sdk:surface:check (151/4843/2919), deadcode:full, API baseline regenerated, full pnpm build exit 0 with no [INEFFECTIVE_DYNAMIC_IMPORT]. Codex autoreview (high): clean.
  • Timing proof (fresh-process jiti loader, pluginIds: [id]): discord 52.6s→0.3s, msteams 30.9s→0.5s, codex 29.6s→2.6s, zalouser 28.8s→2.3s, matrix 27.2s→3.2s, slack 17.5s→1.5s, reef 9.9s→0.7s, memory-core 6.4s→3.6s, workboard 3.4s→0.25s; require.cache free of node_modules/kysely for every doctor closure except llm-task (named follow-up: model-ref-shared → manifest-model-id-normalization coupling).

@steipete
steipete merged commit c2e7c81 into main Aug 9, 2026
132 checks passed
@steipete
steipete deleted the claude/doctor-closure-slimming branch August 9, 2026 03:29
@steipete

steipete commented Aug 9, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 9, 2026
…#120811)

* perf(doctor): slim remaining heavy doctor contract closures

Follow-up to openclaw#120698: several doctor closures still cold-loaded multi-second
kysely-bearing graphs through other broad barrels (session-store-runtime,
realtime-voice, channel-outbound, logging-core, memory-host-core/-events,
sqlite-runtime, persistent-dedupe, and plugin-local barrels).

- lazy-import heavy helpers inside async migration bodies (codex, msteams,
  zalouser, workboard, matrix inbound-dedupe, memory-core migrations)
- bypass plugin-local barrels to defining modules (reef protocol,
  memory-core short-term-promotion)
- move to lighter existing subpaths (slack -> channel-streaming, matrix
  logger -> security-runtime, memory-wiki -> agent-scope-runtime, which now
  also exports resolveSessionAgentId)
- add narrow openclaw/plugin-sdk/realtime-voice-activation for discord's
  sync wake-name doctor rules
- split src/infra/kysely-sync-cache-state.ts so sqlite-transaction clears
  Kysely caches without value-loading kysely; split the memory-host-sdk
  kysely bridge off the schema/transaction bridge
- guard: forbid the heavy barrels in doctor closures with per-kind scoping

Cold enumeration per plugin: discord 52.6s->0.3s, msteams 30.9s->0.5s,
codex 29.6s->2.6s, zalouser 28.8s->2.3s, matrix 27.2s->3.2s,
slack 17.5s->1.5s, reef 9.9s->0.7s, memory-core 6.4s->3.6s,
workboard 3.4s->0.25s; all kysely-free except llm-task (named follow-up).

* fix(plugins): route slack streaming compat through a focused streaming-config subpath

The channel-streaming compat barrel is deprecated for extension production
code (deprecated-api-usage guard + SDK package contract). Add the narrow
non-deprecated openclaw/plugin-sdk/channel-streaming-config subpath for the
pure streaming config readers, and drop the now consumer-less
short-term-promotion barrel re-exports knip flagged.

* test(plugins): register memory-host-sdk kysely bridge in package boundary inventory

* fix(plugins): classify realtime-voice-activation as private-local

ClawSweeper P2: the subpath exports only a default target, which is the
private-local shape; register it in plugin-sdk-private-local-only-subpaths,
the package-boundary d.ts alias maps, and correct the public surface budgets
(realtime-voice-activation no longer counts as public).

* fix(release): exclude realtime-voice-activation declarations from the published package

Private-local subpaths ship without d.ts; register the files negation the
release pack-path check requires.
steipete added a commit that referenced this pull request Aug 9, 2026
…ility transitively

Follow-up to #120698/#120811/#120882: the closure guard's enumerated barrel
bans cannot catch new heavy edges, and two closures still statically reached
kysely on main.

- guard: add a transitive kysely-reachability test that walks static value
  imports from every doctor-contract and legacy-setup closure through plugin,
  plugin-sdk, and relative core graphs, failing with the full import chain;
  type-only and lazy dynamic imports stay allowed
- llm-task/model refs: manifest-model-id-normalization reads snapshots
  through a registration-slot runtime bridge (snapshot modules register at
  eval; require fallback covers cold processes) and
  current-plugin-metadata-state moves its process-scoped facts onto a
  globalThis singleton so dual module instances share published state
- telegram: split thread-bindings-store.ts (pure record shapes + legacy-file
  readers) out of the acp-runtime-heavy manager, delete the consumer-less
  testing export, move the pure bot-user-id token parse to
  token-fingerprint.ts, and lazy-import token.js in the async update-offset
  detector

llm-task enumeration drops to ~0.8s/157 modules cold; every closure is now
statically kysely-free and stays that way by construction.
steipete added a commit that referenced this pull request Aug 9, 2026
…uard it transitively (#120876)

* perf(plugins): close the last kysely closure chains and guard reachability transitively

Follow-up to #120698/#120811/#120882: the closure guard's enumerated barrel
bans cannot catch new heavy edges, and two closures still statically reached
kysely on main.

- guard: add a transitive kysely-reachability test that walks static value
  imports from every doctor-contract and legacy-setup closure through plugin,
  plugin-sdk, and relative core graphs, failing with the full import chain;
  type-only and lazy dynamic imports stay allowed
- llm-task/model refs: manifest-model-id-normalization reads snapshots
  through a registration-slot runtime bridge (snapshot modules register at
  eval; require fallback covers cold processes) and
  current-plugin-metadata-state moves its process-scoped facts onto a
  globalThis singleton so dual module instances share published state
- telegram: split thread-bindings-store.ts (pure record shapes + legacy-file
  readers) out of the acp-runtime-heavy manager, delete the consumer-less
  testing export, move the pure bot-user-id token parse to
  token-fingerprint.ts, and lazy-import token.js in the async update-offset
  detector

llm-task enumeration drops to ~0.8s/157 modules cold; every closure is now
statically kysely-free and stays that way by construction.

* fix(telegram): repoint the native-command menu state at the token-fingerprint parser
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 10, 2026
…uard it transitively (openclaw#120876)

* perf(plugins): close the last kysely closure chains and guard reachability transitively

Follow-up to openclaw#120698/openclaw#120811/openclaw#120882: the closure guard's enumerated barrel
bans cannot catch new heavy edges, and two closures still statically reached
kysely on main.

- guard: add a transitive kysely-reachability test that walks static value
  imports from every doctor-contract and legacy-setup closure through plugin,
  plugin-sdk, and relative core graphs, failing with the full import chain;
  type-only and lazy dynamic imports stay allowed
- llm-task/model refs: manifest-model-id-normalization reads snapshots
  through a registration-slot runtime bridge (snapshot modules register at
  eval; require fallback covers cold processes) and
  current-plugin-metadata-state moves its process-scoped facts onto a
  globalThis singleton so dual module instances share published state
- telegram: split thread-bindings-store.ts (pure record shapes + legacy-file
  readers) out of the acp-runtime-heavy manager, delete the consumer-less
  testing export, move the pure bot-user-id token parse to
  token-fingerprint.ts, and lazy-import token.js in the async update-offset
  detector

llm-task enumeration drops to ~0.8s/157 modules cold; every closure is now
statically kysely-free and stays that way by construction.

* fix(telegram): repoint the native-command menu state at the token-fingerprint parser
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: discord Channel integration: discord channel: matrix Channel integration: matrix channel: msteams Channel integration: msteams channel: reef Channel integration: reef channel: slack Channel integration: slack channel: zalouser Channel integration: zalouser docs Improvements or additions to documentation extensions: codex extensions: memory-core Extension: memory-core extensions: memory-wiki extensions: xai maintainer Maintainer-authored PR merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. plugin: workboard rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts size: M 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