Skip to content

refactor(channels): move inbound turn execution into core - #110095

Merged
steipete merged 18 commits into
mainfrom
codex/channel-dispatch-core
Jul 17, 2026
Merged

steipete merged 18 commits into
mainfrom
codex/channel-dispatch-core

Conversation

@steipete

@steipete steipete commented Jul 17, 2026 •

Copy link
Copy Markdown
Contributor

Related: #109316

Follow-up to #109716.

What Problem This Solves

Bundled message channels still owned the core execution half of inbound turns: session recording, dispatcher construction, durable-delivery handling, retry plumbing, reply pipelines, and final lifecycle callbacks. That kept deprecated low-level compatibility calls alive as internal architecture even after the marker sweep reached zero removable declarations.

Why This Change Was Made

Core now owns the complete inbound turn lifecycle. Channel adapters return data-only turn plans containing normalized context plus transport delivery facts; the core runner performs recording, dispatch, retry, durable delivery, typing/reaction lifecycle composition, and finalization. Feishu, iMessage, Matrix, Mattermost, Microsoft Teams, QQBot, Signal, Telegram, and WhatsApp now use that path. Special native Mattermost interactions use the focused core reply seam instead of rebuilding lifecycle logic.

Microsoft Teams folds its sender-timezone fact into the effective per-turn config before handing the plan to core. This preserves the existing behavior without keeping the deprecated dispatcher or adding a one-channel field to the public SDK.

The public Plugin SDK declaration baseline is unchanged. A ratcheted guard rejects bundled production use of prepared-turn callbacks, pre-dispatch failure callbacks, and low-level dispatcher lifecycle calls.

User Impact

No intended user-visible behavior change. External plugins keep the shipped compatibility window. Maintainers get transport-thinner channels, one core execution path, and a hard zero budget for internal deprecated channel lifecycle calls.

Non-test TypeScript using the task's *.test.ts exclusion: +1797 / -1895, net -98 lines.

Deprecation Triage

Bucket Final count Decision
LEGITIMATE 110 files / 308 raw marker lines Keep only shipped SDK/public, released CLI/config/data, doctor/migration, or provider/dependency compatibility. Every keep is enumerated below.
STALE INTERNAL 0 remaining Bundled callers use core turn plans or focused modern core seams. The guard fails any reintroduction of deprecated channel lifecycle calls.
DEAD 0 remaining Caller and SDK-surface searches found no removable remaining declaration. No removed-symbol tests were rewritten.

Raw marker lines and declarations are different units: a declaration may carry several deprecated members or be re-exported through public barrels.

LEGITIMATE keeps: all 110 files outside plugin-sdk

Shipped Plugin SDK/public facade — 63 files

Rationale: reachable through documented Plugin SDK/public barrels. External plugin deprecation window retained; internal and bundled callers use modern focused seams.

  • src/agents/agent-runtime-id.ts
  • src/agents/embedded-agent-runner/run/params.ts
  • src/agents/embedded-agent-runner/runs.ts
  • src/agents/harness/types.ts
  • src/agents/runtime-plan/types.ts
  • src/auto-reply/reply-payload.ts
  • src/auto-reply/reply/history.ts
  • src/auto-reply/templating.ts
  • src/channels/direct-dm-access.ts
  • src/channels/draft-preview-finalizer.ts
  • src/channels/inbound-event/context.ts
  • src/channels/mention-gating.ts
  • src/channels/message/inbound-reply-dispatch.ts
  • src/channels/message/send.ts
  • src/channels/plugins/outbound.types.ts
  • src/channels/plugins/outbound/interactive.ts
  • src/channels/plugins/types.adapters.ts
  • src/channels/plugins/types.core.ts
  • src/extensionAPI.ts
  • src/flows/doctor-core-checks.ts
  • src/infra/approval-gateway-resolver.ts
  • src/infra/approval-handler-adapter-runtime.ts
  • src/infra/approval-handler-runtime-types.ts
  • src/infra/approval-handler-runtime.ts
  • src/infra/approval-native-runtime.ts
  • src/infra/brew.ts
  • src/infra/dedupe.ts
  • src/infra/exec-approval-reply.ts
  • src/infra/exec-command-resolution.ts
  • src/infra/fs-safe.ts
  • src/infra/net/fetch-guard.ts
  • src/infra/outbound/deliver-runtime.ts
  • src/infra/outbound/deliver.ts
  • src/infra/outbound/reply-payload-normalize.ts
  • src/infra/secret-file.ts
  • src/interactive/payload.ts
  • src/logging/diagnostic.ts
  • src/media-understanding/types.ts
  • src/media/audio.ts
  • src/media/fetch.ts
  • src/memory-host-sdk/dreaming.ts
  • src/plugins/agent-tool-result-middleware-types.ts
  • src/plugins/hook-before-agent-start.types.ts
  • src/plugins/hook-before-tool-call-result.ts
  • src/plugins/hook-types.ts
  • src/plugins/hooks.ts
  • src/plugins/manifest.ts
  • src/plugins/plugin-api.types.ts
  • src/plugins/plugin-command.types.ts
  • src/plugins/plugin-definition.types.ts
  • src/plugins/provider-auth-token.ts
  • src/plugins/provider-catalog.types.ts
  • src/plugins/provider-claude-thinking.ts
  • src/plugins/provider-model-compat.ts
  • src/plugins/provider-openai-chatgpt-oauth.ts
  • src/plugins/provider-plugin.types.ts
  • src/plugins/provider-replay-helpers.ts
  • src/plugins/provider-replay.types.ts
  • src/plugins/runtime/runtime-channel.ts
  • src/plugins/runtime/runtime-tasks.types.ts
  • src/plugins/runtime/types-channel.ts
  • src/plugins/runtime/types-core.ts
  • src/plugins/runtime/types.ts

