Skip to content

refactor(channels): deslop Discord and Slack fifth pass - #160900

Merged
steipete merged 1 commit into
mainfrom
deslop/l151-discord-slack5
Sep 29, 2026
Merged

steipete merged 1 commit into
mainfrom
deslop/l151-discord-slack5

Conversation

@steipete

@steipete steipete commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Maintainer-requested fifth pass removes redundant Discord and Slack channel plumbing left after the earlier cleanups. Related: #159842.

User Impact

No intended user-visible behavior change. REST paths/bodies, custom IDs, component payloads, authorization, allowlists, rate limits, chunking, persisted data, manifests and config keys are preserved.

Why This Change Was Made

  • Remove 24 private route-only REST wrappers and migrate all callers to the existing request client. Keep message-ID validation, cached reads and response validation at their current owners.
  • Consolidate Discord guild dispatch and metadata read plumbing; simplify parameter and receipt projection without moving authority checks.
  • Reuse SDK and message-owner types (including the pinned Slack session API), remove unused preflight projections, and simplify thread-title and direct-session classification.
  • Remove the obsolete private approval container subclass and unused config plumbing; the existing container serializes the same fixed approval colors and components.
  • Remove redundant setup/lazy callbacks and Slack streaming/payload projections; reuse Slack identity detection from its owner.

Measured production diff: 314 added / 926 deleted, 612 net lines removed. Tests: 43 added / 90 deleted, 47 net lines removed. This is below the requested 1,000-line target; the complete size-sorted READ log below covers all 175 production files over 200 lines. Smaller production modules were also inspected. No additional sound structural cut was established without changing the hard contracts.

Evidence

The complete Discord/Slack patch passed fresh independent Codex review through P2. A required conflict rebase preserved #160766's consolidated tests; the scheduled-event assertion uses its existing send fixture and the existing search case covers escaping/repeated query parameters. The subsequent rebase onto the already-landed guardrail repair 5b76930a9b6 was conflict-free and git range-diff confirmed an identical lane patch.

Remote proof at 4987dad8bca0a0fdb270bbbb3eae334d5f96da6a (verified tree 48bc087ecc527ea098517ec53949dfddc2eb5195) passed:

  • pnpm test:extensions:batch discord slack: 466 files / 6,455 tests, 313 seconds wall.
  • node scripts/check-changed.mjs --base origin/main --timed: passed, including production/test types, formatting, lint, dead exports, cycles and storage guards.
  • pnpm build: passed.
  • pnpm plugin-sdk:check-exports: passed.
  • pnpm plugin-sdk:api:diff -- --base origin/main --head HEAD: No Plugin SDK API changes.

Provider: blacksmith-testbox; lease tbx_01m3neqs4j81grnntncg72bnpa, Testbox run, stopped. Tests used isolated synthetic fixtures; these are remote command results, not live channel traffic or hosted PR CI success.

The first boundary selection passed 56 tests but failed the unchanged runtime-API inventory test: it still expected retired extensions/diffs/runtime-api.ts and extensions/lobster/runtime-api.ts. That failure stopped the runner before the fs-safe shard. Main already fixed the stale inventory in 5b76930a9b6; the final branch incorporates that repair rather than duplicating it. No Discord/Slack production file changed during this final rebase. Earlier passing proof is retained for the unchanged lane patch.

Final head: 5db75d09ec8ae1e40291dc81cae9cb7b4168c0c9 (tree 5f45390d8898ca2e5fa76b2d1fe3c75672040334). The complete boundary rerun passed 6 files / 80 tests in 48.23 seconds (including all 23 fs-safe boundary tests) on blacksmith-testbox lease tbx_01m3nhtveekmvr333yqdzz60ka, boundary Testbox run. The lease is stopped. Command:

node scripts/run-vitest.mjs src/infra/fs-safe-import-boundary.test.ts test/plugin-extension-import-boundary.test.ts test/extension-import-boundaries.test.ts test/extension-test-boundary.test.ts src/plugins/contracts/core-extension-facade-boundary.test.ts src/plugins/contracts/plugin-sdk-runtime-api-guardrails.test.ts

Every lease used pnpm install --frozen-lockfile before validation. All tests, checks and builds ran remotely through the repository Crabbox wrapper.

Changed-test costs, each measured with pnpm test <file> --maxWorkers=1 on Testbox:

File under extensions/discord/src/ Tests Command wall
send.messages.test.ts 12 28 s
internal/api.test.ts 15 23 s
approval-handler.runtime.test.ts 15 29 s
monitor/message-handler.preflight-channel-context.test.ts 1 1 s
monitor/message-handler.draft-preview.rest.test.ts 11 40 s

Cold transforms/imports dominate the focused runs; the added scheduled-event payload assertion itself took 1 ms. Hosted per-file CI timings are not yet available. The assertion safety baseline changes only three decreasing counts produced by the canonical checker; unrelated generated increases were excluded.

Complete production coverage log (175 files over 200 lines)

Lane l151 Discord/Slack fifth-pass coverage

Initial sweep base: 89c0030e4c451fbe1af8ec14cd8ecdd43e38d9c9. Final base: 5b76930a9b6fa1819361588e109417db6f7e0ab1. All 175 production files over 200 lines at the final base are listed below, sorted by base size. Recent subtree commits since September 20 and their name-only diffs, including #159842, were read before editing. Untouched files over 150 lines were prioritized. All production modules were read, including smaller files. The eight incoming production diffs were read during the conflict-required rebase; the newly over-200-line progress-card module was read in full. Current main test consolidation and Slack proxy/progress-link fixes are preserved. A final patch-identical rebase incorporated the already-landed runtime-API inventory repair; it changed no Discord/Slack production files. Test/support files are excluded from production counts.

Base LOC Production file Disposition
1719 extensions/slack/src/monitor/message-handler/prepare.ts READ — Distinct admission, routing, history and mention stages preserve authorization and session-generation gates; no behavior-identical collapse remains.
1335 extensions/slack/src/send.ts READ — APPLIED: reuse the identity owner predicate. Upload, native-block fallback and durable reconciliation paths retain their different delivery/ambiguity contracts.
1278 extensions/slack/src/monitor/slash.ts READ — Menu codecs, response_url budgets and privileged command admission have independent transport requirements; prior fourth-pass work already consolidated registration.
1083 extensions/slack/src/monitor/events/interactions.block-actions.ts READ — Approval, question, plugin callback and historical command controls retain different actor/admission and terminalization contracts.
1002 extensions/discord/src/monitor/message-handler.preflight.ts READ — Inlined the private single-use mention boolean wrapper; all hydration, authority, mention/history/media ordering retained.
978 extensions/slack/src/action-runtime.ts READ — Action-specific parameter validation, read authorization and send settlement order remain observable; lazy method surface is exported publicly.
857 extensions/slack/src/monitor/provider.ts READ — Socket, HTTP and relay startup/recovery differ in identity and lifecycle ownership; no safe shared runner removes substantial logic.
854 extensions/slack/src/channel.ts READ — Recent fourth-pass facade extraction already consolidated delegation; remaining types document lazy SDK loading boundaries.
845 extensions/discord/src/monitor/model-picker.view.ts READ — Provider/model/runtime/recents rows deliberately omit different custom-id fields to satisfy the 100-character budget; preserve exact component serialization and row limits.
754 extensions/discord/src/voice/voice-runtime.ts READ — No further sound cut: serial guild joins, occupancy ownership, and capture generations have distinct cancellation/admission boundaries.
752 extensions/slack/src/monitor/message-handler/dispatch-progress.ts READ — Native append-only state and temporary drafts have different finalization semantics; latest quiet-progress behavior retained.
735 extensions/discord/src/monitor/native-command.ts READ — Command defer, authorization, plugin dispatch, status, model menu, and agent reply each have distinct dispatch/acknowledgment contracts; repeated live checks bracket awaited work.
731 extensions/discord/src/voice/realtime-speaker-session.ts READ — No further sound cut: provider lifecycle, immutable speaker identity, final-transcript drain, and voice replacement ownership must stay distinct.
714 extensions/discord/src/voice/realtime-consults.ts READ — No further sound cut: native, forced, and detached deliveries have different settlement and replay contracts; fourth pass already consolidated related flow.
706 extensions/discord/src/actions/runtime.messaging.shared.ts READ — Read-target and guild ancestry authorization is the owner for allowlist contracts; retained policy, unknown-metadata behavior, request ordering, and cache lifetime unchanged.
701 extensions/discord/src/channel.ts READ — Retained distinct plugin hooks, startup stagger, deadline-carrying lazy probes, live authority, and account diagnostics; prior passes already consolidated adapters.
694 extensions/discord/src/voice/realtime-playback.ts READ — No further sound cut: direct worker output and provider-response output have different clocks and interruption contracts; fourth-pass changes retained.
690 extensions/discord/src/monitor/native-command-model-picker-interaction.ts READ — Stable-token collision checks, legacy index ordering, runtime confirmation, and submit authority are independent invariants; merging branches would change callback contracts.
681 extensions/discord/src/monitor/listeners.ts READ — Generation checks, pending guild seeds, durable cooldown claims, and teardown settlement are necessary; constructor-specific listener identity preserves registration dedupe.
677 extensions/slack/src/actions.ts READ — REST operations preserve validation order, token selection, file-scope proofs and distinct native-data edit fallback.
674 extensions/slack/src/monitor/replies.ts READ — Web API and response_url delivery share reply compilation but have different five-call budgeting and settlement contracts.
664 extensions/discord/src/monitor/message-handler.context.ts READ — Owns distinct history visibility, thread routing and inbound context projections; collapsing these would blur policy or payload boundaries.
657 extensions/discord/src/monitor/thread-bindings.manager.ts READ — account-operation admission, persistence settlement, live-manager rechecks, and snapshot inputs have distinct guarantees; sync touch remains a named SDK contract. No sound large simplification without changing authority/state timing.
643 extensions/slack/src/monitor/message-handler/dispatch.ts READ — Streaming, draft finalization and supplemental TTS require different receipt and lifecycle outcomes.
637 extensions/discord/src/monitor/message-handler.process.ts READ — Existing lifecycle owns final delivery and queued follow-ups; repeated abort guards surround awaited authority-sensitive work and are not redundant.
637 extensions/discord/src/voice/voice-following.ts READ — No further sound cut: bounded user/bot reconciliation, DAVE cooldown, and generation-checked handoff are required behavior.
634 extensions/discord/src/voice/transcripts-source.ts READ — No further sound cut: source capture ownership intentionally survives transport replacement; occupancy and recording admission have distinct contracts.
627 extensions/discord/src/voice/voice-receive.ts READ — No further sound cut: packet receipts, physical finalization, conversation authorization, and recording completion are independent frontiers.
626 extensions/discord/src/actions/runtime.guild.ts READ — Shared role/event metadata read flow and inlined upload parameter projection; retained every sender permission and read-target check.
617 extensions/discord/src/voice/audio-worker.ts READ — No further sound cut: typed worker command switch owns socket, decoder, player, and bounded packet lifecycle; no shared generic dispatcher would simplify it.
613 extensions/slack/src/reply-blocks.ts READ — Canonical compiler owns ordered segments, authored text placement, native budgets and mirrored-control subtraction; callers reuse it.
606 extensions/discord/src/monitor/allow-list.ts READ — Name/id matching, member role policy, channel inheritance, and shipped runtime exports have named auth/compatibility contracts; no safe material reduction found.
606 extensions/slack/src/progress-blocks.ts READ — Card and native-task renderers target different wire contracts; append-only reconciliation and latest completion behavior retained.
584 extensions/discord/src/internal/rest-scheduler.ts READ — No change: bucket routing, lane weights, stale dropping, rate limits, and retry generations are hard contracts; normalization defaults differ from RequestClient.
583 extensions/slack/src/monitor/context.ts READ — Monitor-owned identity, metadata caches, dynamic policy and session title races remain distinct responsibilities.
577 extensions/slack/src/monitor/auth.ts READ — Message and system/button ingress intentionally differ in pairing, owner allowlists and retry behavior; authorization untouched.
562 extensions/discord/src/voice/voice-session.ts READ — No further sound cut: joining, promotion, and physical stop must preserve separate authority checks after awaits.
556 extensions/discord/src/monitor/model-picker.state.ts READ — Custom-id codec supports durable legacy indices, bounded URI size, stable tokens, and distinct bucket ordering; preserve wire identity and comparator contracts.
548 extensions/discord/src/monitor/provider.ts READ — orchestration carries separate startup/lifecycle cleanup owners and prepares policy once; flattening into a context object would obscure ownership and violate the requested design constraint.
546 extensions/discord/src/monitor/provider.lifecycle.ts READ — initial readiness, runtime readiness, socket drain, status, and shutdown phases have different deadlines and effects; similar-looking watchers are not interchangeable.
546 extensions/slack/src/monitor/media.ts READ — Direct and forwarded media share download owner already; their cleanup, deduplication and missing-media accounting differ.
535 extensions/slack/src/format.ts READ — Slack-specific tokenization, Unicode emphasis and role-header protection are transport contracts; no duplicate generic formatter remains.
530 extensions/slack/src/blocks-render.ts READ — Validation and rendering preserve different truncation/fallback contracts for native controls and data blocks.
526 extensions/discord/src/chunk.ts READ — Retained fence/inline-code source maps, Unicode boundaries, line limits, and reasoning balancing; no sound simpler owner preserves every chunk byte.
525 extensions/slack/src/monitor/provider-support.ts READ — SDK interoperability and private reconnect patch are named dependency contracts; lifecycle cleanup cannot be removed.
523 extensions/discord/src/doctor-contract.ts READ — Retained shipped alias, TTS, wake-name, and agent-binding migrations; the shared merge helper has different blocked-key semantics, so replacing it is not behavior-identical.
500 extensions/discord/src/approval-handler.runtime.ts READ — CHANGED: removed route-only create wrapper and obsolete UI subclass/config plumbing; existing Container owns serialization and approval owner still selects every identical color and payload.
497 extensions/slack/src/monitor/ingress.ts READ — Durable admission, logical-session ordering and channel migration fencing intentionally coexist; persisted payload unchanged.
494 extensions/discord/src/internal/gateway.ts READ — No further sound cut: session resumption, timer ownership, outbound limits, and raw durable MESSAGE_CREATE admission remain required; timer test seams were reviewed but not changed.
491 extensions/discord/src/monitor/thread-bindings.state.ts READ — normalized persisted records preserve missing versus present optional properties; singleton/reload registry and sync/async loading interop are intentional. Compact object-spread rewrites would only save formatting lines.
488 extensions/discord/src/voice/realtime-session.runtime.ts READ — No further sound cut: room player ownership, speaker retirement, candidate adoption, and voice rollback retain distinct state transitions.
488 extensions/slack/src/monitor/message-handler.ts READ — Debounce entries, logical replay claims and durable adoption settle independently; retries preserve admitted policy.
479 extensions/discord/src/monitor/message-media.ts READ — #159842 already consolidated attachment/sticker operation plumbing. Preserve downloaded MIME, voice classification, fallback order, SSRF and timeouts.
479 extensions/discord/src/voice/realtime-output.runtime.ts READ — No further sound cut: worker output buffering, drain, audible-silence retirement, marks, and watchdog ownership encode independent playback invariants.
476 extensions/discord/src/voice-message.ts READ — Retained bounded ffmpeg conversion, exact waveform/REST bodies, upload deadlines, retry ambiguity, and cleanup ownership.
470 extensions/slack/src/setup-core.ts READ — Setup credentials and identity modes already use shared wizard owners; config projection and inherited identity behavior retained.
468 extensions/discord/src/voice/audio.ts READ — No further sound cut: bounded yielding encoder, PCM resampling history, decoder cleanup, and ffmpeg pipe lifecycle are distinct transport contracts.
465 extensions/discord/src/send.shared.ts READ — Retired no-invariant createChannelMessage wrapper in coordination with internal owner; preserved payload, nonce protection, send authority, chunk boundaries, retry classification and partial results.
457 extensions/discord/src/monitor/gateway-plugin.ts READ — #159842 already consolidated capture construction; shipped-host capture compatibility is explicitly named. Retain transport ownership, endpoint guard, and delayed registration handling.
453 extensions/discord/src/monitor/native-command-auth.ts READ — Autocomplete and command authorization have intentionally different rejection/reporting paths and live-owner checks; no sound collapse without changing auth timing.
453 extensions/discord/src/send.outbound.ts READ — Retired no-invariant createChannelMessage wrapper for structured sends; preserved forum, media, nonce and delivery-result paths already consolidated in prior pass.
453 extensions/slack/src/monitor/presence-monitor.ts READ — Polling fairness, workspace rate-limit state and durable greeting reservation encode distinct lifecycle contracts.
452 extensions/discord/src/actions/handle-action.ts READ — Retained presentation fallback, adopted-thread routing and parameter precedence; prior pass already merged send/upload dispatch and combined message mutations.
447 extensions/slack/src/monitor/message-handler/dispatch-streaming.ts READ — Buffered SDK text, acknowledged delivery and fallback settlement require the existing state distinctions.
446 extensions/discord/src/components.parse.ts READ — Retained external unknown-input validation, exact errors, body whitespace and conditional field parsing; fourth-pass changes preserved.
445 extensions/slack/src/monitor/events/interactions.modal.ts READ — Submission/closed events already share a lifecycle handler; typed actor-binding and workspace session ownership remain necessary.
440 extensions/discord/src/monitor/listeners.reactions.ts READ — Added/removed wrappers already share one handler; DM/guild/thread authorization and own-message fetch order are distinct contracts, with prior-pass canonicalization retained.
435 extensions/slack/src/monitor/message-handler/prepare-thread-context.ts READ — Initial context recovery preserves reset tombstones, bot roots, policy-filtered history and per-root media ownership.
430 extensions/discord/src/config-schema.ts READ — Retained explicit config keys, legacy DM preprocessing, strict object shapes, and cross-field validation; hard schema contract unchanged.
429 extensions/discord/src/activities/http.ts READ — No change: OAuth request sequencing, token budgets, same-channel widget selection, document capability consumption, and CSP are security/wire contracts.
429 extensions/discord/src/send.permissions.ts READ — Permission bitfield, guild-owner, role hierarchy and private-thread checks are hard auth contracts; no reduction justified without broadening scope.
420 extensions/discord/src/monitor/thread-bindings.persistence.ts READ — synchronous public SDK interop must reconcile worker acknowledgements and preserve settlement authority; duplicated-looking atomic paths are required for distinct sync/async contracts.
417 extensions/discord/src/actions/runtime.messaging.send.ts READ — Retained thread pagination/rename warnings, reply scopes, component/voice/text send contracts; prior pass already owns delivery projection.
414 extensions/slack/src/outbound-adapter.ts READ — APPLIED: removed private-field stripping before the public-block compiler and forwarded compiler-produced delivery messages without rebuilding them.
413 extensions/discord/src/actions/handle-action.guild-admin.ts READ — One local runtime dispatcher owns account/config forwarding; eliminated one-use upload/event/thread parameter locals while preserving read order, options and trusted sender projection.
413 extensions/discord/src/monitor/message-handler.draft-preview.ts READ — Partial/block/progress flows intentionally differ; shared compositor/lifecycle already owns generic behavior. No further safe structural win found.
413 extensions/slack/src/approval-handler.runtime.ts READ — Approval states already share one renderer and runtime adapter; truncation preserves whitespace unlike the ordinary Slack helper.
412 extensions/discord/src/voice/realtime-turns.ts READ — Untouched-file-first READ; no further sound cut: immutable principal, wake-name follow-up, resampler continuity, and trailing silence retain observable semantics.
406 extensions/discord/src/components-registry.ts READ — Retained in-memory and persistent consume semantics, serialized group deletion, TTL normalization and failure disablement; related state type now derives from SDK owner.
404 extensions/discord/src/send.messages.ts READ — Direct REST routes replace invariant-free list/search wrappers; simplified equivalent initial-content selection and repeated search-filter loops. Retained message-ID validation and partial-thread-delivery bookkeeping.
397 extensions/discord/src/voice/audio-transport.ts READ — No further sound cut: IPC credits, physical-finalization projection, ffmpeg streaming backpressure, and stop ownership differ from worker implementations.
393 extensions/slack/src/client-delivery.ts READ — Upload origin/SSRF policy, pre-dispatch permanent failures and single-use completion boundaries are intentionally separate.
390 extensions/slack/src/monitor/relay-source.ts READ — WebSocket connection and frame lifecycles have different pending-work settlement; shipped relay wire format retained.
384 extensions/discord/src/monitor/provider.allowlist.ts READ — channel/guild/user passes merge different shapes with different error fallback/log behavior; shared SDK allowlist helpers already own the common operations. No new auth-policy abstraction justified.
381 extensions/discord/src/internal/rest.ts READ — CHANGED: remove redundant AbortError DOMException rethrow; Node 24.16/26.1 and Bun 1.4.0 set DOMException.prototype to Error.prototype, so the following Error rethrow preserves identity. Response bounds, authority, defaults, and non-Error wrapping remain unchanged.
376 extensions/slack/src/monitor/events/messages.ts READ — Message/app_mention and assistant metadata take different trusted identity paths; recent linked-admin changes retained.
369 extensions/slack/src/approval-native-gates.ts READ — Native and forwarding approval routes already use shared SDK gates; Enterprise workspace contracts remain separate.
366 extensions/discord/src/components.builders.ts READ — Retained exact component defaults, generated IDs, field omission and registry entries; recent shared select constructor owner preserved.
366 extensions/slack/src/monitor/thread.ts READ — Thread history is chronological while channel history is reverse chronological; bounded pagination and cache semantics differ.
361 extensions/discord/src/monitor/provider.deploy-errors.ts READ — error readers accept external unknown envelopes and formatting variants intentionally use different precision, depth, wording, and scope. No behavior-identical 20+ line extraction found.
360 extensions/slack/src/monitor/message-handler/dispatch-setup.ts READ — APPLIED: setup directly computes its two single-use streaming decisions and reuses the identity owner predicate; missing-thread diagnostics and block-streaming defaults are preserved.
357 extensions/discord/src/resolve-channels.ts READ — Retained guild/name/ID resolution precedence, forbidden versus not-found behavior, and stable active-match scoring; no sound additional owner collapse.
352 extensions/slack/src/message-action-dispatch.ts READ — Generic action translation already shares invocation and channel resolution; edit, send and media actions retain distinct payload contracts.
350 extensions/discord/src/internal/interactions.ts READ — No further sound cut: response queue serializes acknowledgement state; named component classes remain caller/runtime types and fourth-pass consolidation is retained.
349 extensions/discord/src/monitor/agent-components-guild-auth.ts READ — Component owner/member/user policy and final live-policy checks are distinct; duplicative-looking channel resolution crosses separate public interaction boundaries.
348 extensions/slack/src/data-table.ts READ — Inbound table and outbound data_table shapes differ in validation, empty cells and fallback rendering; native budgets retained.
347 extensions/discord/src/send.components.ts READ — Direct create-message route replaces invariant-free wrapper; retained component serialization, registry publication, attachment contracts and custody fences.
346 extensions/discord/src/monitor/agent-components.dispatch.ts READ — Existing generic inbound dispatch owns turn lifecycle; component context and reply target projections differ from text/slash flows and retain explicit callback authority.
346 extensions/slack/src/streaming.ts READ — SDK buffered/acknowledged state and native Stop races require explicit settlement; no duplicate stream owner remains.
337 extensions/discord/src/monitor/thread-bindings.lifecycle.ts READ — sync lifecycle calls are exported SDK compatibility; reconciliation separately handles missing, uncertain, and stale state with live binding identity checks. Keep these decisions explicit.
335 extensions/discord/src/config-ui-hints.ts READ — Retained declarative user-visible field help and keys; shared SDK already owns repeated hint families.
334 extensions/discord/src/doctor.ts READ — Retained unsafe-ID whole-list refusal, injected environment inspection and diagnostic field ordering; existing collector owns guild/channel traversal.
330 extensions/discord/src/monitor/native-command-model-picker-ui.ts READ — Session defaults versus current overrides require different read/error semantics; rendering and routing already delegate to their canonical owners.
329 extensions/discord/src/channel-actions.ts READ — Retained explicit action-context projection: exact-field handoff is covered by channel-actions.test.ts; direct context spreading passed unrelated adapter fields and was reverted after remote proof.
329 extensions/slack/src/draft-stream.ts READ — Human message boundaries, generations and cleanup custody distinguish retained drafts from finalizable previews.
324 extensions/discord/src/outbound-adapter.ts READ — CHANGED: presentation callback uses its canonical builder directly; webhook fallback, forum adoption, authorization and delivery lifecycle preserved.
322 extensions/discord/src/markdown.ts READ — Untouched-first READ; retained CommonMark semantic checks and protected Discord token/URL ranges because simplification could change rendered bytes.
321 extensions/slack/src/client-options.ts READ — Read/lookup/write clients have different timeout, authority and explicit-429 retry contracts; no safe policy consolidation. Incoming Socket Mode undici/proxy identity repair was read and preserved.
319 extensions/discord/src/monitor/provider.startup.ts READ — Registration order and constructor interleave carry real identity/lifecycle behavior; rejected a new pass-through registration closure as unnecessary abstraction.
315 extensions/discord/src/monitor/thread-bindings.discord-api.ts READ — webhook-to-bot fallback and authority assertions are transport contracts; error status/code extraction supports multiple external envelope shapes. Avoid changes under hard wire/auth constraints.
313 extensions/discord/src/monitor/gateway-metadata.ts READ — guarded response materialization releases transport before async capture; transient classification, bounded response read, and rate-limited fallback logs are independent responsibilities.
307 extensions/slack/src/monitor/message-handler/prepare-routing.ts READ — Binding owner selection precedes normal route selection and manages thread/main-DM differences; recent owner-order fix retained.
305 extensions/discord/src/probe.ts READ — Untouched-first READ; retained primary body budget, optional application deadline reserve, abort cleanup and 429 distinction.
300 extensions/discord/src/monitor/message-dispatcher.ts READ — Generic debouncer/run queue already own shared flow; pending entry/cancellation sets preserve shutdown settlement.
297 extensions/discord/src/voice/participant-context.ts READ — No change: bounded roster projection, current-human counting, and async descriptive enrichment intentionally serve different callers.
292 extensions/discord/src/monitor/threading.auto-thread.ts READ — Migrated retired editChannel forwarder to the identical REST route; creation/lookup, races, and detached title lifecycle retained.
287 extensions/slack/src/monitor/enterprise-install.ts READ — Workspace-qualified policies and installation identity validation are hard authorization/config contracts.
283 extensions/discord/src/outbound-payload.ts READ — Retained voice failure settlement, media remainder delivery, forum adoption, receipt aggregation and component fallback boundaries.
274 extensions/slack/src/accounts.ts READ — Credential precedence, enabled transport fields and nested streaming merge semantics differ from read-only inspection.
273 extensions/discord/src/api.ts READ — Retained read-authority capture, bounded decoding, abortable rate-limit backoff and redacted error paths; these are transport contracts.
273 extensions/discord/src/voice/membership.ts READ — No further sound cut: initial/enriched roster and live membership updates have distinct revision fencing and event text.
265 extensions/discord/src/actions/runtime.messaging.messages.ts READ — Read-target policy, retained-progress composition and search inference need distinct per-action ordering; prior pass already combined pin/unpin. No sound additional owner reduction.
265 extensions/discord/src/voice/segment.ts READ — No change: recording and conversation permission are rechecked at separate awaited boundaries; speech payload and playback cleanup remain unchanged.
263 extensions/discord/src/internal/components.message.ts READ — No change: serializers define exact Discord component payloads and class defaults; third/fourth-pass component work retained.
261 extensions/slack/src/config-schema.ts READ — Manifest/config keys, defaults and validation diagnostics are hard contracts; shared schemas already own common fields.
258 extensions/discord/src/draft-stream.ts READ — CHANGED: direct existing REST create route replaces wrapper; generation fencing, stale create disposal and retarget cleanup preserved.
257 extensions/discord/src/monitor/reply-delivery.ts READ — Shared durable batch owner already replaces transport loops; binding identity, suppression and partial-delivery receipt handling each express a contract.
255 extensions/discord/src/activities/store.ts READ — No change: atomic compare/apply, pending-launch ambiguity, snowflake delivery ordering, TTLs, and persisted shapes are hard contracts.
254 extensions/discord/src/voice/realtime-recording.ts READ — No further sound cut: whole-generation eligibility, per-input batch/audio sealing, and terminal publication settlement are necessary.
253 extensions/discord/src/monitor/native-command-reply.ts READ — Native component/media preservation, interaction-expiry partial receipts, and chunk ordering are meaningful transport contracts; no safe simplification beyond prior pass.
253 extensions/discord/src/security-audit.ts READ — Untouched-first READ; retained raw-config shape validation, broad-member and mutable-name findings with exact security-policy distinctions.
253 extensions/discord/src/voice/command.ts READ — No change: command authorization and join/status/leave replies preserve all existing channel/guild error paths and slash payloads.
251 extensions/slack/src/monitor/runtime-policy.ts READ — Immutable admission snapshots and name-resolution publication preserve current policy; allowlist semantics untouched.
250 extensions/discord/src/monitor/threading.starter.ts READ — #159842 already moved raw content formatting to message-text.ts. Cache/in-flight keys deliberately include parent route and account; remaining author projection is specific to starter context. Related type-only cleanup remains in threading.types.ts below.
247 extensions/discord/src/send.webhook.ts READ — Retained webhook deadline, body-read bounds, non-idempotent retry classification, identity reservation, chunk custody and reply scopes as distinct transport contracts.
245 extensions/discord/src/monitor/agent-components.handlers.ts READ — Modal trigger and message component consumption have different expiry/reuse/ack timing; wildcard factories already share handlers and preserve callback-vs-command distinction.
244 extensions/discord/src/endpoint-runtime.ts READ — Untouched-first READ; retained endpoint origin/path admission, SSRF policy, response bounds and retained runtime semantics.
243 extensions/slack/src/doctor.ts READ — Doctor diagnostic distinctions for stable IDs, ambiguous names and credentials are intentional and user-facing.
242 extensions/discord/src/voice/voice-conversation-input.ts READ — Untouched-file-first READ; no further sound cut: pending audio/text bounds, authorization serialization, and retirement settlement prevent partial commands.
242 extensions/slack/src/monitor/message-handler/prepare-room-history.ts READ — History media budgeting, current-session checks and context visibility are necessary independent gates.
241 extensions/discord/src/monitor/auto-presence.ts READ — availability, stable payload signatures, connected gating, and min-update rate limiting are distinct contracts. Repeated config evaluation can observe current held config, so removing it is not strictly identical.
240 extensions/discord/src/internal/rest-errors.ts READ — Untouched-file-first READ; no change: bounded recursive secret redaction, collision-safe keys, priority diagnostics, and strict numeric retry parsing remain required.
238 extensions/discord/src/monitor/native-command-context.ts READ — Projects native command admission into shared host ingress; existing interaction adapter centralizes caller facts while preserving slash and real-origin targets.
236 extensions/slack/src/data-visualization.ts READ — Chart validation, native wire projection and parsing-to-fallback preserve different external shapes.
234 extensions/discord/src/monitor/message-handler.process-reactions.ts READ — Feedback/client separation, reaction retargeting and settlement are distinct operations; preserve rate and reaction authority behavior.
232 extensions/discord/src/monitor/dm-command-auth.ts READ — Shared ingress resolver already owns DM and command admission; dynamic channel-audience membership and synthetic group facts preserve auth provenance.
232 extensions/discord/src/monitor/exec-approvals.ts READ — Fourth pass already consolidated terminal results; serialized prompt updates and acknowledgment fallbacks enforce concurrent-approval behavior.
232 extensions/discord/src/monitor/model-picker-preferences-migrations.ts READ — Untouched legacy import owner preserves documented JSON-era shape upgrades, per-model ordering, cleanup modes, and optional cache discard; no state-neutral reduction found.
230 extensions/discord/src/monitor/message-text.ts READ — #159842 already introduced canonical raw message extraction; live Message, raw snapshot and batch projections retain distinct wire semantics.
226 extensions/discord/src/monitor/gateway-supervisor.ts READ — buffered/active/teardown/disposed handling preserves emitter safety and lifecycle ownership; late error guard intentionally outlives runtime without retaining it.
226 extensions/discord/src/monitor/thread-bindings.session-adapter.ts READ — protocol adapter translates conversation placement and metadata while retaining synchronous SDK touch compatibility; noop manager owns a real disabled adapter lifecycle.
226 extensions/slack/src/monitor/message-handler/dispatch-helpers.ts READ — APPLIED: removed single-caller shouldUseStreaming and resolveSlackDisableBlockStreaming wrappers; setup remains the decision owner.
225 extensions/discord/src/monitor/message-handler.process-reply-runtime.ts READ — Runtime combines lazy typing and delivery correlation; direct callback forwarding can lose receiver semantics. No sound material reduction found.
224 extensions/slack/src/doctor-contract.ts READ — Legacy aliases are shipped config migrations with exact diagnostics and ordered transforms; retained under compatibility contract.
223 extensions/discord/src/internal/structures.ts READ — No further sound cut: partial entity hydration and message/user projections have real monitor/voice callers; third-pass consolidation retained.
223 extensions/discord/src/retry.ts READ — Untouched-first READ; retained response-first ambiguity classification, nonce/non-idempotent retry policies, gateway reconnect allowance and abort ownership.
223 extensions/discord/src/voice/ingress.ts READ — No change: current speaker access and run binding are authority boundaries; recent 2026.9.6 host compatibility path has a named shipped contract.
221 extensions/discord/src/voice/realtime-output.ts READ — No change: parent output projection carries item identity while worker clock owns playback; reserved IPC audio and heard marks must stay distinct.
220 extensions/discord/src/monitor/provider.deploy.ts READ — per-method wrapper preserves unrelated REST traffic and restores exact bound methods. Nested error handling also catches formatting/logging failures; flattening blindly would alter its background failure behavior.
219 extensions/discord/src/setup-core.ts READ — Untouched-first READ; retained account-scoped wizard schemas, allowlist resolution and token handling; forwarding simplification applied in setup-surface.ts.
219 extensions/discord/src/voice/receive-recovery.ts READ — No change: DAVE and Opus error classification require dependency-specific guards; exact recovery thresholds retained.
219 extensions/slack/src/monitor/events/interactions.ts READ — Redaction, bounded compaction and modal input summarization protect different event fields and size budgets.
217 extensions/discord/src/send.guild.ts READ — Direct guild REST routes remove invariant-free internal wrappers; preserved request verbs/paths, role operations, event body and moderation audit headers.
215 extensions/slack/src/blocks-fallback.ts READ — Block variants have distinct text ordering, escaping and fallback behavior; shared native-data renderers already reused.
214 extensions/slack/src/approval-native.ts READ — Exec/plugin forwarding and origin/approver surfaces have different eligibility contracts; latest approval-surface fix retained.
210 extensions/discord/src/internal/event-queue.ts READ — Untouched-file-first READ; no change: listener timeout settles dispatch without releasing actual concurrency; normalization differs from generic clamping.
210 extensions/discord/src/send.types.ts READ — Public/runtime-api exports and concrete consumers retain these types and error shape; API types intentionally differ from plugin parameter names.
210 extensions/discord/src/shared-interactive.ts READ — Retained typed command/callback/question/URL distinctions, mixed-select rejection and exact component layout.
207 extensions/slack/src/monitor/message-handler/prepare-content.ts READ — Parent-file exclusion, mentioned-user lookup and unavailable-media context preserve original inbound semantics.
207 extensions/slack/src/monitor/thread-resolution.ts READ — Live missing-thread lookup, bounded cache and transient durable retry behavior remain independent owner state.
205 extensions/slack/src/monitor/message-handler/dispatch-progress-card.ts READ — Incoming visible-work-session link repair was read in full; retained bounded link projection, draft finalization, and per-turn reset ownership unchanged.
203 extensions/discord/src/internal/command-deploy.ts READ — No change: per-application cached hashes, patch/create/delete sequencing, and hard-cap overwrite fallback preserve persisted/wire behavior.
202 extensions/discord/src/monitor/message-handler.recent-history.ts READ — Migrated retired listChannelMessages forwarder to the identical typed REST route; preserved physical pagination, identity, visibility and history bounds.
202 extensions/discord/src/voice/voice-recording.ts READ — No further sound cut: global WAV budgets, capture epoch splitting, and recording/conversation frontiers are independent required ownership.
201 extensions/slack/src/native-data-blocks.ts READ — Native data detection, response-url error handling and accessible fallback occurrence accounting have distinct contracts.

