Skip to content

refactor(auto-reply): deslop auto-reply third pass - #158598

Merged
steipete merged 1 commit into
mainfrom
deslop/l64-autoreply3
Sep 26, 2026
Merged

steipete merged 1 commit into
mainfrom
deslop/l64-autoreply3

Conversation

@steipete

@steipete steipete commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

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.

  • Derive ACP command recognition from its lazy handler registry, share identical whitespace-token parsing, and keep exec/queue parsing on the canonical token/span helpers.
  • Remove unused directive/model inputs and repeated model-menu, binding-status, approval, and abort reply construction.
  • Reuse canonical trace, command, cancellation, chunking, and option types; retire unused injection and forwarding seams.
  • Reuse shared deferred, numeric-normalization, record, and map-pruning helpers while retaining lifecycle and authority boundaries.
  • Simplify heartbeat span classification, reply threading, delivery suppression, and route-dedupe coverage without changing output or settlement.
  • Reuse one transcript-tree traversal and equivalent statistics/path rendering in the standalone HTML export; markup, CSS, and visible output stay unchanged.

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 base 1dbbf6ce6380b8c562bb8a6f27e04083f3b7648a. Candidate head: d39d327515db9b99013a3a87646e1dc5fcb83ce8, tree f542f54f0170f54573ad08f109dd5369151ed7bd. The rebase completed without conflicts, and git range-diff reports the entire patch identical to 1ad64610c54d59f93ef0a5456fad54976f3ebc7d. 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:317 was 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.mjs passed 146 tests across four files and three shards in 49.65s: fs-safe-import-boundary, directive-handling.model, model-selection-directive, and get-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.txt passed 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 build passed 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 1ad64610c54d59f93ef0a5456fad54976f3ebc7d is based on 5132886f78e3bf63cdbcfa43e8be304faf9c6ae7. 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-diff shows 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 source 1ad64610c54d59f93ef0a5456fad54976f3ebc7d and tree e4396c5aa2aa9bf2d9af811f0b344d5a5e7a852a; frozen install and 123 tests across the model-selection, directive-handling, and directive-application files passed in two shards (42.43s).

Previously verified head 86db22f286875c5f743045c00db5cec7a73232d0 rebased the verified change onto 37259b7cab6b1816211d381200848048a05f197d. 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 successful openclaw/ci-gate. The rebased head also passed 447 tests in 10 registry/probe/admission files (97.14s) and a fresh pnpm build (531.51s), with no tracked-file drift.

All heavy checks ran on Linux Blacksmith Testbox. Commit 3b7c1af66d23914f91c707c118383906dc5f5b28 has the verified candidate tree fd2f64ada04e93d0016765c19a74e1c14c71301a, based on 18d218fa61ff917636ae57eb93d84042cff6196a.

  • node scripts/check-changed.mjs --base 18d218fa61ff917636ae57eb93d84042cff6196a passed in 1,897.78s: production types, all 25 test type graphs, full lint, zero-entry dead-export scans, formatting, and guards.
  • pnpm build passed 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.
  • Five agent importer files: 115 tests passed, 23.31s wall time. The final focused registry/directive/ACP selection passed 189 tests in five files.
  • Earlier closed unit-fast, isolated, storage-heavy, and SDK groups passed 2,520 tests in 130 files. Those results precede the final type/lint corrections; the affected runtime paths were rerun in the final focused selection. Counts across these selections overlap.
  • Export HTML comparison: 442 exact DOM/download comparisons passed across 13 synthetic fixtures, two URL modes, filtering, search, navigation, and toggles.

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.

Test file Passed cases Testbox wall seconds CI case seconds
src/agents/session-maintenance/run.test.ts 1 10.12 0.003
src/auto-reply/reply/agent-runner-utils.test.ts 23 10.24 0.174
src/auto-reply/reply/directive-handling.model.test.ts 110 24.10 15.156+ (one redacted)
src/auto-reply/reply/get-reply-directives-apply.test.ts 11 9.48 1.134
src/auto-reply/reply/model-selection-directive.test.ts 14 10.55 0.012
src/auto-reply/reply/reply-payloads.test.ts 37, one existing skip 8.71 0.042
Remote execution and recovery

Provider: blacksmith-testbox. Each lease was used serially with frozen dependencies and explicit base/tree verification.

Lease / hosting workflow Observed result
tbx_01m3d8k3zya3pz2qw9wny1g0ae Install, 442 export comparisons, and the 130-file groups completed. Hosting cancellation interrupted the next group; that partial group is excluded. Lease confirmed stopped.
tbx_01m3dfcf4tywc3gshn81zmnnr5 Final complete check-changed and build passed. The subsequent runtime group was interrupted by lease shutdown and is excluded. Lease stopped.
tbx_01m3dpwyt28bde3e7js2s5n7yj Completed remaining runtime/importer tests, changed-test timings, and the two-revision idle-floor comparison. Lease stopped.
tbx_01m3dvgqqdf3kjk55q8kybve5d Rebased head: 447 tests in 10 files and complete build passed; tracked files remained clean. Lease stopped.