Provider/dependency compatibility — 14 files

Rationale: compatibility owned by a shipped provider or upstream dependency contract. Core and bundled callers do not use the deprecated entry points.

  • src/agents/anthropic-payload-policy.ts
  • src/agents/auth-profiles/constants.ts
  • src/agents/cli-credentials.ts
  • src/agents/copilot-dynamic-headers.ts
  • src/agents/embedded-agent-runner/openrouter-model-capabilities.ts
  • src/agents/gpt5-prompt-overlay.ts
  • src/agents/model-auth-markers.ts
  • src/agents/openai-text-verbosity.ts
  • src/llm/providers/stream-wrappers/anthropic-family-tool-payload-compat.ts
  • src/llm/providers/stream-wrappers/minimax.ts
  • src/llm/providers/stream-wrappers/moonshot-thinking.ts
  • src/llm/providers/stream-wrappers/openai.ts
  • src/llm/providers/stream-wrappers/proxy.ts
  • src/llm/providers/stream-wrappers/zai.ts

Released CLI/config/data contracts — 32 files

Rationale: shipped CLI input, config, gateway, or persisted-data compatibility. Canonical runtime fields remain modern; parsing, schema, wire, or migration boundaries retain the old names.

  • src/cli/config-set-input.ts
  • src/cli/gateway-cli/run-options.ts
  • src/cli/plugins-cli.ts
  • src/cli/plugins-uninstall-command.ts
  • src/commands/onboard-types.ts
  • src/config/types.agent-defaults.ts
  • src/config/types.agents.ts
  • src/config/types.base.ts
  • src/config/types.channels.ts
  • src/config/types.cron.ts
  • src/config/types.discord.ts
  • src/config/types.gateway.ts
  • src/config/types.googlechat.ts
  • src/config/types.messages.ts
  • src/config/types.openclaw.ts
  • src/config/types.plugins.ts
  • src/config/types.slack.ts
  • src/config/types.telegram.ts
  • src/config/types.tools.ts
  • src/config/types.tts.ts
  • src/config/zod-schema.agents.ts
  • src/config/zod-schema.allowdeny.ts
  • src/config/zod-schema.session.ts
  • src/context-engine/types.ts
  • src/cron/service/state.ts
  • src/cron/types.ts
  • src/proxy-capture/env.ts
  • src/proxy-capture/paths.ts
  • src/proxy-capture/types.ts
  • src/routing/resolve-route.ts
  • src/security/dm-policy-shared.ts
  • src/system-agent/setup-inference.ts

Doctor/migration bridge — 1 file

Rationale: migration-only helper for the retired shipped JSON pairing store; not used by steady-state canonical runtime.

  • src/pairing/pairing-store.ts

Evidence

