Skip to content

refactor(auto-reply): deslop auto-reply fifth pass - #161129

Merged
steipete merged 4 commits into
mainfrom
deslop/l133-auto-reply5
Sep 29, 2026
Merged

steipete merged 4 commits into
mainfrom
deslop/l133-auto-reply5

Conversation

@steipete

@steipete steipete commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

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

  • Keep directive-presence checks with the parser's existing inventory, including the deliberate exclusion of status from session-setting directives.
  • Share terminal-command cleanup, bash poll/stop setup, TTS attempt metadata, loop work-order rendering, and context-text preparation without changing parsing or output bytes.
  • Remove unused operation/session-handle methods and the internal payload forwarding barrel; retain the existing lifecycle and lineage owners.
  • Reuse agent-event subscriptions, progress-forwarding policy, and delivery cleanup while preserving ordering, custody, and finalization fences.
  • Share channel-formatted identity tokens, chunk configuration lookup, debounce cleanup, and queued-delivery finalization while keeping policy decisions explicit.
  • Reuse text-block and truncation helpers, centralize identical inbound timestamp conversion, and remove redundant session projections and rendering passes.
  • Simplify export tree indentation, tab expansion and share-link projection; consolidate identical CSS rules and remove six selectors with no renderer producer.

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 fbde3c402ffd30e8c9c85e90789cfc994f88d9a3 using 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.ts and mentions.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/finally inside 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 on a15f3f72a6aabe4d51ce53426d717b4c65a4589e.

All repository tests, checks, and builds run on Blacksmith Testbox after pnpm install --frozen-lockfile. The core lease was tbx_01m3pfwa763szbtg21mt5dwynn (allocation run); the existing export tests ran on tbx_01m3ppkjpe3ahv2qcq4c9j0y7q (allocation run), and the final asset build and PR-image verification ran on tbx_01m3pvyxry13c804mt9h67q9cm (allocation run); the final browser contracts and asset check ran on tbx_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 tree 232263e38e3a43643332906073d374cd935d42e6 exactly 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.
  • E2E selection: seven files / 286 tests passed, 792.47s. Covers auto-reply, model fallback at reply entry, and QA Lab audio/proxy/limit/vision routing.
  • pnpm build: passed, 516.05s. Final hashes verified all 99 core paths.
  • Fresh isolated Codex review of the complete final committed diff: no actionable P0–P2 findings (0.95 confidence). Current-head ClawSweeper revision 9 also reports no actionable defect. Its remaining config/data checklist is generated by 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, and src/gateway/server-import-boundary.test.ts.

Measured changed-test costs (pnpm test <file> --maxWorkers=1): agent-runner-direct-runtime-config.test.ts 20 tests / 67.06s; reply-run-registry.test.ts 79 tests / 40.23s; reply-turn-admission.store-owner.test.ts 32 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:

  • Browser contracts: all 11 states passed, 266.75s.
  • Open-sidebar proof compares exact DOM/text, geometry, and every computed style, including 20 paired repetitions. The unchanged baseline itself produced different text pixels across captures, so this assertion is structural. Pixel equality remains exact for the other ten states; no tolerance, retry, or product styling override is used.
  • Both share-link variants (with and without injected metadata): both passed.
  • Asset delta: node scripts/check-changed.mjs --base e0860303ff42a0fa36bc778e065b2e914d17caea -- <two export assets>: passed, 2085.38s. The pinned base object is fetched inside the same delegated run.
  • Full pnpm build on the final 101-path source tree: passed, 394.85s. Final source hashes verified.
  • Both PR images loaded and rendered on the real public GitHub page; the rendered table was inspected. Chat before/after delivery also completed.

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, head d9eeac34b2cd2501da5abdfc357b8f8d5e651e4f. Main already contains repair 77cbd9513ea8b608faff40767ed77abe357f88d7, 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 with split 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.ts twice; 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.

Before After
Before export cleanup After export cleanup
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.

