Repository navigation
refactor(auto-reply): deslop auto-reply third pass - #158598
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 September 26, 2026, 7:10 AM ET / 11:10 UTC (Revision 6). ClawSweeper reviewWhat this changesConsolidates auto-reply command parsing, reply delivery and run helpers, and standalone HTML transcript rendering while removing redundant code and types. Merge readiness⛔ Blocked before merge - 2 items remain Keep open. Current main still uses code this branch consolidates, and the two earlier merged cleanup passes do not cover its remaining work. The reviewed changes show no concrete blocking defect. Priority: P3 Review scores
Verification
How this fits togetherAuto-reply receives channel or Gateway messages, resolves commands and session settings, runs an agent, and delivers replies. Stored conversations can also be rendered as standalone HTML transcripts. flowchart LR
A[Incoming message] --> B{Command or agent turn}
B --> C[Session and model selection]
C --> D[Agent run]
D --> E[Reply delivery]
D --> F[Session transcript]
F --> G[HTML export]
Before merge
Agent review detailsSecurityNone. PR surfacePR surface statistics unavailable: the file list is incomplete. Review metricsNone. Stored data modelPersistent data-model change detected: Technical reviewBest possible solution: Keep one owner for each command, reply lifecycle, and transcript transformation while preserving existing authorization and delivery behavior. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR proposes a behavior-preserving cleanup rather than reporting a reproducible bug. Is this the best way to solve the issue? Yes. Consolidating the existing owners is a maintainable path, and the reviewed changes retain the relevant command, lifecycle, and rendering contracts. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 443a0676b929. 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 (5 earlier review cycles)
|
3b7c1af to
86db22f
Compare
|
The three remaining review checklist items are resolved on
The PR body now includes the final proof, changed-test timings, review disposition, and stopped-lease records. No code or security finding remains accepted. |
86db22f to
1ad6461
Compare
1ad6461 to
d39d327
Compare
isPathLike tested `^~?(\/[^\s]+)+$`. `[^\s]` also matches `/`, so the repeated group can split a value at every `/`. A value with a space must fail, and V8 tries every split first. openclaw#158598 dropped the earlier `value.includes(" ")` guard, so an exec command, Grep pattern or MCP query such as `/a/.../a/notes file.txt --help` now reaches the regex. 26 components hold the event loop for 5.8 s and 28 components for 152 s. `^~?\/\S+$` accepts the same strings in linear time.
What Problem This Solves
This maintainer-requested third pass removes repeated command dispatch, type declarations, and forwarding logic that remain in auto-reply after #156377 and #157000.
User Impact
No intended user-visible change. Reply/dispatch ordering and delivery semantics, command/directive recognition, typing/streaming/chunking, heartbeat and queue behavior, prompt/context bytes, session/transcript writes, and config keys are preserved. No migration is required. A paginated GitHub inventory confirms all 105 changed paths: no SQL schema, protocol schema, config type/schema, or migration files change. The only
config/change is the shrink-only assertion baseline; internal helper/type changes do not alter stored session or transcript shapes.Why This Change Was Made
The pass removes 1,250 net production lines, plus 27 test/support lines without removing assertions. The assertion baseline shrinks by exactly five assertions across three touched files.
The coverage pass read the production subtree, including all 157 production files above 200 lines. Distinct direct/follow-up pipelines, lazy runtime facades, and public/private option projections remain where they carry a contract.
Landing status
Rebase round 2 includes
f2532a051f7(fix(codex): use public SDK error helpers) on base1dbbf6ce6380b8c562bb8a6f27e04083f3b7648a. Candidate head:d39d327515db9b99013a3a87646e1dc5fcb83ce8, treef542f54f0170f54573ad08f109dd5369151ed7bd. The rebase completed without conflicts, andgit range-diffreports the entire patch identical to1ad64610c54d59f93ef0a5456fad54976f3ebc7d. Kept: all reviewed changes. Dropped: none. No production or test changes were made during this rebase.The prior required-CI failure in
fs-safe-import-boundary.test.ts:317was reproduced on both the previous head and its clean base. It came from three Codex direct imports introduced by #158613; the owner fix now uses public SDK helpers. Fresh Testbox verification and current-head CI are tracked below. The coordinator owns re-arming or pin-merging after the new head's required CI gate passes.GitHub confirms the published head
d39d327515db9b99013a3a87646e1dc5fcb83ce8. Its exact-head CI run is pending at handoff; no earlier-head CI result is counted as proof for this head.Current verification uses Blacksmith Testbox
tbx_01m3ejygsxtejhqfpwkxh11een(hosting run). After frozen installation,node scripts/run-vitest.mjspassed 146 tests across four files and three shards in 49.65s:fs-safe-import-boundary,directive-handling.model,model-selection-directive, andget-reply-directives-apply. The previously failing boundary suite passes all 23 tests unmodified. Source SHA and full Git tree were verified before execution.The affected
node scripts/check-changed.mjs --timed --base 1dbbf6ce6380b8c562bb8a6f27e04083f3b7648a -- src/auto-reply/reply/directive-handling.model.test.ts config/assertion-safety-baseline.txtpassed in 1,303.22s, including all 25 core-test type graphs, zero-entry script/production/full-tree dead-export scans, lint, formatting, and guards.pnpm buildpassed in 433.56s, including package/runtime compilation, declarations, SDK export verification, and UI build. Both tracked-file diff checks stayed clean. The loaded Mac stalled the wrapper during local source staging, so proof used the documented installed-CLI fallback on the same Blacksmith lease, with the exact candidate delivered by Git bundle and checked in an isolated remote worktree. The changed-check router first found no nested backend and continued inside that same Testbox; no tests, checks, or builds ran on the Mac.The lease was confirmed stopped after verification. The coordinator-armed request was retired before the force-with-lease push; this lane did not re-arm it.
Evidence
Landing rebase (round 1): head
1ad64610c54d59f93ef0a5456fad54976f3ebc7dis based on5132886f78e3bf63cdbcfa43e8be304faf9c6ae7. Main's test cleanup in #158663 deleted three numeric-profile cases also touched here. The conflict resolution retains main's deletions and all remaining test assertions. Kept: every production simplification and the unused-input cleanup in retained cases. Dropped: four now-obsolete input-removal lines in those three deleted cases.git range-diffshows no other patch change; the production reduction remains 1,250 lines. The assertion baseline merged mechanically with main's reductions.Rebase proof on Blacksmith Testbox
tbx_01m3eamc2gbs6mt0tj1g4rw41d(hosting run): the wrapper verified source1ad64610c54d59f93ef0a5456fad54976f3ebc7dand treee4396c5aa2aa9bf2d9af811f0b344d5a5e7a852a; frozen install and 123 tests across the model-selection, directive-handling, and directive-application files passed in two shards (42.43s).Previously verified head
86db22f286875c5f743045c00db5cec7a73232d0rebased the verified change onto37259b7cab6b1816211d381200848048a05f197d. The sole conflict retained main's new compaction-probe import and repair (#154868). Git comparison confirms identical added/removed refactor lines. That head's CI passed: 159 successful jobs, 20 workflow skips, and a successfulopenclaw/ci-gate. The rebased head also passed 447 tests in 10 registry/probe/admission files (97.14s) and a freshpnpm build(531.51s), with no tracked-file drift.All heavy checks ran on Linux Blacksmith Testbox. Commit
3b7c1af66d23914f91c707c118383906dc5f5b28has the verified candidate treefd2f64ada04e93d0016765c19a74e1c14c71301a, based on18d218fa61ff917636ae57eb93d84042cff6196a.node scripts/check-changed.mjs --base 18d218fa61ff917636ae57eb93d84042cff6196apassed in 1,897.78s: production types, all 25 test type graphs, full lint, zero-entry dead-export scans, formatting, and guards.pnpm buildpassed in 514.52s, including package/runtime compilation, declarations, SDK exports, and UI build. The tracked-file check stayed clean.node scripts/run-vitest.mjs --config test/vitest/vitest.auto-reply.config.ts: 268 files / 6,051 tests passed, with one existing skipped file and two existing skipped cases; 272.56s wall time.Independent Codex review completed at P0–P2. Its sole finding claimed that removing an idle-flush guard enabled immediate ACP flushing for zero intervals. That finding was rejected: both base and candidate apply the unchanged
Math.max(..., 750)floor before the timer. A separate real-projector comparison with zero configured idle time passed on both revisions: no delivery at 749ms, delivery at 750ms. No accepted actionable findings remain.Changed-test cost on Linux Testbox
Measured with
pnpm test <file> --maxWorkers=1. These edits remove dead inputs and target retained assertions at their canonical owners; they add no cases, sleeps, polling, or Gateway boots. The CI column sums logged case durations on the exact green head and excludes shared import/worker setup. One model-suite case has a redacted duration, so that row is an observed lower bound. Log entries were read once and CRC-verified; duplicate aggregate copies were excluded.src/agents/session-maintenance/run.test.tssrc/auto-reply/reply/agent-runner-utils.test.tssrc/auto-reply/reply/directive-handling.model.test.tssrc/auto-reply/reply/get-reply-directives-apply.test.tssrc/auto-reply/reply/model-selection-directive.test.tssrc/auto-reply/reply/reply-payloads.test.tsRemote execution and recovery
Provider:
blacksmith-testbox. Each lease was used serially with frozen dependencies and explicit base/tree verification.tbx_01m3d8k3zya3pz2qw9wny1g0aetbx_01m3dfcf4tywc3gshn81zmnnr5check-changedand build passed. The subsequent runtime group was interrupted by lease shutdown and is excluded. Lease stopped.tbx_01m3dpwyt28bde3e7js2s5n7yjtbx_01m3dvgqqdf3kjk55q8kybve5dThe fresh Mac worktree had no dependencies, so the repository Crabbox wrapper could not bootstrap. Its documented installed-CLI fallback preserved the Blacksmith provider. Reused native syncs hit the CLI's fixed checksum deadline; recovery used the lease's SSH transport, transferring only the task patch and matching the full Git tree before execution. No tests, checks, or builds ran on the Mac.