Exact pushed head: bdb186f6c8b710e141c407460ff3a366723abe7d on merge base b42dc728510be52c5a50a2d817c1347330b8b5d8. GitHub reports it mergeable with current main.

  • Final broad changed gate: format, all core/extension/script production and test typechecks, full core/extension/script lint, Plugin SDK API/surface checks, deprecated API usage, plugin boundaries, runtime-cycle, storage, pairing, and package guards — green (run).

  • Final public-surface simplification: 58 focused core/Teams/provider tests, four typecheck lanes, targeted format, unchanged Plugin SDK baseline, and deprecated API usage guard — green (run).

  • Final rebase overlap proof: Feishu 92/92, channel kernel 36/36, SDK baseline, and deprecated API guard — green (run).

  • CI-driven runtime API guard cleanup: focused contract suite 6/6 — green (run).

  • Blacksmith Testbox: 143 focused core, Feishu, and Telegram regression tests; pnpm format:check; pnpm tsgo:prod; pnpm check:test-types; pnpm lint:extensions:no-deprecated-channel-access; both Plugin SDK gates; and pnpm build — green (run).

  • Follow-up Testbox: exact hosted-CI lint command, 161 focused regressions, plugin production types, and all test-type lanes — green (run).

  • Final review-fix Testbox: observe-only dispatch-result regression, 35 channel-kernel tests, and exact hosted-CI lint command — green (run).

  • Final exact-head follow-up Testbox: 91 channel-kernel and WhatsApp regressions, full lint/format, and the hard-zero production/full-tree/script unused-export gates — green (run).

  • Rebased resolver-contract Testbox: 330 core, Teams, provider-dispatcher, and resolver regressions; full lint; production/UI/extension and all test types; Plugin SDK API/surface gates; hard-zero unused exports — green (run).

  • Final combined-baseline Testbox after rebase: 98 tooling tests plus focused core, provider-dispatcher, Teams, package-workflow, and UI regressions; exact full lint; production and all test types; Plugin SDK API/surface gates; hard-zero unused exports — green (run).

  • Earlier rebased-patch Testbox proof: 42 targeted integration regressions plus production/test type checks, internal-deprecation guard, and both Plugin SDK gates — green (run).

  • Focused core and bundled channel suites — green across Feishu, iMessage, Matrix, Mattermost, Microsoft Teams, QQBot, Signal, Telegram, WhatsApp, direct-DM, reply dispatch, and Plugin SDK runtime mocks.

  • git diff --check — green.

  • Fresh full-branch review found and drove the Teams effective-config simplification; final branch and cleanup autoreviews — no accepted/actionable finding.

No UI files changed; screenshots not applicable. No changelog: internal behavior-neutral architecture refactor.

AI-assisted implementation and review.

@openclaw-barnacle openclaw-barnacle Bot added channel: imessage Channel integration: imessage channel: matrix Channel integration: matrix channel: mattermost Channel integration: mattermost channel: msteams Channel integration: msteams channel: signal Channel integration: signal channel: slack Channel integration: slack channel: telegram Channel integration: telegram channel: whatsapp-web Channel integration: whatsapp-web scripts Repository scripts channel: feishu Channel integration: feishu channel: qqbot channel: qa-channel Channel integration: qa-channel size: XL maintainer Maintainer-authored PR labels Jul 17, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d36c9e3f72

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/channels/turn/kernel.ts Resolved
@steipete
steipete force-pushed the codex/channel-dispatch-core branch from d36c9e3 to abdaf13 Compare July 17, 2026 17:31
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. labels Jul 17, 2026
@clawsweeper

clawsweeper Bot commented Jul 17, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed July 17, 2026, 7:46 PM ET / 23:46 UTC.

Summary
Moves bundled channel inbound-turn execution into core lifecycle code while channel adapters supply normalized turn plans, transport delivery callbacks, and channel-specific reply behavior.

PR surface: Source -44, Tests +214, Other +8. Total +178 across 63 files.

Reproducibility: not applicable. This PR refactors established inbound-turn behavior rather than reporting a separately reproducible product bug. The relevant verification is observing unchanged channel delivery and lifecycle behavior on the final head.

Review metrics: none identified.

Merge readiness
Overall: 🦐 gold shrimp
Proof: 🦐 gold shrimp
Patch quality: 🐚 platinum hermit
Result: blocked until stronger real behavior proof is added.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • Attach redacted Telegram Desktop, live transcript, terminal, or runtime-log proof produced from bdb186f.
  • If relying on test-only proof, obtain an explicit responsible-owner override for the current head.

Proof guidance:

  • [P1] Needs stronger real behavior proof before merge: Mantis provides credible native Telegram delivery proof, but it targets an earlier candidate rather than the current head; add redacted final-head live proof or obtain an explicit responsible-owner override before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Mantis proof suggestion
A refreshed native Telegram Desktop proof would directly close the current-head evidence gap for a visible delivery lifecycle path. A maintainer can ask Mantis to capture proof by posting this exact PR comment:

@openclaw-mantis telegram desktop proof: verify on the current PR head that an inbound turn delivers its lifecycle-marker reply and completes normally.

Risk before merge

  • [P1] This changes session recording, dispatch finalization, durable delivery, and reply lifecycle ownership across multiple bundled channels; a regression could affect message delivery or session-state behavior despite the intended behavior-neutral scope.
  • [P1] The visible Telegram proof predates the current head, so the final branch lacks directly observed after-fix behavior evidence unless a maintainer explicitly accepts the test-only override for this exact head.

Maintainer options:

  1. Refresh proof on the final head (recommended)
    Run the existing Telegram Desktop scenario or an equivalent live channel flow against the current head and retain the focused regression suite as supplementary coverage.
  2. Accept the proof boundary explicitly
    A responsible owner can accept the earlier Mantis evidence plus exact-head tests as the evidence standard for this internal behavior-neutral refactor.
Copy recommended automerge instruction
@clawsweeper automerge

Special instructions:
After the proof is attached, verify it targets the current head and rerun the focused channel lifecycle regressions.

Next step before merge

  • [P1] The remaining blocker is a protected-label maintainer decision on acceptable final-head real-behavior evidence, not a narrow mechanical repair.

Maintainer decision needed

  • Question: Should this maintainer-labeled, cross-channel lifecycle refactor require refreshed final-head real channel proof, or is the existing earlier Telegram proof plus the provided exact-head regression suite an acceptable proof override?
  • Rationale: The answer sets the acceptable merge-evidence bar for behavior that crosses delivery and session lifecycle boundaries; the supplied author assertion is not an independently established maintainer approval for the current head.
  • Likely owner: steipete — This person authored the merged predecessor and the current core lifecycle follow-up, making them the strongest history-based routing candidate.
  • Options:
    • Require final-head Telegram proof (recommended): Capture a redacted Telegram Desktop or live transcript proof from bdb186f, then use focused regression and CI results as supporting evidence.
    • Accept a scoped test-only override: A responsible owner may explicitly accept the existing Mantis proof and exact-head lifecycle regressions as sufficient for this behavior-neutral refactor.

Security
Cleared: The supplied diff is a TypeScript lifecycle refactor and test/guard update; no concrete new dependency, workflow, secret, permission, artifact-execution, or supply-chain concern is evident.

Review details

Best possible solution:

Retain the core-owned turn-plan architecture, then obtain one redacted final-head Telegram/Desktop or equivalent live channel proof after the latest code change, or have a responsible maintainer explicitly accept the existing behavior-neutral test-only proof basis before merge.

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

Not applicable: this PR refactors established inbound-turn behavior rather than reporting a separately reproducible product bug. The relevant verification is observing unchanged channel delivery and lifecycle behavior on the final head.

Is this the best way to solve the issue?

Unclear: the core-owned plan boundary is consistent with the merged predecessor at #109716, but final-head real behavior evidence is still needed before calling this the best proven implementation path.

AGENTS.md: found and applied where relevant.

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

Label changes

Label changes:

  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • remove rating: 🦪 silver shellfish: Current PR rating is rating: 🦐 gold shrimp, so this older rating label is no longer current.

Label justifications:

  • P2: This is a substantial but intended behavior-neutral channel-lifecycle refactor with limited evidence of an active user regression.
  • merge-risk: 🚨 compatibility: The branch changes internal channel/Plugin SDK-adjacent dispatch ownership and removes retired runtime-facade exports across bundled plugins.
  • merge-risk: 🚨 message-delivery: Core now composes delivery, retry, durable-delivery, and final reply lifecycle callbacks for multiple message channels.
  • merge-risk: 🚨 session-state: Session recording, route bookkeeping, history finalization, and dispatch ordering move from adapters into the shared core lifecycle.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs stronger real behavior proof before merge: Mantis provides credible native Telegram delivery proof, but it targets an earlier candidate rather than the current head; add redacted final-head live proof or obtain an explicit responsible-owner override before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • proof: 🎥 video: Contributor real behavior proof includes video or recording evidence. Mantis provides credible native Telegram delivery proof, but it targets an earlier candidate rather than the current head; add redacted final-head live proof or obtain an explicit responsible-owner override before merge.
  • mantis: telegram-visible-proof: Mantis should capture Telegram visible proof. The refactor changes Telegram inbound reply delivery lifecycle behavior that can be directly demonstrated in a short Telegram Desktop recording.
Evidence reviewed

PR surface:

Source -44, Tests +214, Other +8. Total +178 across 63 files.

View PR surface stats
Area Files Added Removed Net
Source 32 1963 2007 -44
Tests 29 701 487 +214
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 2 9 1 +8
Total 63 2673 2495 +178

What I checked:

  • Core lifecycle ownership: The branch introduces core assembly and execution paths that resolve session storage, record inbound sessions, construct reply dispatch, and invoke the shared execution core from assembled channel turn plans. (src/channels/turn/lifecycle.ts, bdb186f6c8b7)
  • Cross-channel migration: The proposed changes replace caller-owned dispatch callbacks in bundled Telegram, WhatsApp, Signal, Matrix, Mattermost, iMessage, Feishu, Teams, and QQBot paths with transport delivery plans consumed by the core runner. (src/channels/turn/kernel.ts, bdb186f6c8b7)
  • Prior architecture provenance: The related merged PR established the same core-owned inbound orchestration direction; this PR is described as its follow-up rather than an unrelated competing design. (src/channels/turn/kernel.ts, 0e792b6de308)
  • Real behavior proof alignment: Mantis captured a native Telegram Desktop delivery result for candidate 876d819, but the current PR head is bdb186f; later Testbox and CI results are valuable supplemental checks but do not themselves show final-head real behavior. (extensions/telegram/src/bot-message-dispatch-turn.ts, bdb186f6c8b7)
  • Prior review finding addressed: The earlier observe-only visible-count issue was followed by commit 15a3817 and a regression in the core channel-turn tests; no remaining discrete patch defect is established from the supplied review evidence. (src/channels/turn/kernel.test.ts, 15a3817921bb)

Likely related people:

  • steipete: Authored the merged core inbound-orchestration PR and this follow-up’s core lifecycle, bundled-channel migration, and regression commits. (role: introduced and recently extended the inbound lifecycle refactor; confidence: high; commits: 0e792b6de308, bd26cf572471, 31a2d2b25f43; files: src/channels/turn/lifecycle.ts, src/channels/turn/execution.ts, src/channels/turn/kernel.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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.

How this review workflow works
  • 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.
Review history (9 earlier review cycles; latest 8 shown)
  • reviewed 2026-07-17T17:50:51.952Z sha 6e666dd :: needs real behavior proof before merge. :: [P1] Preserve the shipped onError timing contract
  • reviewed 2026-07-17T17:58:08.721Z sha 6e666dd :: needs maintainer review before merge. :: none
  • reviewed 2026-07-17T19:13:45.947Z sha 876d819 :: needs maintainer review before merge. :: none
  • reviewed 2026-07-17T20:16:27.737Z sha 7ccb05652bd185f9cf4ee19ba7a941591d6973ef :: needs real behavior proof before merge. :: none
  • reviewed 2026-07-17T20:39:29.375Z sha 1498e5b :: needs real behavior proof before merge. :: none
  • reviewed 2026-07-17T21:20:47.437Z sha 1498e5b :: needs real behavior proof before merge. :: none
  • reviewed 2026-07-17T23:17:09.401Z sha cbf468e :: needs real behavior proof before merge. :: none
  • reviewed 2026-07-17T23:33:39.494Z sha c715b1b21ced3211f8a9c4922d80737e613d33ac :: needs real behavior proof before merge. :: none

@steipete

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Maintainer proof override for final head 6e666dd75ac4852d72f742b09eb7ca844d6d42ce: I explicitly accept test-only coverage for this behavior-neutral ownership refactor.

The focused proof covers each changed lifecycle invariant: normal dispatch and delivery-plan execution; session record/finalize ordering; durable delivery and retry; asynchronous delivery-error cleanup; bot-loop and history finalization; Plugin SDK surface preservation; and observe-only turns returning zero visible counts without a visible dispatch signal. The final observe-only regression is in src/channels/turn/kernel.test.ts and passed 35/35 on the final patch together with the exact CI lint command (Testbox run). Earlier broad Testbox passes covered 161 focused core/channel tests, production and test types, SDK gates, the internal-deprecation ratchet, full formatting, lint, and build (full build/gates, expanded channel/type proof). Fresh autoreview on the final correction reported no accepted or actionable findings.

The prior observe-only concern is fixed, regression-covered, replied to, and resolved. Exact-head hosted CI remains the merge gate.

@clawsweeper

clawsweeper Bot commented Jul 17, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@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. mantis: telegram-visible-proof Mantis should capture Telegram visible proof. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Jul 17, 2026
@clawsweeper
clawsweeper Bot temporarily deployed to qa-live-shared July 17, 2026 19:19 Inactive
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Jul 17, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bdb186f6c8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +357 to +360
const delivery =
admission.kind === "observeOnly"
? { deliver: async () => ({ visibleReplySent: false }) }
: resolved.delivery;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Mask observe-only mock dispatch counts

When admission.kind === "observeOnly", this mock only swaps in a no-op delivery adapter and then forwards the assembled dispatch result from the mock dispatcher, so plugin tests using runtime.channel.inbound.run can still see nonzero counts and treat an invisible observe-only turn as a visible reply. Fresh evidence: production now executes assembled observe-only turns but returns the canonical zero-count result, while the test runtime mock's assembled branch does not mirror that masking; this can hide regressions in finalize paths that call hasVisibleInboundReplyDispatch.

Useful? React with 👍 / 👎.

@steipete
steipete merged commit 601ffa2 into main Jul 17, 2026
134 of 136 checks passed
@steipete
steipete deleted the codex/channel-dispatch-core branch July 17, 2026 23:55
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

steipete added a commit that referenced this pull request Jul 18, 2026
* test(imessage): mock core turn dispatch for media policy coverage

PR #110095 missed this iMessage media-policy test file.

* test(imessage): mock core turn dispatch for last-route coverage

* test(whatsapp): mock core turn dispatch for broadcast coverage

* test(imessage): drop type-dead terminal-admission branch in media harness
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 18, 2026
…10095)

