Repository navigation
refactor: deslop secrets, process, sessions, security, media, WhatsApp and voice-call - #160969
Conversation
Restore the structural identity input types so identity.ts does not import inbound types (madge cycle), unexport the now file-local hasConfiguredSecretRef, and shrink the assertion-safety baseline for three files the pass cleaned.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
|
Codex review: blocked before merge. Reviewed September 29, 2026, 3:52 AM ET / 07:52 UTC (Revision 7). ClawSweeper reviewWhat this changesThe branch consolidates helpers and types across secrets, process supervision, sessions, security audits, media, speech, WhatsApp, and voice calling without an intended user-visible change. Merge readiness⛔ Blocked before merge - 1 item remains The cleanup remains absent from current main, and this review found no discrete introduced defect. The previous request for test-cost detail is addressed in the PR body; the related PRs concern separate validation failures and do not supersede this work. Priority: P3 Review scores
Verification
How this fits togetherGateway configuration and credentials feed secret resolution, security checks, sessions, and process supervision. Media and speech handling then support channel plugins that deliver messages and calls. flowchart LR
A[Config and credentials] --> B[Secret resolution]
A --> C[Security audit]
B --> D[Sessions and processes]
D --> E[Media and speech]
E --> F[WhatsApp and voice calls]
F --> G[Messages and calls]
Before merge
Agent review detailsSecurityNone. PR surfaceSource -1397, Tests -64, Other -1. Total -1462 across 68 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Technical reviewBest possible solution: Keep the consolidated owners and existing public contracts, then complete normal exact-head maintainer review and merge gates. Do we have a high-confidence way to reproduce the issue? Not applicable: this refactor alleges no current-main defect to reproduce. The review compared the pinned introduced changes with their existing owners and the validation reported in the PR. Is this the best way to solve the issue? Yes for the stated cleanup: the branch removes forwarding logic while retaining the existing credential, webhook, and channel owners. Its broad scope still calls for ordinary maintainer review. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against a8d20b7438e8. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (6 earlier review cycles)
|
The subagent registry collector-yield case drained owned root work before the fake-timer zero-delay agent.wait continuation ran, so under shard load the run could still be running when asserted. It failed twice in checks-node-changed on #160620 and on #160969 while passing standalone. Advance fake timers by zero before draining, matching the suite's existing lifecycle-settlement pattern. Diagnosis and fix from #160987. Co-authored-by: Gio Della-Libera <[email protected]>
|
Merged via squash.
|
The subagent registry collector-yield case drained owned root work before the fake-timer zero-delay agent.wait continuation ran, so under shard load the run could still be running when asserted. It failed twice in checks-node-changed on openclaw#160620 and on openclaw#160969 while passing standalone. Advance fake timers by zero before draining, matching the suite's existing lifecycle-settlement pattern. Diagnosis and fix from openclaw#160987. Co-authored-by: Gio Della-Libera <[email protected]>
…p and voice-call (openclaw#160969) * refactor(secrets): deslop secrets runtime, apply and configure * refactor(process): deslop process supervision and hooks * refactor(sessions): deslop sessions and media * refactor(security): deslop security audit, media understanding and tts * refactor(whatsapp): deslop WhatsApp plugin * refactor(voice-call): deslop voice-call plugin * refactor: keep WhatsApp identity a leaf contract and shrink baselines Restore the structural identity input types so identity.ts does not import inbound types (madge cycle), unexport the now file-local hasConfiguredSecretRef, and shrink the assertion-safety baseline for three files the pass cleaned. * Merge remote-tracking branch 'origin/main' into steipete/deslop-core-media-channels * Merge remote-tracking branch 'origin/main' into steipete/deslop-core-media-channels * Merge remote-tracking branch 'origin/main' into steipete/deslop-core-media-channels Co-authored-by: Peter Steinberger <[email protected]>
What Problem This Solves
Several core areas and two channel plugins had seen few or no dedicated deslop passes:
src/secrets(2 prior passes),src/sessions,src/media,src/security,src/tts(3 each),src/process,src/hooks,src/media-understanding, the voice-call plugin (4 each), and the WhatsApp plugin (5). They carried forwarding helpers, duplicated local types, repeated projections, redundant re-normalization, dead options, and a single-purpose policy module.User Impact
None intended. This is a behavior-preserving refactor. The following are unchanged: SecretRef resolution order, redaction, permission and audit decisions, process supervision timing and ordering, session and media persistence, the security-audit output, TTS/media provider selection, WhatsApp and voice-call transport behavior, error and log text, the config schema, and plugin SDK exports. No migration or operator action.
Why This Change Was Made
The pass removes 1,397 net production lines (891 added, 2,288 removed) across 62 production files. Tests lose 64 net lines: four voice-call policy unit tests went with the module they covered, which was merged into the Twilio provider; the provider-level tests still assert the same four outcomes.
refactor(secrets): deslop secrets runtime, apply and configuresrc/secretsrefactor(process): deslop process supervision and hookssrc/process,src/hooksrefactor(sessions): deslop sessions and mediasrc/sessions,src/mediarefactor(security): deslop security audit, media understanding and ttssrc/security,src/media-understanding,src/ttsrefactor(whatsapp): deslop WhatsApp pluginextensions/whatsapprefactor(voice-call): deslop voice-call pluginextensions/voice-callrefactor: keep WhatsApp identity a leaf contract and shrink baselinesGuardrails, applied per slice:
scripts/prwrapper inventory, were excluded from editing (28 in secrets, 30 in process, 8 in sessions, 7 in security, 2 in media, 1 in media understanding). Files claimed by other open deslop PRs were also excluded, so the upgrade path is untouched.Review decisions worth checking:
secrets/apply.tsinlines the removed auth-store target helper. Its body was exactly the scoped-envresolveAgentDirplusresolveAuthProfileDatabasePath, with no main-agent special case.other. The only consumer rendersopenandallowlist, so the finding text is unchanged.Pick<WebInboundCallbackMessage…>, which created a madge type cycle and made the identity leaf depend on its consumer.Evidence
Head
b188eab4b10c(the slice commits plus a merge of current main). Everything ran locally on macOS with Node 26.oxfmt --checkon all changed filesnode scripts/run-oxlint.mjs --tsconfig config/tsconfig/oxlint.core.json(41 core files) and--tsconfig extensions/tsconfig.json(23 extension files)pnpm tsgo:core,pnpm tsgo:extensionsnode scripts/run-vitest.mjs <619 explicit files>: every non-E2E test under the ten areaspnpm plugin-sdk:surface:checkEquals<>compiler check on the 13 rewritten reachable typespnpm check:import-cycles,pnpm check:madge-import-cyclespnpm deadcode:exportshasConfiguredSecretRef)check-assertion-safety-ratchetPlugin SDK API: the
pnpm plugin-sdk:api:diffwrapper failed locally on tool process supervision, so I ran its renderer directly (scripts/plugin-sdk-api-diff.mts --render-root) on the merge basebb4573cd427cand on this head, then compared the two reports. The export set is identical: 4,591 exports, the same names, kinds and sources. The only export declaration that changed isVideoDescriptionRequest, which is now an alias of the shared request base instead of a repeated literal. The declaration text of 17 sections changed because repeated literals became shared bases (RequirementsMetadata,MediaUnderstandingProviderRequest,ImagesDescriptionInput,Omit<SpeechSynthesisRequest, ...>,UserTurnPersistenceOptions). About 200 exports reach one of those sections. A throwaway compiler check assertedEquals<>between the head type and its pre-PR literal for every rewritten reachable type:OpenClawHookMetadata,HookEligibilityContext.remote,PreparedImageDescriptionInput,ExtractStructuredWithModelParams,VideoDescriptionRequest,AudioTranscriptionRequest,StructuredExtractionImageInput,SpeechSynthesisStreamResult,SpeechTelephonySynthesisRequest,SpeechProviderPrepareSynthesisContext, theUserTurnTranscriptRecorderpersist parameters, andresolveStoredModelOverrideCoreparams. All 13 hold, and a widened negative control fails as expected.asProviderConfigMapleft the rendered TTS module text, but it was never an SDK export.No tests were added. Test cost falls slightly: four duplicate unit tests were removed with their module. Cross-area E2E and live suites were not run locally; hosted CI covers the changed-scope lanes.
Test cost
Changed test files. Local wall time is
node scripts/run-vitest.mjs <file> --maxWorkers=1; it is dominated by cold transform of the plugin graph. CI seconds are the summed per-test durations Vitest reported in CI run 36533649108 on this head.extensions/whatsapp/src/question-reactions.test.tschecks-node-changed-extensions-bundle-5).mainhas the same case as one test; this PR splits it into three raw-channel variants.extensions/whatsapp/src/channel-outbound.test.tschecks-node-changed-extensions-bundle-5)extensions/voice-call/src/providers/twilio.test.tschecks-node-changed-extensions-bundle-4)extensions/voice-call/src/webhook/realtime-audio-pacer.test.tschecks-node-changed-extensions-bundle-4)src/security/audit-workshop-skills.test.tschecks-node-changed-compact-small-14)extensions/voice-call/src/providers/twilio/twiml-policy.test.tstwilio.test.ts)Upgrade compatibility
I ran the published-driver x candidate cell locally:
OPENCLAW_UPGRADE_SURVIVOR_SCENARIOS=legacy-operator-state pnpm test:docker:published-upgrade-survivor, with publishedopenclaw@latest(2026.9.6) as the driver and this branch as the candidate. Every data and compatibility stage passed: baseline, formerly bundled plugin config, candidate schemas, automatic migration, survival, Gateway start, probes and status, legacy cron owners, the candidate agent turn, and the legacy plugin.The lane failed at its final
legacy-operator-update-noopcheck. That check deep-compares the maintenance advisory prose of the first update (written by the published updater) with the second (written by the candidate). #160056, already on main and not touched by this PR, reworded that advisory insrc/infra/gateway-supervision.ts, so every candidate built from current main fails that text equality. A separate follow-up will fix the harness to compare advisory kind rather than prose.CI flakes investigated
checks-node-changed-compact-large-10aborted a Vitest fork withSIGABRTwhile runningsrc/gateway/server.roles-allowlist-update.test.ts. The worker printed no diagnostic. Locally the file passed 3/3 alone, and the original eight-file gateway shard passed 2/2 in order. No existing issue or PR mentions this signature. This PR does not change gateway code, and the cause remains unexplained.checks-node-changed-compact-large-13failedsrc/agents/subagents/registry/subagent-registry.test.ts > settles a collector yield seen through agent.wait without canceling it. Locally it passed 3/3 on this branch and 3/3 on main (115 tests each run). The test drained owned root work before the zero-delay fake-timer continuation ran. test(subagents): settle yielded wait continuation #160987 diagnosed it (it failed the same way on fix: cron jobs treat node policy denials as failures #160620); the fix is now on main as 4c61161 and is merged into this branch.1cf36117d51a:checks-node-compact-small-18failed two cases oftest/scripts/ci-node-worker-owner-boundary.test.tstwice. It was not a flake. The test ran its sparse shard-runner copy with the host environment, so in prebuilt-dist CI shardsOPENCLAW_E2E_USE_PREBUILT_DIST=1made the copy importscripts/lib/vitest-build-prerequisites.mtsfrom outside its closure. Setting the flag reproduced the failure locally on main. It is fixed on main by bb4573c (6/6 with and without the flag) and merged here.update-restart-module-outcomewas red on main; it is fixed on main by d28f3f7 (direct red-main fix) and included through the merge.