@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: slack Channel integration: slack size: XL labels Sep 29, 2026
@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: needs maintainer review before merge. Reviewed September 28, 2026, 11:25 PM ET / September 29, 2026, 03:25 UTC (Revision 3).

ClawSweeper review

What this changes

The branch removes private Discord REST forwarding code and simplifies Discord guild actions, approvals, and delivery, alongside Slack streaming, identity, and outbound projections.

Merge readiness

✅ Ready for maintainer review

This remains a distinct, coherent cleanup: current main still contains the Discord forwarding helpers it removes. The merged fourth pass covered adjacent work, and this review found no concrete defect introduced by the pinned diff.

Priority: P3
Reviewed head: 5db75d09ec8ae1e40291dc81cae9cb7b4168c0c9

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The cleanup is coherent, reduces duplicate code, and has substantial reported validation, with no actionable defect established in this review.
Proof confidence 🌊 off-meta tidepool Not applicable: The host identifies this as a MEMBER-authored internal refactor, so the contributor real-behavior gate does not apply. The PR reports synthetic extension and boundary validation for the changed channel paths, without claiming live platform traffic; no stored-data contract change 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 host identifies this as a MEMBER-authored internal refactor, so the contributor real-behavior gate does not apply. The PR reports synthetic extension and boundary validation for the changed channel paths, without claiming live platform traffic; no stored-data contract change was identified.
Evidence reviewed 7 items Current main still has the forwarding layer: The fetched main revision retains Discord guild-channel forwarding helpers, so this branch's central cleanup is not already on main.
Introduced Discord send path: The changed outbound path calls the existing REST client while retaining the final send-authorization check and nonce-protected request handling.
Introduced Slack delivery projection: The delivery loop spreads the typed delivery message into the existing send context; that message type contains the same text, blocks, placement, fallback, and plain-text fields previously passed individually.
Findings None None.
Security None None.