* refactor(channels): centralize turn execution lifecycle

* refactor(extensions): adopt core channel turn plans

* test(channels): ratchet modern dispatch ownership

* chore(channels): drop stale max-lines exemption

* fix(channels): allow async delivery error cleanup

* test(channels): await async delivery cleanup

* test(channels): await delivery error callbacks

* fix(channels): preserve delivery error contract

* fix(plugin-sdk): preserve channel inbound declarations

* test(channels): exercise core delivery plans

* fix(channels): await delivery error cleanup

* fix(channels): preserve async cleanup contract

* refactor(channels): trim dispatch boilerplate

* fix(channels): mask observe-only dispatch results

* refactor(channels): delete unused dispatch exports

* fix(msteams): preserve resolver config overrides

* refactor(channels): keep Teams turn config internal

* test(plugins): drop retired Teams runtime export guard
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 18, 2026
…0327)

* test(imessage): mock core turn dispatch for media policy coverage

PR openclaw#110095 missed this iMessage media-policy test file.

* test(imessage): mock core turn dispatch for last-route coverage

* test(whatsapp): mock core turn dispatch for broadcast coverage

* test(imessage): drop type-dead terminal-admission branch in media harness
YangManBOBO added a commit to YangManBOBO/openclaw that referenced this pull request Jul 18, 2026
Feishu DM 中意图静默的 NO_REPLY 会经 block 路径跳过,但 onSkip 原先只记录 final,导致误发“无可见内容”兜底。现将 silent 的 block skip 一并纳入状态,并补充直接回调与完整调度管线回归测试。

同时按 openclaw#110775 / openclaw#110095 对 msteams/slack 的同一模式,移除 feishu delivery-trace 中已失效的 createReplyDispatcherWithTyping 捕获缝,改为直接使用 createFeishuReplyDispatcher 返回的 dispatcherOptions/delivery,修复 main 上既有的金标失败并解除 ci-gate 阻塞。

Related: openclaw#109912
Closes: openclaw#110744
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: feishu Channel integration: feishu channel: imessage Channel integration: imessage channel: matrix Channel integration: matrix channel: mattermost Channel integration: mattermost channel: msteams Channel integration: msteams channel: qa-channel Channel integration: qa-channel channel: qqbot channel: signal Channel integration: signal channel: slack Channel integration: slack channel: telegram Channel integration: telegram channel: whatsapp-web Channel integration: whatsapp-web maintainer Maintainer-authored PR mantis: telegram-visible-proof Mantis should capture Telegram visible proof. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. P2 Normal backlog priority with limited blast radius. proof: 🎥 video Contributor real behavior proof includes video or recording evidence. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. scripts Repository scripts size: XL status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant