Repository navigation
refactor(auto-reply): deslop auto-reply and channels - #164547
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: blocked before merge. Reviewed October 3, 2026, 6:40 PM ET / 22:40 UTC (Revision 2). ClawSweeper reviewWhat this changesSimplifies automatic replies and shared channel helpers by removing unused controls, forwarding layers, and duplicate projections while retaining existing behavior. Merge readiness⛔ Blocked before merge - 1 item remains This useful cleanup remains distinct from current main, and no actionable introduced defect was found. The earlier migration blocker is unsupported: the refactor preserves persisted shapes and recovery transition guards. Priority: P3 Review scores
Verification
How this fits togetherAutomatic reply orchestration receives channel messages and commands, prepares agent execution, and coordinates reply delivery. Its queue and recovery owners preserve message custody across cancellation, retries, and restarts. flowchart TD
A[Incoming messages and commands] --> B[Command parsing and context]
B --> C[Reply admission and session checks]
C --> D[Agent execution and fallback]
D --> E[Reply delivery]
C --> F[Queue and recovery state]
F --> D
E --> G[Channel transport]
Before merge
Agent review detailsSecurityNone. PR surfaceSource -403, Tests -184, Other -1. Total -588 across 43 files. View PR surface stats
Review metricsNone. Stored data modelPersistent data-model change detected: Technical reviewBest possible solution: Keep command parsing, session persistence, admission, and terminal settlement with their canonical owners while removing redundant internal paths. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR proposes behavior-preserving cleanup and does not report a product defect to reproduce. Is this the best way to solve the issue? Yes: the inspected changes consolidate existing owners and remove unused internal controls without introducing a competing implementation or stored-data contract. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 67ab6f3104fd. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
Remove test-only runner controls, redundant command and dispatch forwarding, and duplicate channel context projections. Consolidate overflow summary execution and restart checkpoint updates while retaining their ownership and lifecycle checks. Preserve command parsing, reply text, transport behavior, persisted shapes, and the public plugin SDK. The second-pass coverage audit exhausted the available non-overlapping simplifications below the campaign size target.
9615e86 to
8f75e8c
Compare
Remove test-only runner controls, redundant command and dispatch forwarding, and duplicate channel context projections. Consolidate overflow summary execution and restart checkpoint updates while retaining their ownership and lifecycle checks. Preserve command parsing, reply text, transport behavior, persisted shapes, and the public plugin SDK. The second-pass coverage audit exhausted the available non-overlapping simplifications below the campaign size target. Land with the maintainer-authorized inherited CI exception: Copilot tool-bridge fixtures fail identically in unrelated run 37157050744; all task-related checks pass in run 37158827995.
Brings the branch onto current main; GitHub reported it CONFLICTING. inbound-meta.ts conflicted because main rewrote the helpers this branch had moved out of it: openclaw#157000, openclaw#161129, openclaw#164547 and openclaw#166085 trimmed the file, openclaw#158028 dropped its max-lines suppression, and openclaw#167236 merged the transcript sanitizers into sanitizeTranscriptText. The split is re-applied on main's code rather than on the branch's older copies: - inbound-meta.text.ts holds main's normalizePromptMetadataString, normalizePromptMetadataStringArray, sanitizePromptBody, truncateBodyHeadTail and sanitizeTranscriptText, moved verbatim. - inbound-meta.current-message.ts builds both projections with sanitizeTranscriptText(..., "body") in place of the branch's sanitizeTranscriptBody; the inline projection keeps main's bare header. - inbound-meta.ts is main's file minus the moved helpers. - config/max-lines-baseline.txt takes main's side, which already dropped the inbound-meta.ts entry. The carrier projection stays in its own module: get-reply-run.media-only.test.ts and followup-turn-admission.test.ts mock ./inbound-meta.js with closed factories, and prompt-prelude.ts must not import the projection through them.
What Problem This Solves
Auto-reply and channel orchestration still had forwarding layers, duplicate projections and test-only runtime options after the previous cleanup pass.
User Impact
No intended user-visible change: command parsing, reply text, delivery ordering, persisted data, configuration and the public plugin SDK remain unchanged. Channels retain transport responsibilities.
Why This Change Was Made
This second-pass batch removes 403 net production lines, 184 net test/support lines, and one retired tooling-list entry. It is BELOW-1000 after completing the file coverage audit; the remaining large owners retain concrete lifecycle, authority, prompt-byte or public SDK contracts.
The simplifications are:
No independently verified bug was found along the way. The timing cleanup was excluded because its required shared assertion-baseline update overlaps other open campaign PRs.
Evidence
cbx_a737e62fe8c6: 43 focused files, 1,281 tests passed. Project timings: unit 5.48s, infra 210.89s, auto-reply 31.41s, CLI support 6.02s, channels 9.55s. Existing storage-backed integration suites retain their durable-state and lifecycle coverage; no new long-running tests were added.Post-CI correction and integration: the branch includes the existing main maintenance-fixture fix and a one-variable lint rename.
git range-diffconfirms the rebase preserved both patches. Both cycle checks remained zero; six tool-metadata tests and the targeted lint check passed. A local maintenance recheck under the overloaded host hit 60-second timeouts and follow-on retired-session/fixture failures; it is recorded as failed, not passing evidence. Exact-head hosted CI subsequently cleared the two previously failing memory transcript cases.Final hosted evidence: CI run 37158827995 on exact head
8f75e8ce13e0f6bca84e5436c8642c640b90ae39completed with 64 successful jobs, 22 skips, and one inherited failing leaf job (checks-node-changed-extensions-bundle-12; Copilot cases below), plus the aggregate CI gate. The two memory transcript cases pass in job 111307981177; core production types, lint, UI E2E and security-fast pass. Security Review 37159339918 reports no dependency changes requiring review and no sensitive product changes; its combined gate is red solely because CI is red. The maintainer-authorized inherited-failure exception applies only to the independently reproduced Copilot failure, with the merge pinned to this exact head.Inherited CI evidence from the first head:
ui/src/e2e/board-mcp-app.e2e.test.ts, “retains one board runtime across split, expanded, and inactive panel states,” expects bottom/body-height gap 0 and receives 602. Identical failure on main run 37150519938, UI job 111283444404. This PR changes no UI or dashboard code.tools[0]as the requested tool (includingprovide query or queries, missingweb_fetch/exclusive, and the ordering timeout). The same cases fail on unrelated current run 37157050744, job 111302737203, head79ac6d84b3b8aad1b649bcdb5e672600fec4e8b2. Its changed files do not include the Copilot fixtures or tool-search/surface owners. Those owners are also unchanged by this PR; isolated Copilot forks inject their own tool constructor and do not import the changed auto-reply fixtures.fd4131f3b26d912c7a91409053f268d53cec43de; this branch integrates that fix. The one PR-owned lint failure was corrected by renaming the shadowing callback parameter.The coverage log below records the examined production files over 200 lines at baseline
ee9127b79e98bc5b07ae7e61f7ce3611d620140c; the trace harness is included conservatively as test support.Complete largest-first coverage log
Baseline
ee9127b79e98bc5b07ae7e61f7ce3611d620140c. Production files over 200 lines insrc/auto-replyandsrc/channels, largest first; tests, fixtures and generated assets excluded. The trace harness is included conservatively as test support.src/auto-reply/reply/export-html/template.jssrc/auto-reply/reply/agent-runner-memory.tssrc/channels/streaming.tssrc/auto-reply/reply/queue/drain.tssrc/auto-reply/reply/get-reply.tssrc/auto-reply/reply/session.tssrc/auto-reply/reply/export-html/template.csssrc/channels/plugins/types.core.tssrc/channels/plugins/setup-wizard-helpers.tssrc/auto-reply/reply/dispatch-acp.tssrc/auto-reply/reply/reply-dispatcher.tssrc/channels/message/ingress-monitor.tssrc/channels/message/ingress-drain.tssrc/channels/plugins/message-action-dispatch.tssrc/auto-reply/reply/dispatch-acp-delivery.tssrc/auto-reply/reply/reply-run-registry.state.tssrc/channels/progress-draft-compositor.tssrc/auto-reply/reply/reply-turn-admission.tssrc/auto-reply/reply/inbound-meta.tssrc/auto-reply/reply/directive-handling.impl.tssrc/channels/turn/lifecycle.tssrc/auto-reply/reply/agent-runner-result-payloads.tssrc/channels/message/ingress-queue.kernel.tssrc/channels/plugins/types.adapters.tssrc/auto-reply/reply/dispatch-from-config.choose-route.tssrc/channels/plugins/read-only.tssrc/auto-reply/reply/agent-runner-run.tssrc/auto-reply/reply/get-reply-run-execute.tssrc/auto-reply/reply/get-reply-run-admission.tssrc/auto-reply/reply/dispatch-from-config.lifecycle.tssrc/channels/plugins/setup-wizard.tssrc/auto-reply/command-auth.tssrc/auto-reply/reply/get-reply-inline-actions.tssrc/auto-reply/reply/reply-run-registry.operation.tssrc/auto-reply/reply/agent-runner-execution.tssrc/auto-reply/reply/model-selection.tssrc/channels/message-access/admission-evidence.tssrc/auto-reply/commands-registry.shared.tssrc/auto-reply/reply/followup-delivery.tssrc/auto-reply/reply/dispatch-from-config.gather.tssrc/auto-reply/reply/reply-run-registry.registry.tssrc/channels/message/live.tssrc/channels/inbound-event/context.tssrc/auto-reply/reply/get-reply-directives-apply.tssrc/auto-reply/reply/get-reply-directives.tssrc/auto-reply/reply/dispatch-from-config.finalize.tssrc/auto-reply/reply/restart-recovery-claim.tssrc/auto-reply/reply/agent-runner-failure-reply.tssrc/auto-reply/templating.tssrc/auto-reply/reply/reply-run-registry.message-injection.tssrc/auto-reply/reply-payload.tssrc/auto-reply/reply/commands-allowlist.tssrc/auto-reply/reply/agent-runner-cli-dispatch.tssrc/auto-reply/reply/reply-media-paths.tssrc/auto-reply/reply/agent-runner-cli-candidate.tssrc/channels/plugins/outbound/presentation-limits.tssrc/channels/message-access/runtime.tssrc/auto-reply/reply/commands-session.tssrc/auto-reply/reply/dispatch-from-config.execute.tssrc/auto-reply/reply/commands-diagnostics.tssrc/auto-reply/reply/commands-acp/lifecycle.tssrc/auto-reply/reply/dispatch-from-config.prepare-context.tssrc/channels/message/ingress-queue.tssrc/auto-reply/reply/get-reply-run-context.tssrc/auto-reply/reply/agent-runner-core.tssrc/auto-reply/reply/commands-tts.tssrc/auto-reply/reply/commands-models-catalog.tssrc/channels/plugins/bundled.tssrc/auto-reply/reply/stage-sandbox-media.tssrc/auto-reply/chunk.tssrc/auto-reply/reply/followup-turn-admission.tssrc/channels/message/send.tssrc/auto-reply/reply/block-reply-pipeline.tssrc/auto-reply/reply/agent-runner-result-accounting.tssrc/auto-reply/reply/agent-runner-execute.tssrc/auto-reply/dispatch.tssrc/channels/message-access/state.tssrc/auto-reply/reply/commands-context-report.tssrc/auto-reply/reply/reply-run-registry.contracts.tssrc/auto-reply/reply/route-reply.tssrc/auto-reply/reply/commands-compact.tssrc/auto-reply/thinking.tssrc/auto-reply/reply/followup-turn-execution.tssrc/channels/turn/types.tssrc/auto-reply/commands-registry.tssrc/auto-reply/reply/context-treemap.tssrc/auto-reply/reply/agent-runner-payloads.tssrc/channels/message/types.tssrc/channels/plugins/catalog.tssrc/auto-reply/inbound-debounce.tssrc/auto-reply/reply/mentions.tssrc/auto-reply/reply/progress-narrator.tssrc/auto-reply/reply/commands-acp/shared.tssrc/auto-reply/reply/get-reply-native-slash-fast-path.tssrc/auto-reply/reply/reply-tool-authority.tssrc/auto-reply/reply/commands-models.tssrc/channels/status-reactions.tssrc/auto-reply/get-reply-options.types.tssrc/auto-reply/reply/agent-runner-utils.tssrc/channels/plugins/message-action-discovery.tssrc/auto-reply/reply/agent-runner-trace.tssrc/auto-reply/reply/dispatch-from-config.prepare-operation.tssrc/auto-reply/reply/queue/enqueue.tssrc/auto-reply/reply/acp-projector.tssrc/channels/conversation-resolution.tssrc/auto-reply/reply/abort-operation.tssrc/channels/plugins/setup-helpers.tssrc/channels/plugins/setup-wizard-types.tssrc/auto-reply/reply/commands-login.tssrc/channels/message-access/runtime-types.tssrc/auto-reply/reply/agent-runner-embedded-candidate.tssrc/channels/message-access/types.tssrc/auto-reply/reply/directive-handling.shared.tssrc/channels/plugins/group-policy-warnings.tssrc/channels/message-access/decision.tssrc/channels/message-access/admission-evidence-scope-key.tssrc/auto-reply/reply/bash-command.tssrc/auto-reply/reply/agent-runner-fallback-candidate.tssrc/auto-reply/reply/dispatch-from-config.prepare-execution.tssrc/auto-reply/reply/session-updates.tssrc/auto-reply/group-thread-dispatch.tssrc/auto-reply/reply/model-selection-directive.tssrc/auto-reply/reply/queue/delivery-context.tssrc/channels/turn/execution.tssrc/auto-reply/reply/commands-plugins.tssrc/channels/draft-stream-controls.tssrc/auto-reply/reply/followup-runner.tssrc/channels/plugins/binding-routing.tssrc/channels/plugins/contracts/trace/delivery-trace.tssrc/auto-reply/reply/dispatch-from-config.prepare-delivery.tssrc/auto-reply/reply/history.tssrc/auto-reply/reply/commands-system-prompt.tssrc/channels/plugins/config-schema.tssrc/auto-reply/reply/reply-payloads-dedupe.tssrc/auto-reply/reply/queue/types.tssrc/auto-reply/reply/queue/state.tssrc/auto-reply/reply/commands-export-session.tssrc/auto-reply/reply/directive-handling.model.tssrc/auto-reply/heartbeat-filter.tssrc/auto-reply/reply/commands-approve.tssrc/channels/turn/durable-delivery.tssrc/auto-reply/reply/agent-runner-steer-adoption.tssrc/auto-reply/reply/session-reset-command.tssrc/channels/plugins/setup-contract.tssrc/auto-reply/tokens.tssrc/channels/plugins/message-action-current-conversation.tssrc/channels/plugins/package-state-probes.tssrc/channels/plugins/dm-access.tssrc/auto-reply/reply/startup-context.tssrc/auto-reply/reply/agent-runner-error-handler.tssrc/channels/turn/run-channel-turn.tssrc/auto-reply/reply/commands-acp/runtime-options.tssrc/channels/plugins/config-helpers.tssrc/auto-reply/reply/agent-runner-result-complete.tssrc/auto-reply/usage-bar/translator.tssrc/auto-reply/reply/agent-runner-event-handler.tssrc/auto-reply/reply/commands-info.tssrc/auto-reply/reply/dispatch-from-config.block-reply.tssrc/channels/account-snapshot-fields.tssrc/channels/message-access/runtime-identity.tssrc/channels/plugins/session-conversation.tssrc/channels/plugins/chat-target-prefixes.tssrc/auto-reply/reply/reply-delivery.tssrc/channels/direct-dm.tssrc/channels/message/ingress-queue.types.tssrc/auto-reply/reply/model-runtime-normalization.tssrc/auto-reply/reply/conversation-turn-capture.tssrc/auto-reply/reply/commands-private-route.tssrc/auto-reply/reply/prompt-prelude.tssrc/auto-reply/reply/dispatch-from-config.harness-defaults.tssrc/channels/plugins/account-config-mutation.tssrc/channels/message/ingress-queue.migration.tssrc/channels/plugins/outbound.types.tssrc/auto-reply/reply/strip-inbound-meta.tssrc/auto-reply/reply/commands-acp/diagnostics.tssrc/channels/progress-draft-status-text.tssrc/auto-reply/reply/dispatch-from-config.audit.tssrc/auto-reply/reply/typing.tssrc/auto-reply/reply/queue/cleanup.tssrc/auto-reply/envelope.tssrc/auto-reply/reply/conversation-label-generator.tssrc/auto-reply/reply/commands-goal.tssrc/auto-reply/reply/dispatch-from-config.context.tssrc/auto-reply/reply/dispatch-acp-payload.tssrc/channels/plugins/directory-config-helpers.tssrc/auto-reply/reply/get-reply-fast-path.tssrc/auto-reply/reply/reply-threading.tssrc/auto-reply/reply/session-usage.tssrc/auto-reply/reply/reply-run-registry.tool-authority.tssrc/auto-reply/reply/dispatch-from-config.payloads.tssrc/channels/message/ingress-claim-owner.tssrc/channels/join-intro/report-channel-room-join.tssrc/auto-reply/reply/reply-elevated.tssrc/auto-reply/reply/inbound-context.tssrc/auto-reply/reply/block-reply-coalescer.tssrc/channels/inbound-event/session-transcript-context.runtime.tssrc/auto-reply/group-thread.tssrc/auto-reply/reply/directive-handling.model-selection.tssrc/auto-reply/reply/get-reply-directives-routing.tssrc/channels/status/account-state.tssrc/auto-reply/usage-bar/template.tssrc/auto-reply/reply/source-reply-delivery-mode.tssrc/auto-reply/heartbeat.tssrc/channels/conversation-binding-route-facts.tssrc/channels/message/outbound-bridge.tssrc/auto-reply/reply/commands-reset.tssrc/auto-reply/reply/session-reset-model.tssrc/auto-reply/reply/post-compaction-context.tssrc/auto-reply/commands-registry-normalize.tssrc/auto-reply/command-status-builders.tssrc/channels/plugins/account-helpers.tssrc/auto-reply/reply/memory-flush-prepare.tssrc/auto-reply/reply/commands-config.tssrc/auto-reply/reply/get-reply-run-helpers.tssrc/auto-reply/reply/block-streaming.tssrc/auto-reply/fallback-state.ts