How this fits together

Discord and Slack plugins translate incoming messages and agent actions into platform requests and outgoing replies. Their account checks, request clients, and delivery code determine what reaches each platform and what receipt OpenClaw records.

flowchart LR
  A[Messages and agent actions] --> B[Discord and Slack plugins]
  B --> C[Account and permission checks]
  C --> D[Platform request clients]
  D --> E[Discord and Slack APIs]
  E --> F[Replies and delivery receipts]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source -612, Tests -47, Other 0. Total -659 across 49 files.

View PR surface stats
Area Files Added Removed Net
Source 43 314 926 -612
Tests 5 43 90 -47
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 3 3 0
Total 49 360 1019 -659

Review metrics

None.

Technical review

Best possible solution:

Keep one owner for each channel transport operation while preserving existing account gates, platform payloads, and delivery receipts.

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

Not applicable: the PR claims no failing user behavior. Its route and payload changes can be compared with the existing owners and the reported synthetic boundary checks.

Is this the best way to solve the issue?

Yes. Removing private forwarding helpers in favor of the existing request client is a narrow single-owner cleanup, and the inspected paths retain their authorization and delivery contracts.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

No label changes.

Label justifications:

  • P3: This is a behavior-preserving channel cleanup with no demonstrated user-facing 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 host identifies this as a MEMBER-authored internal refactor, so the contributor real-behavior gate does not apply. The PR reports synthetic extension and boundary validation for the changed channel paths, without claiming live platform traffic; no stored-data contract change was identified.

