Repository navigation
feat: tune inbound batching without reconnecting channels - #138780
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review in progressClawSweeper is reviewing this revision. This supersedes any previous blocked status. |
|
Codex review: blocked before merge. Reviewed September 4, 2026, 11:08 PM ET / September 5, 2026, 03:08 UTC. ClawSweeper reviewWhat this changesThe PR lets nine channel plugins adopt inbound batching delays without reconnecting and makes shared-setting reload decisions independently for each plugin. Merge readiness⛔ Blocked before merge - 2 items remain The work remains distinct from current main and the merged acknowledgement change. The verified merge result resolves the prior planner-conflict concern; no introduced blocking correctness defect was found. Priority: P2 Review scores
Verification
How this fits togetherThe Gateway publishes committed configuration and decides which channel connections need refreshing. Channel receive handlers use batching delays to combine incoming messages before admitting agent turns. flowchart TD
A[Committed settings] --> B[Gateway reload planner]
B --> C{Plugin reads settings live?}
C -->|Yes| D[Keep connection]
C -->|No| E[Refresh channel runtime]
F[Incoming messages] --> G[Batch with effective delay]
D --> G
E --> G
G --> H[Agent turn admission]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +38, Tests +806, Docs +22. Total +866 across 41 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Retain the single batching engine and documented per-owner reload contract, preserving explicit timing overrides, pending deadlines, and conservative refresh for undeclared plugins. Do we have a high-confidence way to reproduce the issue? Not applicable as a new live-tuning capability. Current-main source establishes the existing reconnect behavior; this read-only review did not execute runtime tests. Is this the best way to solve the issue? Yes: explicit use of the existing timing callback and per-owner reload aggregation fit the current architecture. Making the shared helper automatically live would unnecessarily change its startup-snapshot contract. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 790fbf0304a6. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
7a1b3a2 to
f18961a
Compare
|
Merged via squash.
|
…38780) * feat(channels): hot reload inbound batching without reconnecting * test(whatsapp): include live policies in reload metadata expectation
* origin/main: fix(gateway): keep webhook ingress retryable during hot reload (openclaw#138627) fix: restore Gateway restarts after Git updates (openclaw#138781) fix(gateway): stop repeated teardown after WebSocket failures (openclaw#138818) fix(gateway): abort exact live runs when cancelling tasks (openclaw#118358) refactor(memory): share typed embedding-cache writes (openclaw#138827) fix(a2a): preserve tasks while reserving commands for users (openclaw#138731) feat: tune inbound batching without reconnecting channels (openclaw#138780)
Related: #138638, #138556
What Problem This Solves
Changing inbound batching currently reconnects channels to replace a captured delay. This lets Discord, Feishu, iMessage, Mattermost, Microsoft Teams, Signal, Slack, Telegram, and WhatsApp adopt committed
messages.inboundtiming while keeping their channel runtimes.Shared-policy planning also stops treating one plugin's no-op declaration as permission to skip another owner's refresh.
Why This Change Was Made
The nine adapters use the existing per-entry
resolveDebounceMscallback and bound runtime-config reader. The publiccreateChannelInboundDebouncerretains its numeric startup snapshot and snapshot timing by default. Explicit transport overrides remain fixed, and independently scoped configurations stay isolated from unrelated Gateway snapshots.The canonical policy catalog aggregates each channel's narrowest declaration independently. Undeclared channels retain conservative refresh behavior; narrower owner restart declarations and explicit global policies keep precedence. A synthesized no-channel-restart rule also preserves independently registered service interests. The service composition regression failed two cases before the fix; all 12 broad/equal/narrow, mixed/all-live, and explicit-global-noop cases now pass. The six previously verified acknowledgement consumers declare their live-read behavior through the same policy contract.
Redundant timing resolver wrappers and startup snapshots are removed. Production is +161/−123, net +38 lines; tests/support are +966/−160, net +806; docs are +30/−8, net +22. The production growth implements per-owner aggregation and explicit live-read opt-ins while preserving the shipped helper contract. No configuration keys, SDK fields, protocol fields, or persistent-store changes are added.
User Impact
Newly admitted work uses committed timing. A setting change alone does not reschedule an existing batch; later admitted messages can adjust its idle deadline within the original maximum deadline. Slack and WhatsApp carry one timing value into both pending-work bookkeeping and queue admission. Telegram's separate forwarded-message window, control-message bypass, shutdown, and explicitly deferred reply ownership keep their existing behavior.
Evidence
f18961af5c23built successfully in 223s; 614 distinct tests across 14 files/12 shards passed, including all 456 planner casesec335f132184updates one stale exact WhatsApp metadata assertion; its focused test and independent review passed. Every other file is byte-identical to the testedf18961af5c23ec335f132184; the corrected metadata assertion passed and the earlier tooling watchdog did not recurLinux Testbox run: provider
blacksmith-testbox, leasetbx_01m1qr50btf2xy785k0rf6hxq8, final command exit 0. Candidate/build commit isf18961af5c2337ccebc248d8d79ff9334e001e41; verified source tree is587c9496f05ab7eb8e35b72e83b66c22775520d4; final source carrier is2374b9ac5b7a9228fc56007ef92702645b286653. The driver suppliesGIT_COMMITbefore building and verifies the existing build when resuming; it never restamps an artifact.The first command passed its build and suites, then its external receipt parser missed ANSI-prefixed monitor records. The corrected continuation preserved that initial receipt, verified the same tree/build, and completed the remaining Gateway flows. Final
channel-debounce-receipt.tgz: 46,722 bytes, SHA-256902795e5de90734fd2bbc09843c0fd246db7e4e0d338830dcd87a1e531494da8.Compatibility Decision
Retain conservative per-owner refresh for undeclared plugins, as requested for this reload redesign. An individual plugin's live-read declaration must not leave another plugin running with a stale policy snapshot. Existing configuration remains valid and the public helper defaults remain unchanged. An undeclared plugin may refresh its own channel runtime on a shared-policy edit; the Gateway keeps running and manually stopped accounts stay stopped. This is the disposition for ClawSweeper's two compatibility before-merge items. No behavior is assumed for untested external-plugin combinations.
Known Follow-up and Proof Limits
Durable collector coalescing versus deferred reply ownership: WhatsApp's durable ingress uses the same retained-lane phase for collector buffering and an explicitly deferred reply, which can prevent another same-conversation message from reaching a pending collector. Mattermost has an analogous source-level risk. A captured original-order reproduction and an unconditional-release trial showed why that lifecycle needs its own repair: releasing the lane fixed batching but broke deferred-reply ordering. This PR preserves that contract and proves timing when work reaches the collector.
Linux proof uses synthetic providers and data. The five Gateway lanes run the real plugins and public config RPC; the other four exercise actual retained monitor/receive owners with real clocks and existing synthetic transport or reply-policy boundaries. They are distinct from full Gateway or authenticated vendor-account coverage.
The source-hash-checked, task-local Crabline 0.1.20 decoder fixture incorporates the four standard tokens already merged in crabline#294. Its exact patch and real Baileys encoder/decoder checks are captured in the artifact. Installed dependencies remain unchanged; no npm publication or real vendor-account coverage is claimed.