Repository navigation
refactor(auto-reply): deslop auto-reply fifth pass - #161129
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 29, 2026, 3:20 PM ET / 19:20 UTC (Revision 9). ClawSweeper reviewWhat this changesThe branch consolidates automatic reply command, prompt, event, queue, and delivery helpers, removes unused internal methods, and simplifies the session HTML export renderer without intending a user-visible change. Merge readiness⛔ Blocked before merge - 3 items remain Keep open: current main and v2026.9.6 do not contain this fifth cleanup pass. The final commit adds the export-renderer work missing from the previous review, and this review found no actionable introduced defect. Priority: P3 Review scores
Verification
How this fits togetherAuto-reply receives messages from channels and the Gateway, prepares commands and agent context, then delivers replies to the originating conversation. The export renderer turns saved session content into an HTML page. flowchart LR
A[Incoming message] --> B[Command and context preparation]
B --> C[Agent run]
C --> D{Delivery decision}
D --> E[Reply queue or direct send]
E --> F[Originating conversation]
C --> G[Saved session export]
G --> H[HTML page]
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 auto-reply decision and preserve channel delivery, session state, prompt text, and export rendering through the native landing gates. Do we have a high-confidence way to reproduce the issue? Not applicable: this is a behavior-preserving refactor, rather than a reported failure to reproduce. Is this the best way to solve the issue? Yes: the branch removes duplicate internal plumbing within existing owners, with no observed change to configuration or stored formats. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against bda22f818d96. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (8 earlier review cycles)
|
972a16d to
80456a6
Compare
80456a6 to
e086030
Compare
* refactor(auto-reply): deslop auto-reply fifth pass * refactor(auto-reply): finish validation cleanup * fix(auto-reply): keep mention type contracts acyclic * refactor(auto-reply): simplify export templates
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
Completes the maintainer-requested fifth auto-reply cleanup pass after #159527, removing duplicate projections, unused internal APIs, and forwarding layers.
User Impact
No user-visible change is intended. Reply routing, command grammar, approvals, delivery semantics, model-facing text, and rendered context images retain their existing contracts. There are no configuration, schema, protocol, or migration changes.
Why This Change Was Made
The measured production reduction is 853 net lines across 95 production files (1,100 additions / 1,953 deletions). Test support changes add 13 net lines; the exact assertion baseline shrinks by one line. The final PR has 101 files. This is below the requested 1,000-line target; the complete size-sorted READ log covers all 154 production files originally over 200 lines. Remaining large blocks retain distinct authority, persistence, recovery, or delivery contracts.
Status: Merged as
fbde3c402ffd30e8c9c85e90789cfc994f88d9a3using the requested exact-head inherited-CI exception. The 853-line production reduction is below the requested target; the complete coverage log is retained below.Fixes Found Along the Way
The hosted architecture check caught a PR-caused type-only cycle between
mentions.tsandmentions.types.ts. The runtime-only cycle check had passed. The repair restores the independent mention contracts exactly from the base; both cycle checks then passed, followed by the full architecture command and all five import-boundary files. No check or baseline allowance was relaxed.Earlier validation also caught a line-cap increase in an existing test suite, a context type mismatch, exact assertion-baseline shrinkage, and three type-aware lint findings. The two completion tests were moved to a suite registrar at their original position, preserving assertions, fixtures, order, and process count. TTS cleanup uses
try/finallyinside lifecycle admission and preserves the original synchronous-throw boundary. No unrelated product defect or flaky-test repair is claimed.Two actual main conflicts were resolved by retaining the current owners: #161088's configured-persona versus execution-workspace distinction, and #160778's awaited continuation handoff with current-operation and committed-write checks. The entire continuation-result module now matches main; its overlapping cleanup was dropped from this PR.
Evidence
Final candidate:
2c7e1e98d2d503203a2509e4a4b3beb68cddce6e, based ona15f3f72a6aabe4d51ce53426d717b4c65a4589e.All repository tests, checks, and builds run on Blacksmith Testbox after
pnpm install --frozen-lockfile. The core lease wastbx_01m3pfwa763szbtg21mt5dwynn(allocation run); the existing export tests ran ontbx_01m3ppkjpe3ahv2qcq4c9j0y7q(allocation run), and the final asset build and PR-image verification ran ontbx_01m3pvyxry13c804mt9h67q9cm(allocation run); the final browser contracts and asset check ran ontbx_01m3q3expyk2qmmchbx2jgfh3r(allocation run). The harness verifies the physical checkout, synthetic carrier parent, and changed-path SHA-256 hashes before and after proof. The final committed Git tree232263e38e3a43643332906073d374cd935d42e6exactly matches the verified candidate tree.Core results for
e0860303ff42a0fa36bc778e065b2e914d17caea:pnpm check:architecture: passed, 179.94s; zero runtime or type-import cycles.pnpm test src/auto-reply/reply/mentions.test.ts --maxWorkers=1: 76 passed, 2.29s wall.node scripts/check-changed.mjs --base a15f3f72a6aabe4d51ce53426d717b4c65a4589e -- <changed paths>: passed, 2337.27s.node scripts/run-vitest.mjs run --config test/vitest/vitest.config.ts --shard <1|2|3>/3 src/auto-reply <native-planned importers and boundaries>: 513 passed files / 10,000 passed tests, two existing skipped tests including one skipped file. Shard walls: 656.62s / 464.37s / 459.84s. Importers use the native changed-test planner with bounded owners and alias resolution.pnpm build: passed, 516.05s. Final hashes verified all 99 core paths.unknown-truncated-pull-files; inspection of the complete 101-file diff confirms no config/default, schema, stored-format, migration, or permission change. Earlier core and export reviews were also clean.The explicit boundary selection passed:
src/infra/fs-safe-import-boundary.test.ts,test/plugin-extension-import-boundary.test.ts,test/test-helper-extension-import-boundary.test.ts,test/control-ui-import-boundary.test.ts, andsrc/gateway/server-import-boundary.test.ts.Measured changed-test costs (
pnpm test <file> --maxWorkers=1):agent-runner-direct-runtime-config.test.ts20 tests / 67.06s;reply-run-registry.test.ts79 tests / 40.23s;reply-turn-admission.store-owner.test.ts32 tests / 59.37s. The completion registrar shares the existing suite process/fixtures. Hosted per-file timings are unavailable because the prior CI run failed architecture before tests.Byte parity against the initial base: five complete treemap PNGs and 720 prompt/media combinations matched exactly. Hosted CI was not dispatched or rerun for proof; the linked allocation runs provision Testbox leases.
Export supplement proof: existing 71 export tests passed (39.20s), and a synthetic fixture through the real
buildExportSessionReply/ production HTML assembler passed (40.96s). Final asset results:node scripts/check-changed.mjs --base e0860303ff42a0fa36bc778e065b2e914d17caea -- <two export assets>: passed, 2085.38s. The pinned base object is fetched inside the same delegated run.pnpm buildon the final 101-path source tree: passed, 394.85s. Final source hashes verified.The build and image verification results are retained from their completed run; the final contract/check run does not repeat them.
Hosted CI history: the preceding head's architecture job failed on the unrelated UI type cycle
chat-attachment-controls.types.ts -> chat-attachment-reads.ts; the same failure appears in independent PR #161098's job, headd9eeac34b2cd2501da5abdfc357b8f8d5e651e4f. Main already contains repair77cbd9513ea8b608faff40767ed77abe357f88d7, so no duplicate repair was opened. Final-head CI is recorded separately below.Final-head inherited CI failure and landing basis
For head
2c7e1e98d2d503203a2509e4a4b3beb68cddce6e, preflight in run 36615556351 fails before tests withsplit timing generation repeats files for core-runtime-infra-storage-state. Its CI-gate check and mirrored status propagate that same failure. All remaining reported checks are successful or skipped; security-sensitive and dependency review both passed.The identical error and stack occur in PR #161287's latest CI run, head
909dabdcd414764afdd79d283829b6940f5a4a73. That PR's current recorded head and latest run were rechecked. This PR changes none of the planner, its scheduling metadata, the database-worker inventory, or the duplicated PDF test; the failure is in manifest generation before any product test executes.Current main already contains repair b4df789c4a9. Its parent lists
src/agents/tools/pdf-tool.resources.test.tstwice; the repair removes only the later entry and retains the duplicate guard. The diff and main ancestry were inspected. An existing CI-repair PR was also found, so no duplicate repair was opened.The requested inherited-failure exception therefore applies to this exact head: complete Testbox proof passes, the only CI failure is independently reproduced outside this diff, and the owning repair is already on main. No workflow rerun, branch refresh, or manufactured passing status was used for landing. The squash request was pinned to the reviewed head above, and merge ancestry was verified on current main. Post-merge main CI succeeded on the merge commit; the main-push lane is security-fast, not the hourly full suite.
Export screenshots
Inspected synthetic-only captures from the real export assembler for the export supplement. The desktop before/after images are pixel-identical; this cleanup intends no appearance change.
Complete production coverage log (154 files over 200 lines)
Auto-reply fifth-pass coverage
Baseline: 863e377. Every production file over 200 lines is listed in descending original size. The final candidate has 153 files still over 200 lines; all are covered by the 154 original-size rows below. Prior passes and recent name-only diffs were inspected first. All listed files were read completely; retained paths have the stated contract. The later main integration from #160525 was also read: participant authority and queue-settlement additions preserve separate owners and remain unchanged by this pass.
src/auto-reply/reply/agent-runner-memory.tssrc/auto-reply/reply/export-html/template.jssrc/auto-reply/reply/queue/drain.tssrc/auto-reply/reply/session.tssrc/auto-reply/reply/get-reply.tssrc/auto-reply/reply/export-html/template.csssrc/auto-reply/reply/dispatch-acp.tssrc/auto-reply/reply/inbound-meta.tssrc/auto-reply/reply/reply-dispatcher.tssrc/auto-reply/reply/reply-run-registry.state.tssrc/auto-reply/reply/dispatch-acp-delivery.tssrc/auto-reply/reply/reply-turn-admission.tssrc/auto-reply/reply/directive-handling.impl.tssrc/auto-reply/command-auth.tssrc/auto-reply/reply/get-reply-inline-actions.tssrc/auto-reply/reply/dispatch-from-config.choose-route.tssrc/auto-reply/commands-registry.shared.tssrc/auto-reply/reply/get-reply-run-execute.tssrc/auto-reply/reply/agent-runner-execution.tssrc/auto-reply/reply/agent-runner-result-payloads.tssrc/auto-reply/reply/agent-runner-run.tssrc/auto-reply/reply/reply-run-registry.operation.tssrc/auto-reply/reply/get-reply-run-admission.tssrc/auto-reply/reply/model-selection.tssrc/auto-reply/reply/dispatch-from-config.lifecycle.tssrc/auto-reply/reply/agent-runner-cli-dispatch.tssrc/auto-reply/reply/reply-run-registry.registry.tssrc/auto-reply/reply/dispatch-from-config.gather.tssrc/auto-reply/chunk.tssrc/auto-reply/reply/get-reply-directives.tssrc/auto-reply/reply/followup-delivery.tssrc/auto-reply/reply/get-reply-directives-apply.tssrc/auto-reply/reply/dispatch-from-config.finalize.tssrc/auto-reply/templating.tssrc/auto-reply/reply/commands-diagnostics.tssrc/auto-reply/reply/restart-recovery-claim.tssrc/auto-reply/reply/commands-session.tssrc/auto-reply/reply/dispatch-from-config.prepare-context.tssrc/auto-reply/reply/commands-allowlist.tssrc/auto-reply/reply/dispatch-from-config.execute.tssrc/auto-reply/reply/reply-run-registry.message-injection.tssrc/auto-reply/reply/agent-runner-cli-candidate.tssrc/auto-reply/reply/agent-runner-core.tssrc/auto-reply/reply/reply-media-paths.tssrc/auto-reply/reply-payload.tssrc/auto-reply/reply/agent-runner-failure-reply.tssrc/auto-reply/reply/commands-acp/lifecycle.tssrc/auto-reply/reply/route-reply.tssrc/auto-reply/commands-registry.tssrc/auto-reply/reply/block-reply-pipeline.tssrc/auto-reply/dispatch.tssrc/auto-reply/reply/commands-models-catalog.tssrc/auto-reply/reply/commands-tts.tssrc/auto-reply/reply/get-reply-native-slash-fast-path.tssrc/auto-reply/reply/get-reply-run-context.tssrc/auto-reply/thinking.tssrc/auto-reply/reply/commands-context-report.tssrc/auto-reply/reply/reply-run-registry.contracts.tssrc/auto-reply/reply/followup-turn-admission.tssrc/auto-reply/reply/agent-runner-result-accounting.tssrc/auto-reply/reply/mentions.tssrc/auto-reply/reply/context-treemap.tssrc/auto-reply/reply/agent-runner-payloads.tssrc/auto-reply/reply/commands-compact.tssrc/auto-reply/inbound-debounce.tssrc/auto-reply/reply/followup-turn-execution.tssrc/auto-reply/reply/agent-runner-trace.tssrc/auto-reply/reply/reply-tool-authority.tssrc/auto-reply/reply/commands-acp/shared.tssrc/auto-reply/reply/reply-payloads-dedupe.tssrc/auto-reply/reply/commands-models.tssrc/auto-reply/reply/progress-narrator.tssrc/auto-reply/reply/agent-runner-execute.tssrc/auto-reply/get-reply-options.types.tssrc/auto-reply/reply/acp-projector.tssrc/auto-reply/reply/stage-sandbox-media.tssrc/auto-reply/reply/directive-handling.shared.tssrc/auto-reply/heartbeat-filter.tssrc/auto-reply/reply/queue/enqueue.tssrc/auto-reply/reply/dispatch-from-config.prepare-operation.tssrc/auto-reply/reply/agent-runner-utils.tssrc/auto-reply/reply/commands-login.tssrc/auto-reply/reply/agent-runner-embedded-candidate.tssrc/auto-reply/reply/abort-operation.tssrc/auto-reply/reply/dispatch-from-config.prepare-execution.tssrc/auto-reply/reply/bash-command.tssrc/auto-reply/reply/agent-runner-fallback-candidate.tssrc/auto-reply/reply/session-updates.tssrc/auto-reply/reply/history.tssrc/auto-reply/reply/model-selection-directive.tssrc/auto-reply/group-thread-dispatch.tssrc/auto-reply/reply/commands-plugins.tssrc/auto-reply/reply/queue/delivery-context.tssrc/auto-reply/reply/commands-export-session.tssrc/auto-reply/reply/commands-acp/runtime-options.tssrc/auto-reply/reply/dispatch-from-config.prepare-delivery.tssrc/auto-reply/reply/followup-runner.tssrc/auto-reply/reply/queue/state.tssrc/auto-reply/reply/queue/types.tssrc/auto-reply/reply/commands-system-prompt.tssrc/auto-reply/reply/directive-handling.model.tssrc/auto-reply/tokens.tssrc/auto-reply/reply/startup-context.tssrc/auto-reply/reply/commands-approve.tssrc/auto-reply/reply/agent-runner-steer-adoption.tssrc/auto-reply/reply/session-reset-command.tssrc/auto-reply/reply/dispatch-from-config.harness-defaults.tssrc/auto-reply/reply/agent-runner-error-handler.tssrc/auto-reply/reply/prompt-prelude.tssrc/auto-reply/usage-bar/translator.tssrc/auto-reply/reply/agent-runner-event-handler.tssrc/auto-reply/reply/agent-runner-result-complete.tssrc/auto-reply/reply/dispatch-from-config.block-reply.tssrc/auto-reply/reply/conversation-turn-capture.tssrc/auto-reply/reply/commands-info.tssrc/auto-reply/reply/reply-delivery.tssrc/auto-reply/reply/commands-private-route.tssrc/auto-reply/reply/model-runtime-normalization.tssrc/auto-reply/reply/typing.tssrc/auto-reply/reply/reply-elevated.tssrc/auto-reply/envelope.tssrc/auto-reply/reply/source-reply-delivery-mode.tssrc/auto-reply/reply/dispatch-from-config.context.tssrc/auto-reply/reply/session-usage.tssrc/auto-reply/reply/session-reset-model.tssrc/auto-reply/reply/conversation-label-generator.tssrc/auto-reply/reply/dispatch-acp-payload.tssrc/auto-reply/reply/strip-inbound-meta.tssrc/auto-reply/reply/commands-acp/diagnostics.tssrc/auto-reply/reply/dispatch-from-config.audit.tssrc/auto-reply/command-status-builders.tssrc/auto-reply/reply/reply-threading.tssrc/auto-reply/reply/get-reply-run-helpers.tssrc/auto-reply/reply/block-reply-coalescer.tssrc/auto-reply/reply/post-compaction-context.tssrc/auto-reply/reply/commands-goal.tssrc/auto-reply/reply/commands-acp/bindings.tssrc/auto-reply/reply/get-reply-fast-path.tssrc/auto-reply/heartbeat.tssrc/auto-reply/reply/inbound-context.tssrc/auto-reply/reply/dispatch-from-config.payloads.tssrc/auto-reply/group-thread.tssrc/auto-reply/reply/reply-run-registry.tool-authority.tssrc/auto-reply/reply/directive-handling.model-selection.tssrc/auto-reply/reply/get-reply-directives-routing.tssrc/auto-reply/reply/block-streaming.tssrc/auto-reply/reply/commands-reset.tssrc/auto-reply/commands-registry-normalize.tssrc/auto-reply/media-note.tssrc/auto-reply/reply/dispatch-from-config.turn-ledger.tssrc/auto-reply/reply/commands-config.tssrc/auto-reply/reply/session-conversation-binding.tssrc/auto-reply/reply/commands-export-trajectory.tssrc/auto-reply/fallback-state.ts