Original lines Production file Status Simplification or retained contract
1723 src/auto-reply/reply/agent-runner-memory.ts READ Transcript estimation, native compaction exclusion, durable accounting, memory-flush admission, and failure latching each retain separate state/authority contracts; no sound further reduction identified without changing those boundaries.
1701 src/auto-reply/reply/export-html/template.js READ Combined identical child-indentation branches, removed the second tab-expansion pass and unused share-base fallback; preserved tree filtering, ancestry, rendering, and share-link contracts.
1329 src/auto-reply/reply/queue/drain.ts READ Applied prefix slice at the delivery-context boundary; retained aggregate cancellation, transcript staging, queue identity and elision custody checks.
1306 src/auto-reply/reply/session.ts READ Rollover and reuse differ in reset-boundary, worktree, transcript, binding and creation ownership; explicit undefined projection also carries mutation intent.
1169 src/auto-reply/reply/get-reply.ts READ Removed duplicate session-store assignment already owned by the session handle; preserved the distinct configured-persona and execution workspace projections introduced by #161088, plus preparation, authority, and cleanup order.
1092 src/auto-reply/reply/export-html/template.css READ Merged identical hover/active, tool-adjacency and prompt/tools declarations; removed six selectors with no historical/current producer; retained responsive, print, focus, and active rendering contracts.
915 src/auto-reply/reply/dispatch-acp.ts READ Simplified request-ID normalization and tools-allow predicate; preserved attachment ordering, admission, transcript and audit ownership.
774 src/auto-reply/reply/inbound-meta.ts READ removed private projection wrappers and unreachable configurable head/tail truncation branch; canonical marker truncation preserves reserved width, trim order, fences, and Unicode boundaries; reused prepared reply target fact.
772 src/auto-reply/reply/reply-dispatcher.ts READ One pending-release helper settles delivery and completion reservations; preserve scheduling, recovery custody, observers, and finalization.
742 src/auto-reply/reply/reply-run-registry.state.ts READ Barrier sources retain physical-store lineage and clear-time custody; timeout and successor semantics differ and cannot be combined safely.
729 src/auto-reply/reply/dispatch-acp-delivery.ts READ No sound larger simplification: routed/direct settlements and block-source custody have distinct pending/recovery obligations; setters and return projections all have callers.
727 src/auto-reply/reply/reply-turn-admission.ts READ Database claim and lifecycle admission are independent owners; retained generation rereads and recovery-release ordering after awaited work.
717 src/auto-reply/reply/directive-handling.impl.ts READ Existing transaction/authority ordering and exact acknowledgements are distinct; prior passes already centralized persistence and exec acknowledgement projection.
710 src/auto-reply/command-auth.ts READ Retain provider failure handling, distinct configured/profile authority, and live rechecks; security boundaries have different contracts.
708 src/auto-reply/reply/get-reply-inline-actions.ts READ One terminal-command helper now owns typing cleanup and delivery marking; distinct skill, stop, inline status and continuation flows remain.
706 src/auto-reply/reply/dispatch-from-config.choose-route.ts READ Removed inverse progress-policy wrapper and flattened late text-only suppression; distinct final send/transcript/custody paths retained.
701 src/auto-reply/commands-registry.shared.ts READ Registry is already descriptor-driven; command descriptions, menus, and model-independent policies are contractual.
694 src/auto-reply/reply/get-reply-run-execute.ts READ Moved numeric arrival timestamp conversion to its shared leaf owner; run snapshot and authority-bound projections are intentional.
692 src/auto-reply/reply/agent-runner-execution.ts READ Removed redundant truthiness guard after the closed fallback result assigns runResult; replaced a stale/narrating 14-line comment with the actual error-filtering invariant.
691 src/auto-reply/reply/agent-runner-result-payloads.ts READ Main #160778 now owns the continuation cleanup and awaited authority-checked handoff; retained its complete implementation unchanged and dropped the overlapping cleanup from this PR.
682 src/auto-reply/reply/agent-runner-run.ts READ Admission, steering, queued fallback, and retained final delivery are distinct lifecycle paths; repeated cleanup calls occur at different transfer boundaries and are not interchangeable.
674 src/auto-reply/reply/reply-run-registry.operation.ts READ Removed test-only hasOwnedSessionId and completeThen methods; captureOwnedSessionIds and after-clear registration remain canonical.
672 src/auto-reply/reply/get-reply-run-admission.ts READ Retained separate current-session refresh, heartbeat preemption, recovery-owner wait and target-slot adoption fences; each addresses a different race.
659 src/auto-reply/reply/model-selection.ts READ Retained catalog authority, inherited pins, operator policy and auth repair sequencing; loaded and configured catalogs have distinct persistence contracts.
655 src/auto-reply/reply/dispatch-from-config.lifecycle.ts READ No sound reduction: pre-dispatch/full-operation leases, upstream cancellation, archive and terminal recovery each own different lifetime fences.
604 src/auto-reply/reply/agent-runner-cli-dispatch.ts READ Reused canonical callback types and removed adapters that only awaited callbacks; the event bridge already owns callback settlement/error isolation.
597 src/auto-reply/reply/reply-run-registry.registry.ts READ Removed narrating header; retained keyed waiters, direct-backend fallback and lifecycle eviction contracts.
594 src/auto-reply/reply/dispatch-from-config.gather.ts READ No sound reduction beyond previous passes: source-vs-command-target keys, hook media staging and runtime admission snapshots are intentional.
593 src/auto-reply/chunk.ts READ One channel/account lookup serves both limit and mode; combine equivalent paragraph guards and direct chunk projections.
590 src/auto-reply/reply/get-reply-directives.ts READ Retained directive routing, skill alias reservation and reasoning authorization precedence; parser and model owners already provide canonical operations.
590 src/auto-reply/reply/followup-delivery.ts READ Merged ordinary and failed-retry payload sending through one final send tail; routing, mirror choice, suppression and all model-facing text remain exact.
582 src/auto-reply/reply/get-reply-directives-apply.ts READ Reused parser-owned session-directive presence inventory for any/model-only checks; kept atomic mixed-directive persistence separate.
574 src/auto-reply/reply/dispatch-from-config.finalize.ts READ No sound reduction: independent heartbeat, continuation, block custody, TTS and fallback settlement paths carry distinct authority and completion contracts.
563 src/auto-reply/templating.ts READ Consolidate primitive array rendering; retain SDK media aliases and inbound context fields.
562 src/auto-reply/reply/commands-diagnostics.ts READ Private approval custody, gateway export, and Codex add-on handoff have distinct failure paths; retained the existing boundary.
561 src/auto-reply/reply/restart-recovery-claim.ts READ Claim adoption, hook checkpoints and terminal cleanup have different compare-and-swap predicates and patch obligations; retained those separate transitions.
558 src/auto-reply/reply/commands-session.ts READ Removed constant-return usage and one-call metadata forwarding helpers; retained lifecycle and restart ownership gates.
551 src/auto-reply/reply/dispatch-from-config.prepare-context.ts READ No sound reduction: stable prompt delivery policy differs from live delivery, and plugin-bound persistence/dedupe need explicit scope.
542 src/auto-reply/reply/commands-allowlist.ts READ Config and pairing-store actions intentionally differ in authorization and publication; retained exact parser and mutation ordering.
536 src/auto-reply/reply/dispatch-from-config.execute.ts READ Reused progress forwarding for plan callbacks, unified block-TTS cleanup with finally and canonicalized progress visibility checks.
535 src/auto-reply/reply/reply-run-registry.message-injection.ts READ V1 compatibility cites v2026.8.1; V2 source authority, question uncertainty and adoption failures need distinct outcome paths.
527 src/auto-reply/reply/agent-runner-cli-candidate.ts READ Removed three async/await callback forwarders while retaining optional lookup and receiver binding.
525 src/auto-reply/reply/agent-runner-core.ts READ Helpers each own routing, generation-fenced refresh, custody, or finalization behavior; external callers retain them, including foreground/followup/cron consumers.
520 src/auto-reply/reply/reply-media-paths.ts READ Reuse the already-resolved MIME type to classify failure kind; retain sandbox, remote reader, cache, and prepared-media ownership boundaries.
519 src/auto-reply/reply-payload.ts READ Metadata fields encode distinct ownership facts; payload clones deliberately retain WeakMap metadata.
513 src/auto-reply/reply/agent-runner-failure-reply.ts READ Error-precedence and disclosure rules differ by provider/preflight/runtime and preserve public recovery copy; no common path without policy changes.
508 src/auto-reply/reply/commands-acp/lifecycle.ts READ Spawn cleanup, cancellation, steering, and close have distinct resource ownership; previous pass already shares target admission.
505 src/auto-reply/reply/route-reply.ts READ Replaced manual media truthy filtering, imported payload helpers from their owner and removed narrating comments; send dispositions unchanged.
503 src/auto-reply/commands-registry.ts READ Remove nested projection IIFE and intermediate renderer state; retain native mapping and command authorization boundaries.
500 src/auto-reply/reply/block-reply-pipeline.ts READ Previous pass already simplified source recovery; payload/occurrence dedupe and delivery receipts protect different streaming guarantees.
498 src/auto-reply/dispatch.ts READ Dispatcher paths have separate hook/delivery ownership and foreground lease contracts; no safe large cutover remains.
495 src/auto-reply/reply/commands-models-catalog.ts READ Visibility, readiness, provider normalization, and runtime choices already delegate to their canonical owners; catalog snapshot freshness must remain.
493 src/auto-reply/reply/commands-tts.ts READ Unified duplicated attempt metadata recording for success/failure while retaining branch-specific fields and latency.
490 src/auto-reply/reply/get-reply-native-slash-fast-path.ts READ Reused prepared directive result and removed duplicate session-map write; native fast-path authority and continuation ordering remain.
488 src/auto-reply/reply/get-reply-run-context.ts READ Retained stable versus per-turn prompt modes, reset preparation and post-admission refresh; these preserve transcript and prompt-prefix contracts.
486 src/auto-reply/thinking.ts READ Catalog mapping, provider policy, and harness levels remain distinct; no behavior-preserving broad replacement found.
484 src/auto-reply/reply/commands-context-report.ts READ Rendering paths preserve detailed/list/map distinctions, transcript budget accounting and exact output; prior pass already shares common context lines.
479 src/auto-reply/reply/reply-run-registry.contracts.ts READ Removed test-only hasOwnedSessionId and completeThen from the operation contract; retained shipped backend compatibility.
478 src/auto-reply/reply/followup-turn-admission.ts READ Retained persisted-generation adoption, preflight recovery, notice delivery and source authority; these are distinct before/after-await checks.
478 src/auto-reply/reply/agent-runner-result-accounting.ts READ Usage, fallback provenance, compaction accounting, and queued projection have different write authority; the durable target and live-operation guards are essential.
474 src/auto-reply/reply/mentions.ts READ folded one-call cache publication wrapper into compile owner; shortened historical prose while retaining regex boundary and Unicode invariants.
474 src/auto-reply/reply/context-treemap.ts READ canvas fill delegates to rectangle writer; label clipping drops private unreachable low-width branches after its existing minimum-width gate. PNG byte-equivalence proof requested.
472 src/auto-reply/reply/agent-runner-payloads.ts READ Unified final-payload preservation across streaming/direct-delivery branches; unified sanitized-text insertion around heartbeat stripping; simplified boolean omission expression without changing short-circuit order.
469 src/auto-reply/reply/commands-compact.ts READ Compaction identity checks must repeat after awaits and on commit; retained lifecycle-aware runtime boundary.
466 src/auto-reply/inbound-debounce.ts READ Share key-task cleanup and let the deferred promise own idempotent release instead of duplicate state.
461 src/auto-reply/reply/followup-turn-execution.ts READ Retained progress visibility, deterministic tool delivery, bounded work-drain and separate failure precedence.
456 src/auto-reply/reply/agent-runner-trace.ts READ Fourth pass already consolidated scalar trace formatting; remaining formats preserve distinct diagnostic byte/output contracts.
448 src/auto-reply/reply/reply-tool-authority.ts READ Retained frozen policy snapshot, current live-authority checks, requester overlay and normalized fingerprint; manual fields bound the security contract.
444 src/auto-reply/reply/commands-acp/shared.ts READ Option grammar and typed parse results remain explicit; helpers already shared across actions.
435 src/auto-reply/reply/reply-payloads-dedupe.ts READ Remove redundant media-filter state and normalized-set loop; resolve the channel suppression matcher once and remove its pass-through wrapper.
435 src/auto-reply/reply/commands-models.ts READ Provider menu and paginated catalog have distinct callbacks and normalization behavior; no sound additional consolidation.
431 src/auto-reply/reply/progress-narrator.ts READ retained; visibility/preamble gates, retries, turn cancellation, and event projection are distinct lifecycle responsibilities. No safe sizable shared flow remains.
431 src/auto-reply/reply/agent-runner-execute.ts READ Restart recovery adapter now retains its owner's return object and overrides only admission to bind the source; removed destructure/rename/repack layer.
423 src/auto-reply/get-reply-options.types.ts READ Public callback and lifecycle contract; suppressToolErrorWarnings has an explicit SDK removal boundary.
420 src/auto-reply/reply/acp-projector.ts READ Merged identical early-return branches and simplified lifecycle flags; retained distinct live/final-only buffering and output truncation contracts.
419 src/auto-reply/reply/stage-sandbox-media.ts READ retained; local/remote paths share safe staging owner already, while SCP retries, cancellation, allowed-root checks, and alias identity preserve distinct boundaries.
414 src/auto-reply/reply/directive-handling.shared.ts READ Session fields already centralized in maps; retained mutation/persistence conflict and acknowledgement semantics.
412 src/auto-reply/heartbeat-filter.ts READ Unified successful-result ID collection and retained-message traversal; keep visible tool response completion semantics.
409 src/auto-reply/reply/queue/enqueue.ts READ Steer reservation and overflow admission have distinct source-custody transitions; fourth pass already simplified append policy.
407 src/auto-reply/reply/dispatch-from-config.prepare-operation.ts READ No sound reduction: fast commands, plugin-binding claims and lifecycle admission intentionally preserve separate ordering and authorization fences.
405 src/auto-reply/reply/agent-runner-utils.ts READ Fourth-pass route normalization already consolidated; retained auth, threading, capability minting and lazy configuration owners serve distinct consumers.
392 src/auto-reply/reply/commands-login.ts READ Read-current authority, cancellation, and post-login adoption guard distinct states; no sound simplification without changing flow contracts.
388 src/auto-reply/reply/agent-runner-embedded-candidate.ts READ Removed unused runId argument from event handler construction; retained lazy partial-payload materialization and serialized tool deliveries.
381 src/auto-reply/reply/abort-operation.ts READ Cancellation order, captured targets, current-authority revalidation, queued reservations, and ACP cleanup are distinct invariants; retain unchanged.
375 src/auto-reply/reply/dispatch-from-config.prepare-execution.ts READ No sound reduction: callback-start ordering and snapshot callback references preserve channel presentation semantics.
374 src/auto-reply/reply/bash-command.ts READ Shared poll/stop session lookup and no-active reply; retained action-specific registry, cancellation and delivery acknowledgement behavior.
370 src/auto-reply/reply/agent-runner-fallback-candidate.ts READ Per-candidate state and authority are reset at explicit fallback boundaries; CLI/native adapters need different execution and lifecycle facts.
365 src/auto-reply/reply/session-updates.ts READ Removed narrating header; skill snapshot first-turn writes, refresh writes and final generation reread enforce different lifecycle points.
358 src/auto-reply/reply/history.ts READ retained; public SDK deprecated aliases have a named compatibility contract, and asynchronous media enrichment must preserve insertion order and late-cancellation checks.
350 src/auto-reply/reply/model-selection-directive.ts READ Simplified ordered fuzzy-score branches and candidate projection; weights, tie-breakers and selection errors remain identical.
347 src/auto-reply/group-thread-dispatch.ts READ Physical transport and participant lifecycle ownership differ; reset fields prevent inherited authority and transcript contamination.
342 src/auto-reply/reply/commands-plugins.ts READ Install versus enable/disable use different lifecycle guards and preflight ownership; shared existing helpers retained.
340 src/auto-reply/reply/queue/delivery-context.ts READ Authorization key fields intentionally prevent unsafe collect batches; compact retry-source projection deliberately omits runtime-only fields.
332 src/auto-reply/reply/commands-export-session.ts READ Retained transcript migration/tree semantics and HTML placeholder escaping; previous pass already collapsed loading.
330 src/auto-reply/reply/commands-acp/runtime-options.ts READ Single-runtime-option updates already use canonical error/parsing owner; concrete setters retain distinct backend contracts.
327 src/auto-reply/reply/dispatch-from-config.prepare-delivery.ts READ No sound reduction: raw/prepared dispatch seam, durable-intent authority and lazy media normalization each retain a distinct contract.
326 src/auto-reply/reply/followup-runner.ts READ Removed narrating comments; kept consumed/deferred/retry distinction and unconditional completion cleanup.
321 src/auto-reply/reply/queue/state.ts READ Retained queue generation, pending-source cap, auth-profile deletion and model-selection refresh owners; optional property presence affects reset intent.
319 src/auto-reply/reply/queue/types.ts READ Removed narrating header and stale detached hook comment; public queue fields retain documented source ownership.
318 src/auto-reply/reply/commands-system-prompt.ts READ Sandbox and third-party prompt inspection fallback have named contracts; retained fail-closed behavior and lazy catalog boundary.
315 src/auto-reply/reply/directive-handling.model.ts READ Model summary/status use different visibility/auth projections and exact text; already uses canonical visibility owner.
314 src/auto-reply/tokens.ts READ Prior pass consolidated regex construction; Unicode and punctuation distinctions protect visible text.
313 src/auto-reply/reply/startup-context.ts READ retained; bounded descriptor reads, calendar/UTC windows, timestamp ordering, binary fitting, and complete read-before-render behavior each serve separate contracts.
306 src/auto-reply/reply/commands-approve.ts READ Approval kind probe order and live reviewer authority are significant; no cleanup worth weakening explicit gates.
304 src/auto-reply/reply/agent-runner-steer-adoption.ts READ Parking, transcript commitment, authority recheck, and fallback ownership are distinct outcomes; recent steering changes require current-generation semantics.
303 src/auto-reply/reply/session-reset-command.ts READ Retained anchored raw/command projection parser and authorized reset matching unchanged under the hard command-parsing contract.
302 src/auto-reply/reply/dispatch-from-config.harness-defaults.ts READ Previous passes already consolidated harness selection; configured, stored, channel and source-provider defaults differ by precedence.
295 src/auto-reply/reply/agent-runner-error-handler.ts READ Failure exits deliberately differ in lifecycle publication, model-patch settlement, and disclosure; merging them would alter policy.
293 src/auto-reply/reply/prompt-prelude.ts READ folded single-call body builder into envelope owner and consolidated media-note prefixing; resolve delivery directive once and carry it into current/resumable context.
292 src/auto-reply/usage-bar/translator.ts READ Split verb metadata once and project rendered segments directly instead of mutable output accumulators.
290 src/auto-reply/reply/agent-runner-event-handler.ts READ Removed unused runId parameter and two one-use compaction notice forwarding helpers; preserved hook-before-notice ordering and existing nonfatal delivery catch.
287 src/auto-reply/reply/agent-runner-result-complete.ts READ Finalization ties source suppression, recovery receipts, diagnostics, and post-compaction state to separate owners; no safe shared replacement identified.
285 src/auto-reply/reply/dispatch-from-config.block-reply.ts READ Flattened TTS preparation IIFE and combined equivalent display-lane suppression exits; preserved source tracking and queue notifications.
281 src/auto-reply/reply/conversation-turn-capture.ts READ Reused canonical text-block collector and shared arrival timestamp conversion; correlated claim, writer authority and audit ordering unchanged.
281 src/auto-reply/reply/commands-info.ts READ Shared command wrappers already own standard gates; tools/status/export branches preserve authorization and payload metadata distinctions.
270 src/auto-reply/reply/reply-delivery.ts READ Imported renderability from canonical payload owner, enabling parent removal of the forwarding barrel; direct vs streamed delivery semantics retained.
270 src/auto-reply/reply/commands-private-route.ts READ Approval target ranking, delivery custody and fallback are already centralized; retained exact routing.
263 src/auto-reply/reply/model-runtime-normalization.ts READ Retained literal catalog identity, provider-owned runtime preparation and explicit pin/profile precedence; no safe consolidation of these independent facts.
257 src/auto-reply/reply/typing.ts READ retained; callback settlement, TTL, dispatch grace, and sealing gates cannot collapse without changing async indicator behavior.
255 src/auto-reply/reply/reply-elevated.ts READ Replace six repeated matcher closures and three token-population branches with field token data using the existing identity/mutable distinction.
254 src/auto-reply/envelope.ts READ Timestamp cache and sender/header sanitization have distinct contracts; prior pass already removed duplicated formatting.
253 src/auto-reply/reply/source-reply-delivery-mode.ts READ Retained distinct source visibility, stable-session policy, unauthorized-command and ambient-silence decisions; each has a different input contract.
251 src/auto-reply/reply/dispatch-from-config.context.ts READ No sound reduction: binding rereads and reset lineage checks enforce current authority after awaited operations.
250 src/auto-reply/reply/session-usage.ts READ Context freshness and cost accounting differ; precommit authority and model-state preservation remain unchanged after the fourth pass.
250 src/auto-reply/reply/session-reset-model.ts READ Reduced redundant forwarding through existing helpers and removed a persisted-entry alias; model token parsing, catalog checks and persistence unchanged.
250 src/auto-reply/reply/conversation-label-generator.ts READ Retained utility/primary route dedupe, cross-provider profile compatibility and live authority checks; shared attempt owner already handles common flow.
246 src/auto-reply/reply/dispatch-acp-payload.ts READ Combined equivalent TTS skip exits and simplified optional visibility hook return; source-aware transcript and final recovery algorithms retained.
245 src/auto-reply/reply/strip-inbound-meta.ts READ retained; offset-based parsing preserves fences, final-line separators, active-memory order, and sender extraction independently.
245 src/auto-reply/reply/commands-acp/diagnostics.ts READ Doctor, install, and sessions report distinct facts and revalidation; retained current runtime boundaries.
243 src/auto-reply/reply/dispatch-from-config.audit.ts READ Fourth pass already consolidated reason maps and recorder type; exact audit classification and resilience retained.
242 src/auto-reply/command-status-builders.ts READ Remove empty bucket initialization and redundant category scans; preserve category order and exact help text.
241 src/auto-reply/reply/reply-threading.ts READ Account policy precedes channel defaults; preview does not spend the reply slot; off/all/batched modes have different contracts.
241 src/auto-reply/reply/get-reply-run-helpers.ts READ Removed duplicate timestamp conversion into the shared leaf; retained media index identity, unresolved hydration and transcript watermark ordering.
240 src/auto-reply/reply/block-reply-coalescer.ts READ No sound reduction: source coverage differs from inserted transport joiners, and media/voice/visibility boundaries cannot be merged.
238 src/auto-reply/reply/post-compaction-context.ts READ dropped redundant section-name alias/fallback because extractor publishes found names alongside every result; simplified options and model-text concatenation without changing bytes.
238 src/auto-reply/reply/commands-goal.ts READ Storage changes already delegated to canonical goal owner; per-action continuation text and token accounting differ.
237 src/auto-reply/reply/commands-acp/bindings.ts READ Conversation versus child-thread placement requires separate policy and identity gates; retained one canonical binder.
232 src/auto-reply/reply/get-reply-fast-path.ts READ Retained synthesized session activity and reset-preserved fields; fast and full session initialization have distinct admission and fixture contracts.
227 src/auto-reply/heartbeat.ts READ Prompt bytes and acknowledgment stripping remain unchanged; fourth pass already simplified this owner.
224 src/auto-reply/reply/inbound-context.ts READ removed channel-context intermediate and duplicate explicit/inferred label assignment; preserved SDK aliases, command authority, media projection, and finalization marker.
220 src/auto-reply/reply/dispatch-from-config.payloads.ts READ No sound reduction: dedupe key is a deliberate whitelist; TTS finalization lease and accepted-payload side effects remain canonical owners.
218 src/auto-reply/group-thread.ts READ Derive replied participants once for next-round selection and avoid repeated name lookups.
217 src/auto-reply/reply/reply-run-registry.tool-authority.ts READ Personal participant retention and frozen route policy enforce live authorization; model-facing errors and late participant assertions retained.
215 src/auto-reply/reply/directive-handling.model-selection.ts READ Model/profile disambiguation and provider-specific authorization are required; no safe parsing simplification.
214 src/auto-reply/reply/get-reply-directives-routing.ts READ Retained command-source provenance and exact sender-span projection; normalizing arbitrary context would change parsing and prompt bytes.
214 src/auto-reply/reply/block-streaming.ts READ No sound reduction: account/provider defaults, chunk limits and min/max/idle rounding each enforce distinct configured bounds.
210 src/auto-reply/reply/commands-reset.ts READ Soft, ACP-bound, and ordinary reset intentionally differ; retained hooks, reset tails, and live session state.
210 src/auto-reply/commands-registry-normalize.ts READ Use capture-typed replacement for colon normalization, eliminating an impossible missing-capture guard and IIFE.
207 src/auto-reply/media-note.ts READ Attachment identity, audio suppression, and managed-path projection require separate checks; prior pass already consolidated.
206 src/auto-reply/reply/dispatch-from-config.turn-ledger.ts READ Fourth pass already consolidated send operations; settlement timeout/abort precedence and receipt-less uncertainty must remain intact.
205 src/auto-reply/reply/commands-config.ts READ Config parsing/redaction/publication use canonical owners; show/set/unset authorization differences retained.
204 src/auto-reply/reply/session-conversation-binding.ts READ Prepared observation checks differ from fresh binding resolution; explicit route projection prevents plugin fields crossing ownership boundaries.
204 src/auto-reply/reply/commands-export-trajectory.ts READ Removed unused encodedRequest result field and replaced duplicated CLI exec request fields with the owner return type.
203 src/auto-reply/fallback-state.ts READ Distinct transient-error exposure and previous-state comparisons retain user-facing recovery behavior.