The 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.

@clawsweeper

clawsweeper Bot commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling size: XL labels Sep 26, 2026
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. 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. labels Sep 26, 2026
@clawsweeper

clawsweeper Bot commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 26, 2026, 7:10 AM ET / 11:10 UTC (Revision 6).

ClawSweeper review

What this changes

Consolidates 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
Reviewed head: d39d327515db9b99013a3a87646e1dc5fcb83ce8

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The cleanup is coherent and backed by substantial reported validation, with no concrete blocking finding from this review.
Proof confidence 🐚 platinum hermit (4/6) Not applicable: The Repository State classifies the author as MEMBER, so mandatory external-contributor proof does not apply to this internal cleanup. The PR body reports focused Testbox validation and HTML output comparisons; introduced paths show no stored-data contract change.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The Repository State classifies the author as MEMBER, so mandatory external-contributor proof does not apply to this internal cleanup. The PR body reports focused Testbox validation and HTML output comparisons; introduced paths show no stored-data contract change.
Evidence reviewed 8 items Pinned introduced change: The merge-base-to-head diff contains the auto-reply cleanup and a shrink-only assertion baseline change; the verified test merge retains those introduced paths.
ACP authorization preserved: The new action registry checks that an action exists before dispatch and retains the operator scope and owner checks for every action outside the three existing public actions.
Runtime settlement reviewed: The refactor keeps session-id rebinding, waiter registration, fallback failure settlement, and cleanup after backend cancellation.
Findings None None.
Security None None.

How this fits together

Auto-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]
Loading

Before merge

  • Review config compatibility - Confirm compatibility and upgrade impact for the changed config or default surface before merge.
  • Add data-model compatibility proof - Confirm migration or upgrade compatibility proof before merge.
Agent review details

Security

None.

PR surface

PR surface statistics unavailable: the file list is incomplete.

Review metrics

None.

Stored data model

Persistent data-model change detected: unknown-truncated-pull-files. Confirm migration or upgrade compatibility proof before merge.

Technical review

Best 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.

Labels

Label changes:

No label changes.

Label justifications:

  • P3: This is an internal cleanup with no intended user-visible behavior change.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The Repository State classifies the author as MEMBER, so mandatory external-contributor proof does not apply to this internal cleanup. The PR body reports focused Testbox validation and HTML output comparisons; introduced paths show no stored-data contract change.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Vincent Koc: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Agustin Rivera: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
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.

Workflow

  • 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.

History

Review history (5 earlier review cycles)
  • reviewed 2026-09-26T02:57:23.130Z sha 3b7c1af :: blocked before merge. :: none
  • reviewed 2026-09-26T03:35:52.863Z sha 86db22f :: blocked before merge. :: none
  • reviewed 2026-09-26T04:42:36.838Z sha 86db22f :: blocked before merge. :: none
  • reviewed 2026-09-26T07:58:52.186Z sha 1ad6461 :: blocked before merge. :: none
  • reviewed 2026-09-26T08:55:37.207Z sha 1ad6461 :: blocked before merge. :: none

@steipete
steipete force-pushed the deslop/l64-autoreply3 branch from 3b7c1af to 86db22f Compare September 26, 2026 03:18
@steipete
steipete marked this pull request as ready for review September 26, 2026 03:25
@steipete

Copy link
Copy Markdown
Contributor Author

The three remaining review checklist items are resolved on 86db22f286875c5f743045c00db5cec7a73232d0:

  • Current-head CI completed successfully: 159 successful jobs, 20 workflow skips, and a green openclaw/ci-gate.
  • The rebase retained main’s compaction-probe repair. The refactor’s added/removed lines are unchanged. Fresh Testbox proof passed 447 registry/probe/admission tests and the complete build on this head.
  • The complete, paginated 105-file inventory contains no SQL schema, protocol schema, config type/schema, or migration changes. The only config/ edit is the shrink-only assertion baseline. No config key/default or stored session/transcript shape changes; no migration or upgrade action is needed. The compatibility flags arose from unknown-truncated-pull-files, not an identified data-model change.

The PR body now includes the final proof, changed-test timings, review disposition, and stopped-lease records. No code or security finding remains accepted.

@steipete
steipete disabled auto-merge September 26, 2026 10:59
@steipete
steipete force-pushed the deslop/l64-autoreply3 branch from 1ad6461 to d39d327 Compare September 26, 2026 11:00
@steipete
steipete enabled auto-merge (squash) September 26, 2026 11:05
@steipete
steipete merged commit 1011b10 into main Sep 26, 2026
234 checks passed
@steipete
steipete deleted the deslop/l64-autoreply3 branch September 26, 2026 11:17
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 27, 2026
LeizhenZhang added a commit to LeizhenZhang/openclaw that referenced this pull request Nov 9, 2026
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XL status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant