Repository navigation
refactor(auto-reply): deslop auto-reply - #156377
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. |
90da20b to
1a52f45
Compare
|
Codex review: needs real behavior proof before merge. Reviewed September 23, 2026, 8:07 AM ET / 12:07 UTC (Revision 4). ClawSweeper reviewWhat this changesSimplifies automatic replies and channel helpers by removing unreachable session-reset machinery, consolidating existing logic and types, and updating associated tests. Merge readiness⛔ Blocked before merge - 1 item remains Keep open: the cleanup remains useful, and no blocking introduced defect was found. Verified repository-admin authorship makes the external-contributor proof gate inapplicable. Priority: P3 Review scores
Verification
How this fits togetherAutomatic replies turn incoming messages and commands into agent runs and channel responses. These helpers coordinate session state, command authorization, reply presentation, and channel configuration. flowchart TD
A[Incoming messages and commands] --> B[Command matching and authorization]
B --> C[Agent execution and failure handling]
D[Session state and channel configuration] --> C
C --> E[Reply presentation]
E --> F[Channel delivery]
Before merge
Agent review detailsSecurityNone. PR surfaceSource -995, Tests -783, Other -6. Total -1784 across 79 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep automatic replies on their existing execution, session, and channel owners while removing unreachable paths and duplicated projections. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR proposes behavior-preserving cleanup rather than a new bug fix; source inspection confirms the redundant paths. Is this the best way to solve the issue? Yes: consolidation uses existing owners, removes unreachable machinery, and retains observable-contract coverage without introducing a competing implementation. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against cfb58027051f. 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 (3 earlier review cycles)
|
626b1b0 to
b1de036
Compare
b1de036 to
710e3d5
Compare
|
Merged via squash.
|
* refactor(auto-reply): deslop auto-reply * refactor(auto-reply): decouple command metadata input type
What Problem This Solves
Auto-reply and channel code still carries retired session-reset machinery and repeats command, delivery, setup, and type-contract logic that already has an owner.
User Impact
No intended behavior change. Command output, channel routing and delivery, credential prompts, public SDK exports, configuration, and persisted state retain their existing contracts.
Why This Change Was Made
The E2E proof also exposed a fixture mismatch: two OpenAI test models implicitly selected a native runtime, while the harness only supplies the embedded runner. Those fixtures now explicitly select
openclaw; native slash-command ingress, model/account persistence, and all assertions remain intact. No test cases were added for this repair.Evidence
Observed after-change behavior from the completed runtime checks:
getReplyFromConfigupdate the target session, create no phantom slash session, and the next ordinary turn uses the selected model/account. The three-file E2E replay passed all 243 cases.executeAgentTurnreturns the canonical final error while preserving the run session ID and the complete stored row, including its lifecycle revision. This exercises the surviving executor after the reset helper was removed.The model and channel-network boundaries were mocked; runtime dispatch, session-store access, and reply/configuration projections were exercised. These are integration and boundary observations, not live-provider claims.
node scripts/check-changed.mjs --base 06bb025f03b09e4ad2b1010ff73506e4d11bc46a— passed (2,612.03 s), including selected production/test typechecks, lint, formatting, and structural guards.node scripts/check-changed.mjs -- test/helpers/auto-reply/trigger-handling-test-harness.ts— passed after the fixture repair (259.85 s).node scripts/run-vitest.mjs <focused and cross-shard paths>and scopednode --import ./scripts/tsx.mjs scripts/test-projects.mts <extension paths>— all 241 selected files passed, including 17 extension consumers. Selection traced changed-module imports across auto-reply, channels, agents, Gateway, infra, config, SDK, plugins, tooling, and E2E; extension files ran through their project owners.node scripts/run-vitest.mjs src/agents/model-fallback.reply-entry.e2e.test.ts src/auto-reply/reply.triggers.trigger-handling.e2e.test.ts src/auto-reply/reply/agent-runner.runreplyagent.e2e.test.ts— 243/243 passed after the fixture repair.pnpm plugin-sdk:surface:check,pnpm plugin-sdk:check-exports, andnode scripts/run-vitest.mjs test/scripts/plugin-sdk-surface-report.test.ts— passed.pnpm build— passed initially (318.30 s) and again after the type-cycle repair (9m 16.7s build phases).node scripts/check-changed.mjs --base origin/deslop/10-auto-reply-sweep-20260922— passed for the incremental repair through the configured Testbox runner (the remote base resolved to56cc223dc7c25ec549ab4a1ff3ae886667052090for that run).pnpm check:architecture— passed after the CI repair, including zero runtime and Madge cycles.node scripts/run-vitest.mjsover dispatch, inline actions, fast path, name, goal, login, continuation settlement, and Gateway directive-tag suites — 8 files / 452 tests passed in 697.14 s.git diff --check— passed. Final rebase ontob4111411166741032e32f362b4f765c9dfafff64was conflict-free; the combined pre/post rebase patch IDs match. Upstream authority forwarding remains intact.Proof ran on frozen candidate snapshots using Blacksmith Testbox. The full changed gate and first 32 groups used
tbx_01m36ed4kpdwsg5gapgyyd8tpn(run); repaired E2E, fixture checks, remaining consumers, and build usedtbx_01m36mxs2k7s34g32xzg9fgtqk(run), wrapper exit 0. Both leases stopped. The incremental repair changed gate usedtbx_01m36rnnkgksbgt5zeq8vrqm59(run); its rebuilt candidate usedtbx_01m36t87m0g106af1s063g5yjr(run). Both also completed with wrapper exit 0 and stopped. The linked hydration runs can display cancellation after the delegated lease lifecycle finishes; the wrapper and command results above own this proof.Exact-head CI run 35855036597 passed on
710e3d5edea0e5abadde9381daf0ce481a31c7c8, includingopenclaw/ci-gate. Hosted job wall times include 202 s for architecture, 296 s for dependency checks, and 403/481/644 s for the previously failing shared test jobs; those include preparation and unchanged sibling tests.CI found a type-only cycle in the cleanup; the metadata helper now takes its exact four-field input without importing the higher-level command-handler context. Unrelated main failures were resolved by rebasing over the workflow entrypoint/native SwiftLint fixes (
54a9d03dcf0,d9a3356e19e), the UI pane-identity fixture repair (91ee6aa3de1), and complete lint/workflow fixtures (ceb109668b4). This PR changes none of those upstream UI or CI fixtures, and its combined patch ID remained unchanged across the rebases.Production measurement command:
That filter reports 1,028 net lines removed. Strict classification is 995 production-source lines plus 1 production-tooling line removed, separately from 783 test/support lines and 5 ratchet lines. The requested glob also includes some test-support files and the ratchet, so this remains a below-1,000 production cleanup under strict accounting.
The work-order command
pnpm plugin-sdk:api:checkis absent from current main. The current SDK surface and export-registration checks are used alongside the SDK surface-report test. No SDK export or public barrel was removed.Changed-test cost
Measured on the Testbox with
pnpm test <file> --maxWorkers=1(wall seconds):src/auto-reply/reply.directive.parse.test.tssrc/auto-reply/reply/commands-acp/shared.test.tssrc/auto-reply/reply/agent-runner-context-recovery.test.tssrc/auto-reply/reply/agent-runner-execution-conversation-failures.test.tssrc/auto-reply/reply/agent-runner-direct-runtime-config.test.tssrc/auto-reply/reply/session-updates.test.tssrc/channels/channel-config.test.tssrc/auto-reply/reply/mcp-channel-actions.test.tssrc/auto-reply/reply.triggers.trigger-handling.e2e.test.tsThe files above 30 seconds exercise the existing executor, persisted preflight/session boundaries, and native slash-command model selection. The new assertions reuse their fixtures; the wall measurements include worker preparation and imports. The trigger-file measurement reused prepared E2E bundles; the original three-file E2E replay passed 243 cases in 519.49 seconds including cold bundle preparation. The retired reset-only suite and its production test seam are removed.