Evidence

What I checked:

  • Current main still has the forwarding layer: The fetched main revision retains Discord guild-channel forwarding helpers, so this branch's central cleanup is not already on main. (extensions/discord/src/internal/api.guild.ts:32, 59490dc75277)
  • Introduced Discord send path: The changed outbound path calls the existing REST client while retaining the final send-authorization check and nonce-protected request handling. (extensions/discord/src/send.outbound.ts:427, 5db75d09ec8a)
  • Introduced Slack delivery projection: The delivery loop spreads the typed delivery message into the existing send context; that message type contains the same text, blocks, placement, fallback, and plain-text fields previously passed individually. (extensions/slack/src/outbound-adapter.ts:305, 5db75d09ec8a)
  • Pinned merge-result parentage: The verified test merge records the pinned base as its first parent and the exact PR head as its second parent; its Discord and Slack result retains this PR's changed paths. (adc0610ee1ac)
  • Adjacent merged history: The same area has a merged fourth cleanup pass, but the current-main forwarding helpers show that it did not complete this branch's work. (extensions/slack/src/outbound-adapter.ts, 13cf74eba440)
  • Reported validation and prior review: The captured PR body reports 6,455 synthetic Discord and Slack tests on an earlier patch-equivalent head and 80 boundary tests on the final head. The preceding ClawSweeper review of this same head recorded no findings or required before-merge action; these results do not claim live platform traffic.

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Shakker: 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-09-29T02:31:22.000Z sha 4987dad8bca0a0fdb270bbbb3eae334d5f96da6a :: blocked before merge. :: none
  • reviewed 2026-09-29T03:15:43.861Z sha 5db75d0 :: needs maintainer review before merge. :: none

@steipete
steipete force-pushed the deslop/l151-discord-slack5 branch from 4987dad to 5db75d0 Compare September 29, 2026 03:07
@steipete
steipete marked this pull request as ready for review September 29, 2026 03:18
@steipete
steipete enabled auto-merge (squash) September 29, 2026 03:21
@steipete
steipete merged commit 6391a9a into main Sep 29, 2026
250 of 251 checks passed
@steipete
steipete deleted the deslop/l151-discord-slack5 branch September 29, 2026 03:31
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 29, 2026
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: slack Channel integration: slack P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. 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