@clawsweeper

clawsweeper Bot commented Sep 29, 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.

@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 29, 2026
@clawsweeper

clawsweeper Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 29, 2026, 3:20 PM ET / 19:20 UTC (Revision 9).

ClawSweeper review

What this changes

The 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
Reviewed head: 2c7e1e98d2d503203a2509e4a4b3beb68cddce6e

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The branch has substantial boundary validation and direct export proof, with no actionable defect found in the reviewed cleanup.
Proof confidence 🐚 platinum hermit (4/6) Not applicable: The Repository State identifies a member-authored cleanup, so the external-contributor proof gate does not apply. The changed export template was exercised through the production HTML assembler in Chromium, with inspected identical before/after screenshots; the PR also records Testbox E2E and parity results for auto-reply. No stored-data contract changes.
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 identifies a member-authored cleanup, so the external-contributor proof gate does not apply. The changed export template was exercised through the production HTML assembler in Chromium, with inspected identical before/after screenshots; the PR also records Testbox E2E and parity results for auto-reply. No stored-data contract changes.
Evidence reviewed 8 items Introduced delivery cleanup: The pinned introduced diff shares progress forwarding while retaining abort checks, pending-delivery waits, and the existing tool-summary condition.
Elevated sender matching: The refactor retains separate ID, fallback-from, E.164, and mutable-label token sets; the old and new introduced hunks use the same formatter and stripped-prefix choices.
Export rendering path: The removed per-line tab replacement remains upstream in the expandable-output formatter, which passes prepared lines into this function.
Findings None None.
Security None None.

How this fits together

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

Before merge

  • Resolve review confidence - ClawSweeper must reach high confidence before merge readiness is known.
  • 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 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.

Labels

Label changes:

  • add proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. The Repository State identifies a member-authored cleanup, so the external-contributor proof gate does not apply. The changed export template was exercised through the production HTML assembler in Chromium, with inspected identical before/after screenshots; the PR also records Testbox E2E and parity results for auto-reply. No stored-data contract changes.

Label justifications:

  • P3: This is an internal cleanup with no intended user-visible behavior change.
  • merge-risk: 🚨 message-delivery: The branch changes reply dispatch, queue, and finalization paths where a semantic error could suppress or duplicate an outbound reply.
  • 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 identifies a member-authored cleanup, so the external-contributor proof gate does not apply. The changed export template was exercised through the production HTML assembler in Chromium, with inspected identical before/after screenshots; the PR also records Testbox E2E and parity results for auto-reply. No stored-data contract changes.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. The Repository State identifies a member-authored cleanup, so the external-contributor proof gate does not apply. The changed export template was exercised through the production HTML assembler in Chromium, with inspected identical before/after screenshots; the PR also records Testbox E2E and parity results for auto-reply. No stored-data contract changes.

Evidence

What I checked:

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Ayaan Zaidi: 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 (8 earlier review cycles)
  • reviewed 2026-09-29T10:00:29.128Z sha 972a16d3496fd05562b816ce87a69ab44107e179 :: blocked before merge. :: none
  • reviewed 2026-09-29T10:48:33.527Z sha 972a16d3496fd05562b816ce87a69ab44107e179 :: blocked before merge. :: none
  • reviewed 2026-09-29T11:00:13.773Z sha 80456a6 :: blocked before merge. :: none
  • reviewed 2026-09-29T11:22:06.695Z sha 80456a6 :: blocked before merge. :: [P2] Restore independent mention type contracts
  • reviewed 2026-09-29T12:14:41.578Z sha e086030 :: blocked before merge. :: none
  • reviewed 2026-09-29T14:00:17.598Z sha e086030 :: blocked before merge. :: none
  • reviewed 2026-09-29T14:40:04.907Z sha e086030 :: blocked before merge. :: none
  • reviewed 2026-09-29T15:52:00.983Z sha e086030 :: blocked before merge. :: none

@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Sep 29, 2026
@steipete
steipete force-pushed the deslop/l133-auto-reply5 branch from 972a16d to 80456a6 Compare September 29, 2026 10:52
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Sep 29, 2026
@steipete
steipete marked this pull request as ready for review September 29, 2026 11:04
@clawsweeper clawsweeper Bot added status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 29, 2026
@steipete
steipete force-pushed the deslop/l133-auto-reply5 branch from 80456a6 to e086030 Compare September 29, 2026 12:04
@clawsweeper clawsweeper Bot added status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 29, 2026
@steipete
steipete marked this pull request as draft September 29, 2026 13:50
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Sep 29, 2026
@steipete
steipete marked this pull request as ready for review September 29, 2026 18:55
@clawsweeper clawsweeper Bot added the proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. label Sep 29, 2026
@steipete
steipete merged commit fbde3c4 into main Sep 29, 2026
169 of 174 checks passed
@steipete
steipete deleted the deslop/l133-auto-reply5 branch September 29, 2026 19:31
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 30, 2026
* 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
amittell added a commit to amittell/openclaw that referenced this pull request Oct 9, 2026
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. 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