Skip to content

refactor(reply): consolidate reply setup and lifecycle handling - #167236

Merged
steipete merged 6 commits into
mainfrom
deslop/d02-p2-20261007
Oct 8, 2026
Merged

steipete merged 6 commits into
mainfrom
deslop/d02-p2-20261007

Conversation

@steipete

@steipete steipete commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Head: 0cbd6f542c1a80a7d9e5ebd0121bb6335e07041c. Local gates passed on staged tree 6fc7e092b47e026314b037d6b6577a2a1194c7ac, now committed unchanged at this head. Hosted CI remains the merge gate.

What Problem This Solves

Reply handling repeats command setup, state projections, delivery decisions and queue lifecycle bookkeeping across related paths.

User Impact

No user-visible change. Features, configuration, command flags, reply text, protocol fields, persisted data and public APIs retain their contracts.

Why This Change Was Made

This pass shares common work with the existing owners, removes redundant registry mirrors and parameter threading, and narrows internal APIs while preserving distinct authorization, delivery and recovery contracts.

Against 35e5f4ab9818deb9347e2ec87c38aee8c05b3e05, the candidate removes 853 net production lines (+1,851/−2,704 across 149 production files; 163 total changed paths), excluding tests, fixtures, support, generated files and declarations. The pass uses the campaign's 500–999-line coverage exception after more than two hours of implementation and measured trials. The complete, untruncated 407-file record covers retained changes, rejected trials and unchanged files: coverage 1 of 3, coverage 2 of 3, coverage 3 of 3.

Evidence

Differential checks passed for 635,760 media layouts, 18,144 coalescer cases including synchronous reentry, 9,475 delivery routes, 56 exact timestamp comparisons, 382 RGBA/PNG byte comparisons and 130 audit-terminal output/error comparisons. Complete FollowupRun structural equality passed native TypeScript in 16.968s against the rebased base, with 45 input hashes and 43 Git bindings. Final body-only corrections preserve the relevant declarations; this equality receipt predates those corrections.

Boundary Completed evidence Scope
Full changed-check Passed, 1,374.925s; production/core/root types, all Knip scans, lint and all remaining guards Exact committed tree
Production build and SDK exports Full build 40m1.1s; 151 exports passed Prior production source at 69b79a01; no final-head full-build claim
Reply E2E 225/225, wrapper 375.092s Updated run-reply-agent suite at prior production source 69b79a01; predates the four lint corrections
Private-route approval Unit 8/8, wrapper 153.100s; gateway E2E 1/1, wrapper 2,438.946s including native preparation At 69b79a01; private-route source/tests are unchanged in the final head
Non-isolated runner Full file passed, wrapper 110.510s At 69b79a01; runner/waiter inputs unchanged by final corrections
Shared auto-reply project 3,946 passed / 1 existing skip, zero unhandled errors across 223 files, wrapper 614.211s Final export-preserving fixture at bb6520a7; predates the four compiler-guided body corrections
Final correction boundaries 416/416 across 7 files, wrapper 548.507s Final four-file correction source, subsequently signed as 0cbd6f54
Unchanged failure replays Memory 2/2, queue 5/5, module-identity full file/both scenarios passed Wrappers 150.765s / 127.653s / 64.250s; original delays remain unattributed
Suppression and import-cycle guards Suppressions 3/3, 12.541s; runtime cycles 0, 42.455s; Madge cycles 0, 63.010s Exact committed tree

The build returned success but reported startup JavaScript gzip 364.9 KiB / 373,654 B against 364.7 KiB / 373,454 B. That warning/violation remains recorded without attribution or waiver. The final full changed-check passed production/core/root type graphs, all three Knip scans with 0 entries, core/script/root-test lint and every later guard. Earlier attempts exposed the now-removed production route export and four corrected lint findings; an earlier full-tree scan timed out at 600s (605s reported). Those earlier attempts are retained as failure history, not passing proof. Earlier Linux consumer evidence was 160/160 across 9 files and remains qualified as prior-revision evidence.

Fixture repairs and regression evidence

Ambient provider authentication contaminated three model-menu fixture expectations. With synthetic child-only OpenAI aliases, the original whole file reproduced 3 failures / 42 passes in 155.329s; clearing both aliases in the fixture produced 45/45 under the same environment in 172.688s. All 65 assertions remain unchanged, and existing Vitest/runner cleanup restores the environment. Production authentication policy is unchanged.

An incomplete logger mock exposed only warn; the real scheduler requires debug and trace, producing 586 unhandled exceptions while the fixture's own cases passed. The replacement implements the complete typed logger, including recursive child, retains all 48 assertions, and uses typed importOriginal to preserve real module exports. The final export-preserving form received a fresh review with no P0–P2 findings and completed the shared-project run with 3,946 passes / 1 existing skip, zero unhandled errors, 614.211s. That result precedes the final four body-only lint corrections and is reused with their separate 416-test boundary proof. Native mock-baseline pruning removes exactly the obsolete row (10,377 → 10,376) without adding an allowance.

The CLI delegation fixture also invoked real cold WhatsApp threading lookup (91.713s primary versus 1ms fallback; authentication 113ms). A file-owned fake registry passed both cases in 5.583s / 5.622s (wrapper 345.61s) with all four assertions and the existing 120s test / 180s hook budgets intact. Registry cleanup has a failing-before/passing-after control: the existing producer/observer pair received [] instead of [false] under old cleanup (1 pass / 1 fail, 114.30s), then passed 2/2, 109.76s with three added assertions and no new child run, timer, timeout, retry or skip.

SDK and failure qualification

The refreshed formal SDK comparison 35e5f4a → 69b79a0 is non-empty: 131 reachable-declaration hash changes, with 0 entrypoint additions/removals and 0 exported declaration/kind changes. Exactly two blocks changed: the independently proved FollowupRun type composition and internal registry waiter/mirror-map representation. Conservative whole-module declaration hashing names the registry block *; neither ReplyRunWaiter nor replyRunState is an SDK/package export or public parameter/return shape. The public chain ends in unchanged ReplyOperation; public barrels/contracts are unchanged. Details are attached to the report's first canonical export, not evidence that only AgentHarness is affected. No acknowledgement override was used. The final four corrections rename three private callback parameters and consume an already-normalized boolean directly; they change production bodies but preserve exported declarations, API signatures and import edges. The earlier SDK result is reused on that qualified basis; no formal final-head rerender is claimed.

The original memory timeout/ownership mismatch, queue-removal failure and first-parent module-identity timeout remain recorded despite unchanged replays passing; no production repair or inherited-main failure is inferred from those replays. Earlier compaction delays likewise remain unexplained despite 82/82 passing on Testbox. A separate earlier native-slash failure was the SQLite WAL integrity guard killing a worker after unsafe fixture directory deletion, not an OOM; upstream fix 3deadc13f06 is retained unchanged. Required explicit returns, shared-helper mock exports and exact shrink-only baselines were repaired without weakening assertions; the corrected followup fixture passed 36/36, with a normal single-worker command measured at 28.15s on Linux.

Integrated review left no accepted findings; a command-alias finding was rejected with source evidence. The route/CLI, fixture and final four-file lint corrections received fresh independent reviews with no P0–P2 findings. Required formatting expands the session persistence object by six lines, reflected in the final 853-line reduction. The protected-path inventory union covers 1,866 paths, with 0 intersections and 0 new suppressions. Final local changed-check, suppression and cycle gates passed. Earlier full-project/build/API results retain the source qualifications above. Exact-head hosted CI and its job-level attribution remain the landing gate; hosted CI timing will be recorded when available.

Consolidate command projections, runtime presentation, queue settlement,
session publication, and delivery accounting while retaining caller-specific
authority, recovery, and replay boundaries. Revisit the previous pass with
measured shared-core trials and preserve public contracts and output text.

Remove 845 net production lines. Migrate only tests bound to retired private
presentation/count seams; retain their observable assertions.
@clawsweeper

clawsweeper Bot commented Oct 8, 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 Oct 8, 2026
@steipete

steipete commented Oct 8, 2026

Copy link
Copy Markdown
Contributor Author

Coverage 1 of 3 — rows 1–110 of 407

Final head: 0cbd6f542c1a80a7d9e5ebd0121bb6335e07041c; tree: 6fc7e092b47e026314b037d6b6577a2a1194c7ac, compared against base 35e5f4ab9818deb9347e2ec87c38aee8c05b3e05. The production reduction is 853 net lines (+1,851/−2,704 across 149 production files; 163 total changed paths). Local changed-check, suppression and cycle gates passed on this tree; hosted CI and landing status belong to the PR body.

Paths are relative to src/auto-reply/reply/. Positive delta means production lines removed. All 407 files retain their complete substantive disposition; Before/after columns use the final rebased production comparison. Formatted trial numbers inside dispositions are historical measurements and can differ from those counts. Named tests and proof targets identify required boundary coverage; they do not assert that every suite has passed at the final head. Validation status and remaining gaps belong to the main PR body.

File Before/after Δ Disposition
agent-runner-memory.ts 1416/1372 +44 Shared exact byte-snapshot projection, whitelisted entry selection, policy-key resolution and normalized token facts; moved the sole-call latch comparison into its transition owner and removed its repeated threshold proof. Preserved pre/post accepted session IDs, authority rechecks after each awaited read, compaction latch updates, detached maintenance, field presence and failure cleanup.
queue/drain.ts 1203/1158 +45 Retained shared aggregate lifecycle construction, origin-route projection, live restore predicate, lifecycle completion and queue-content reset. Admission-await boundaries, source-retirement order, aggregate owner timing, deferred-summary custody and rescheduling fences stay explicit. Proof: queue.collect, queue.drain-restart, queue.authority, queue.in-flight, queue/cleanup.session-authority. Broader aggregate-admission strategy trial 1165→1174 preserved summary once/current-owner versus collect repeat/captured-owner semantics, but added a stateful getter wrapper and nine lines; rejected after formatting. Ordered empty media appends remove six additional lines.
get-reply.ts 1193/1180 +13 Local command completion captures only its owning invocation context; all three early exits retain log/auth/return order. Repeated staging snapshot trial 1180→1183 rejected: exact post-import reads require a late-options callback, adding indirection and code.
session.ts 1144/1126 +18 Applied. One reusable base entry owns fresh/new defaults and selection carryover; one locked writer invocation; shared non-thread delivery projection; common canonical main key and actor facts; one explicit lifecycle-mutation type across the loop and locked attempt. Explicit, implicit, ACP, tombstone and admission-first branches retain their ID/fence rules. | session.test.ts; session.init-conflict-retry.test.ts; session.binding-activity.test.ts; session-hooks-context.test.ts; session.heartbeat-no-reset.test.ts; session.acp-reset-routing.test.ts; session.conversation-kind.test.ts
dispatch-acp.ts 770/764 +6 Bound-conversation predicate flattened; routed-count projection returns the same caller snapshot at four original accounting sites. Question-answer raw counts and record/idle ordering stay distinct.
reply-turn-admission.ts 755/756 -1 Retained one database-claim release catch for interrupted post-read admission and request-authority rejection (+1). Revisited error selection (755 -> 754) and shared barrier-result core (755 -> 764); rejected ternary/error indirection and a new async adapter that grows the owner. | reply-turn-admission.database-claim.test.ts; reply-turn-admission.store-owner.test.ts; reply-turn-admission.recovery.test.ts; reply-turn-admission.test.ts
reply-dispatcher.ts 750/738 +12 Retained existing custody owner for all four transition paths; each prepared/queued/unknown expected-state strategy remains explicit. Canonical per-kind mapper creates distinct settled-count records. Observer owner now exposes its settlement Promise: incidental observers stay void/nonblocking, error-delivery paths still await completion and swallow reporter failures. | before-deliver.test.ts (all custody/replay and raw/prepared cases); reply-settlement-observers.test.ts; reply-utils.test.ts; dispatch-from-config.final-outcome-counts.test.ts
reply-run-registry.state.ts 750/738 +12 Removed redundant activeSessionIdsByKey mirror, preserved reverse/current and historical wait indexes. Optional singleton collections initialize once at their retained owner instead of initializer plus fallback. Same-version global identity, old owning closures, completion observation, admission barriers, and callback order remain. Waiters are callbacks rather than private finish/timer wrapper objects; timer ownership stays in their closure. | reply-run-registry.retained-singleton.test.ts; reply-turn-admission.module-identity.test.ts; reply-run-registry.test.ts; reply-run-registry.successor-barrier.test.ts
dispatch-acp-delivery.ts 722/722 +0 Retired test-only count getter; production applyRoutedCounts returns its mutated snapshot. Nine unchanged-value test assertions now observe the production projection. Extra visible-block coverage core measured 722→723, rejected; sendPrepared/receipt owners already share direct/routed work.
reply-run-registry.message-injection.ts 708/702 +6 Retained shared pre-acceptance failure resolver for source preparation and pending-image cancellation. Accepted and indeterminate custody remain separate; V1/V2 method invocation stays live and has its original arguments and receiver. | reply-run-registry.visibility.test.ts; reply-run-registry.preparation.test.ts; reply-run-registry.question-registration.test.ts
reply-run-registry.operation.ts 701/696 +5 Removed all mirror-map writes. Plain and barrier completion share one core with optional barrier strategy: producer first, barrier chain next, immutable terminal result, exact clear, owner settlement last. Reflection-based public authority composition measured with companion file (1050 -> 1032) and rejected; explicit live getters remain. | reply-run-registry.test.ts; reply-run-registry.completion.cases.ts; reply-run-registry.abort.test.ts; reply-run-registry.control-owner.test.ts; reply-run-registry.backend-ready.test.ts
dispatch-from-config.choose-route.ts 701/696 +5 Shared fresh final-routing options for original and caption recovery sends; authority checks remain before each. One block-outcome publisher preserves queued/nonqueued and settled/pending variants.
agent-runner-result-payloads.ts 699/694 +5 Inlined the sole-call prepared-fallback wrapper into silent-fallback settlement, retaining mark-failed before preparation, typing and queue-drain order. Direct delivery, legacy tool evidence, pending child transfer, warning deferral and final-source suppression are distinct facts; formatted shared completion-priority trial grows its three owners from 1,797 to 1,812 lines (+15), so no extra adapter is retained.
agent-runner-run.ts 713/700 +13 Shared the exact media-scope projection with fallback execution. Kept gateway resolver ownership, admission release, early queue exits, typing cleanup and recovery claim timing.
agent-runner-execution.ts 709/696 +13 Shared media-scope projection without moving creation or the existing-context branch. Retained nested admission/finally owner, cross-candidate terminal settlement and live-switch retries.
get-reply-run-execute.ts 688/683 +5 Captured model override source owns its guard and queue projection; removed intermediate flag and redundant default branch. Media await remains after the same captured selection; all transcript and authority fields retain exact projections.
inbound-meta.ts 690/681 +9 Retained edit: Shared field/body transcript sanitizer with explicit mode; preserves field empty string versus body undefined, head-tail truncation, fence neutralization and all prompt bytes. Goal-block filtering has one branch and sender inclusion one predicate. | inbound-meta.test.ts; prompt-prelude.test.ts
reply-tool-authority.ts 681/664 +17 Retained shared sandbox classification params across sync, worker, and prepared-entry paths, with prepared fast path allocation-free; inlined one-use source identity assignment. Combined screen/theme target owner requires the existing prepared profile and lazily resolves pure policy once. Removed both retired internal target exports and migrated both callers, preserving screen capability gating and independent theme profile targeting. Explicit overlay copying remains: omission revokes old authority. Defaults-plus-rest trial (681 -> 684) preserves omission but grows code and adds object allocation/double writes. | reply-tool-authority.test.ts; reply-tool-authority.worker.test.ts; reply-tool-authority.snapshot.test.ts; reply-run-registry.preparation.test.ts; queue/delivery-context worker grouping proof
dispatch-from-config.lifecycle.ts 680/680 +0 Retained separate pre-dispatch/dispatch controllers, lifecycle lease, awaited owner/delivery sets and identity fences. Implemented tuple signal-cache trial 680→673, rejected for per-hit allocation and less clear numeric state keys; original cache hit allocates nothing.
directive-handling.impl.ts 677/667 +10 Retained shared model acknowledgement projection, common level queries with explicit valid/status option ordering, lazy ordered mode-event emission, and a redundant comparison-only cast removal. | Model acknowledgement precedes thinking remap; profile/runtime text, event order, commit-time authority, and touched fields unchanged. | directive-handling.model.test.ts; directive-handling.mixed-inline.test.ts
get-reply-run-admission.ts 652/641 +11 Applied. Shared prompt rebuild owns the unchanged trace label at all three original awaits; one live queued-operation predicate runs at every original selection/rebind check. Removed an immutable one-use body alias. Four terminal branches now use the runtime-owned cleanup helper, with lazy reply construction after cleanup. | get-reply-run-admission.session-file.test.ts; get-reply-run.media-only.test.ts; get-reply-run.prepared-metadata.test.ts
get-reply-inline-actions.ts 638/624 +14 Fully read. Shared leading-slash parser and one continuation result (638 to 624); command execution is conditionally entered, existing early terminal paths retained. When handlers are skipped, inlineCommand is absent and queue override remains undefined. Awaited skill authority check retained. Proof: inline-actions.skip-when-config-empty, tool-dispatch and abort-cutoff suites.
model-selection.ts 681/675 +6 Retained common cached/fresh thinking-catalog return, removed one-use thinking selection temporary, and grouped provider/model assignments. | Runtime-specific cache key, cached empty arrays, hydration admission, and both stored-pin reads unchanged. | model-selection.test.ts; model-selection.resolved-pin.test.ts; model-selection.exact-allowlist.test.ts
dispatch-from-config.gather.ts 627/622 +5 Flattened prepared transcript-binding selection; same live binding lookup and key normalization. Kept early diagnostic vs late hook identifiers across runtime awaits, and independent source/target/ACP session bindings.
restart-recovery-claim.ts 674/674 +0 Retained one process-local admitted-claim recording core (zero LOC change) with exact adopted run vs candidate tracking strategy. Preserves setEntry callback before run/source/session tracking and durable admission remains separately fenced. Removed unnecessary public-to-internal SessionEntry assertion: internal extension fields are optional. Rejected Boolean retired-restart rewrite, 627 -> 628. | restart-recovery-claim.test.ts; restart-recovery-claim.successor.test.ts; restart-recovery-claim.lifecycle.test.ts
followup-delivery.ts 600/600 +0 Retained source-versus-dispatch routing and completion selection. Route failures with held/ambiguous custody never fall through; cross-channel content remains private and terminal failure wins over supplements.
reply-run-registry.registry.ts 579/570 +9 All active IDs, keys and reset diagnostics derive from activeRunsByKey. Reverse lookup, wait aliases, generation fencing, exact captured interrupt ownership, and eviction fallback remain unchanged. Idle-waiter Set membership owns settlement without a duplicate boolean; native timer cancellation is unconditional and idempotent. End/reset callbacks use the shared direct callback representation. | reply-run-registry.retained-singleton.test.ts; reply-run-registry.test.ts; reply-run-registry.control-owner.test.ts; active-run-projections callers
dispatch-from-config.finalize.ts 565/563 +2 One suppression/heartbeat settlement exit handles disabled lanes, source policy, and duplicate finals. Policy/log/serialization order and dedupe insertion remain exact; late receipt/fallback authority remains explicit.
get-reply-directives.ts 562/548 +14 Retained direct reasoning default suppression, grouped mutable selection assignments, and removed assertions already guaranteed by config schema enums. | Unauthorized session/config reasoning remains suppressed; explicit-null edge preserved; target session and post-await selection still authoritative. | get-reply-directives.target-session.test.ts; get-reply-directive-aliases.test.ts
agent-runner-failure-reply.ts 562/561 +1 Removed repeat normalization before the private Codex failure matcher. Formatted known-failure constructor trial: 549 to 545, rejected because it adds twelve naming-only calls without consolidating classification; presentation-bearing/generic arms remain separate. Classification order, exact text and verbose disclosure retained.
followup-turn-execution.ts 538/528 +10 Shared item progress with the existing ordered visibility wrapper, adding explicit per-item admission; retained deferred callback lookup and this binding. Shared restart-sentinel message identity. Room-event/send-policy gates, queued authority, failure precedence and lazy detached draining remain.
dispatch-from-config.execute.ts 532/532 +0 Migrated raw progress send to narrowed caller-only delivery API. Kept continuation cleanup and resolver-finalization finally blocks, source-ordered callbacks, and the distinct post-adoption error path.
get-reply-directives-apply.ts 523/518 +5 Retained shared model acknowledgement owner, common temporary-unavailability sentence, grouped selection destructuring. | Focused model-only versus mixed atomic persistence, typing cleanup, acknowledgement order, optional fields, and abort checks unchanged. | get-reply-directives-apply.test.ts; directive-handling.model.test.ts
reply-media-paths.ts 521/514 +7 Retained shared file-URL error text (original cause variants), lazy sandbox promise assignment, shared missing-file class/code condition, and canonical filename sanitizer fallback. Personally inspected installed fs-safe filename.js: sanitizer trims and guarantees a nonempty fallback, making the second trim/fallback redundant. Staging and application authority / filesystem boundaries remain distinct. Proof: reply-media-paths and agent-runner media path cases.
reply-run-registry.contracts.ts 520/520 +0 No retained change. Actual shared error-factory draft grows 520 -> 523 and adds a prototype level to three public errors. V1/V2, sync/async, acceptance/outcome, and complete/barrier declarations encode distinct released contracts. | existing registry, abort, preparation and visibility test boundaries; production/core type graph
agent-runner-core.ts 517/498 +19 Shared the identical admission/execution input type instead of fourteen repeated fields; combined absent/replaced entry guards and condensed the typing cleanup rationale. Runtime completion/custody, generation-fenced refresh and queue cleanup unchanged.
agent-runner-cli-dispatch.ts 514/506 +8 Retained typed bridges. Assistant completion waits for previous deliveries; activity is unsuppressed; fast-auto has separate scheduling; one shared progress-bridge factory already handles eight streams. Formatted generic value-deduplication reader grows 509 to 524 lines (+15), so stream-local typed state stays explicit. Tightened the explanatory summary comment and removed duplicate final unsubscription: success and catch already call the common stop owner, which unsubscribes before draining. Inspected the bridge and event-listener cleanup implementations.
dispatch-from-config.prepare-context.ts 513/508 +5 Retained common base outcome projection, shared source-policy request input, and removed duplicate attempted-session-id state. Formatted result-callback draft (-1) superseded by simpler base projection (-2), then final trial (-5). | Counts are read before optional detail predicates; lastOwner already stores the exact attempted session id; duplicate/retry/admission checks, lifecycle order, optional keys and output policy stay unchanged. | dispatch-from-config.lifecycle.test.ts; dispatch-from-config.delivery.test.ts; dispatch-from-config.pending-restart.test.ts; dispatch-from-config.source-completion.test.ts
commands-diagnostics.ts 500/467 +33 Applied shared plugin command context projection with commands-plugin; all fields and command-specific session inventory remain. Revisit duplicated exec setup. Proof: commands-diagnostics.test.ts.
commands-session.ts 493/484 +9 Applied canonical expiry call at both callers and shared failure wording (493 to 484), retaining Date-valid bound checks and clock reads. Full two-variant lifecycle strategy including typed updater callbacks measured 493 to 508 (+15), rejected; formatted trial retained. Proof: commands-session-lifecycle.test.ts, commands-session-usage.test.ts.
get-reply-run-context.ts 490/481 +9 Applied. Direct/group prompt variants share prepared inputs. Initial and post-wait goal/user-context projections share one core while preserving cached-first and fresh-after-wait lookup priority. Two terminal branches use the shared cleanup helper. No prepared-context or execution interface change. | get-reply-run.media-only.test.ts (goal refresh, media indexes after waits, stable CLI facts, empty/blocked input); source-reply-delivery-mode.test.ts
block-reply-pipeline.ts 480/472 +8 Retained shared dedupe identity, one source normalization per hasSentPayload query, and common attempt scan with optional index bound. Seen/pending/sent mutation order, status/terminal distinctions and source occurrence identity preserved. Identity trial 480→482 improved to 479; source/attempt trial 472. Broader shared receipt-success predicate across three owners added eight aggregate lines (881→889), rejected and restored. Proof: both block-reply-pipeline suites and reply-delivery source recovery.
queue/delivery-context.ts 479/485 -6 Retained explicit origin-route projection shared with drain and overflow cloning; exact eight-field whitelist includes own undefined fields. All non-route overflow exclusions retained; empty/singleton current context path merged. The shared personal-tool target change adds +3 lines here; storageKey still evaluates before screen/theme projection. Proof: queue.collect route/isolation/retry tests, queue/cleanup.session-authority compact-source tests.
stage-sandbox-media.ts 477/477 +0 Retained source: Retained existing common bounded read/destination preparation. Local root admission must precede reading; remote exclusive publication and SCP cache preservation remain distinct phases. No duplicate copy owner remains to collapse. | stage-sandbox-media.history.test.ts; stage-sandbox-media.scp.test.ts
agent-runner-result-accounting.ts 472/472 +0 Retained terminal accounting sequencing: group state, block flush, tool drain, usage, fallback state, compaction, live-switch consolidation. Runtime-selected model is distinct from finalizer billing model.
agent-runner-execute.ts 469/469 +0 Retained before-agent-reply checkpoint and source intent publication. Explicit observer snapshot and live session getters serve separate temporal facts; nonsettled compaction accounting precedes supersession exit.
commands-models-catalog.ts 469/470 -1 Applied one selected-first catalog array reused by per-model lookups and returned dedupe. 469 to 470 (+1) avoids rebuilding the full array for every model; synchronous owner projection and ordering unchanged. Decision owner inspected and remains read-only. Proof: commands-models.test.ts and commands-models.catalog-recovery.test.ts.
agent-runner-cli-candidate.ts 464/449 +15 CLI eager previews now use canonical presentation mode. Initial authority, native block bridge, session fork/binding settlement and transcript policy remain adapter-owned. Four timeout/exec fields tried in shared run-state projection and restored because it crossed the vision await.
commands-tts.ts 460/458 +2 Applied shared token/tail parser; explicit tail whitespace collapse retained. Hoisted lowercase draft rejected (458 baseline, 456 draft): adds unnecessary whole-audio-text normalization. Draft retained. Proof: commands-tts.test.ts.
followup-turn-admission.ts 462/456 +6 Shared restart-sentinel/current-source message identity through existing utils owner. Preserved preflight generation assertions, one deferred lifecycle identity and terminal notice publication after adoption.
commands-context-report.ts 453/438 +15 Applied one list/detail heading and footer assembly plus canonical asPositiveFiniteNumber for both bootstrap limits. 453 to 438. Detail-only blank-line filtering, map, JSON and transcript behavior unchanged. Proof: commands-context-report.test.ts.
commands-compact.ts 450/448 +2 Applied shared reason-optional final status line (450 to 448), preserving exact displayed/system-event text. Awaited authority/generation checks remain at each original boundary. Proof: commands-compact.test.ts, commands-compact.lifecycle.test.ts.
commands-acp/lifecycle.ts 448/447 +1 Applied one ACP steer confirmation with optional bounded output suffix (448 to 447). Both owner assertions and awaited guard remain. Proof: commands-acp.test.ts, commands-acp.owner.test.ts.
agent-runner-payloads.ts 444/439 +5 Moved Bun socket text matching/rendering into its sole consumer, retiring two utility exports and heavy utility import. Simplified internal fragment accumulation and exact rich-content result. Retained captured/live streaming facts after a concrete zero-gain trial exposed an await boundary. Media retry custody and directive/text bytes unchanged.
context-treemap.ts 444/442 +2 Retained edit: Revisited prior rejected RGBA fill: per-row Buffer.fill now shares pixel encoding, with empty/out-of-bounds/NaN rectangles explicitly skipped. Formatted 444 to 442. Font, labels, colors, layout and PNG dimensions unchanged; byte comparison deferred to frozen proof. | frozen old/new PNG byte differential via renderContextTreemapPng; commands-context route
commands-allowlist.ts 440/438 +2 Removed unused cfg argument to mutation owner and one-use editScope alias. Config/store gates and captured plugin edit callback remain at existing boundaries. Proof: commands-allowlist*.test.ts and commands-config.owner.test.ts.
route-reply.ts 435/426 +9 Retained common suppression-result constructor across reasoning, normalization, empty and hook-suppressed paths. Reasonless results omit suppressed/reason exactly as before; ambiguity and failed custody outcomes remain distinct. Raw/prepared lazy load boundary preserved. Proof: route-reply, delivery-result, prepared and recovery-owner suites.
get-reply-native-slash-fast-path.ts 429/419 +10 Fully read. Shared leading-slash grammar plus fresh command-scope projection for status/command/inline invocations (429 to 419); helper rereads at each original call site after awaits. Model/default/session targets stay variant-owned; no get-reply.ts edits. Proof: native-slash-fast-path.test.ts and status suite.
progress-narrator.ts 423/423 +0 Retained source: Reimplemented generic callback tee twice: 423 to 420 via Function.call, 423 to 422 with direct receiver-preserving callbacks. Rejected both as less clear: two generic parameters plus getter/adapter indirection replace three explicit event mappings. Gates, retry ownership and late-turn fencing remain explicit. | progress-narrator.test.ts; progress-narrator-model.test.ts
commands-models.ts 414/412 +2 Applied one numeric option parser for page/size/limit (414 to 412), preserving index-zero provider handling, malformed inputs, clipping, all flag and ordering. Public header contract untouched. Proof: commands-models.test.ts and commands-models-order.test.ts.
agent-runner-utils.ts 410/410 +0 Retired the single-consumer Bun helpers; shared queued current-message identity for admission/execution through an already-loaded owner. Threading adapters still own explicit undefined and policy/authority projection.
mentions.ts 410/406 +4 Retained edit: Warning cache inserts once after equivalent full-cache rollover. Compile-cache insertion remains ordered after warning callbacks, including reentrant changes. Structural-prefix normalization chooses its whitespace regex once; slash newlines and all mention regex semantics retained. | mentions.test.ts; existing directive-only and session-reset-command boundary suites
agent-runner-trace.ts 407/404 +3 Removed unreachable nonpositive segment guard (both private callers pass positive lengths) and already-proven nonempty prompt-block guard. Formatted shared fence renderer grows 404 to 412, rejected; per-block formatting/escaping and exact trace bytes retained.
dispatch-from-config.prepare-operation.ts 404/404 +0 Retained shared fast-command and plugin-settlement owners. Plugin missing/declined/error cases have different transcript admission, observer order and final-count timing; current shared cores already contain common effects. Live binding/authority rechecks remain separate awaits.
queue/enqueue.ts 403/403 +0 Retained one append path for existing/new elision buckets (403→403); compact source, line and weak original-source mapping remain index-aligned before cap trimming. No await/callback introduced around publication. FIFO steering and lifecycle/dedupe ownership unchanged. Proof: queue.collect, queue.dedupe, enqueue.steering, cleanup.session-authority.
abort-operation.ts 479/467 +12 Retained inline single-use ACP binding adapter at its only consumer (-12), including absent-binding await and both existing fallback flags. Queue clear loop remains before all native cancellations; ACP initiation remains in finally before drain, and all cancellations are joined. No currentness guard moved. | abort.target-owner.test.ts; abort.acp-boundary.test.ts; abort.test.ts
commands-acp/shared.ts 391/380 +11 Applied closed Result for private option parse: no match=null, malformed=error, valid=value; removes optional error/value state and matched mirrors. Spawn/steer whitespace, unicode flags, messages and result shapes stay unchanged. Capabilities keeps empty-string-list behavior. Proof: commands-acp/shared.test.ts, commands-acp.test.ts.
acp-projector.ts 385/380 +5 Retained one text buffer selected by immutable dispatch mode instead of two mutually exclusive buffers. Mode is captured once; live idle/boundary flush vs final-only gate/snapshot behavior remain distinct. Removed redundant private live-helper mode guards and idempotent timer-cancel guard. Output budget, UTF-16 truncation, hidden boundaries, dynamic tool gate and dedupe are unchanged. | acp-projector.test.ts (entire file); dispatch-acp.test.ts; dispatch-acp.owner.test.ts
directive-handling.shared.ts 380/380 +0 Retained model-ack label ownership, direct channel precedence, one snapshot application result, and elevated array initialization. Resettable-field helper rejected: 394 vs 380 lines (+14). | Snapshot equality is evaluated before adoption; explicit touched writes and privilege checks preserved; resettable truthy versus defined checks remain exact. | directive-handling.model.test.ts; directive-handling.session-list.test.ts
agent-runner-steer-adoption.ts 378/375 +3 Inlined the sole-call parked-fallback scheduling wrapper at its original synchronous point before admission release. Retained parked custody and exact injection identity. Initial and post-await operation/backend checks are separate live observations; fallback policy, indeterminate outcome and finalizer cleanup must not merge.
commands-login.ts 370/370 +0 Full read: live and persisted adoption already share canonical decision. Current readConfig and authority closures intentionally resolve at different times; no cached owner/config snapshot introduced. Proof: commands-login*.test.ts.
dispatch-from-config.prepare-execution.ts 372/372 +0 Migrated raw progress send to narrowed API. Callback wrapper already shares argument/callback gating; start-order release differs from completion and must retain its deferred owner. Sync plugin getter and async refreshed visibility remain separate contracts.
agent-runner-fallback-candidate.ts 363/353 +10 Shared whitelisted run-entry selection with memory maintenance. Candidate resets, source-policy runtime binding, fallback steering authority, start callback retirement and capability revocation unchanged.
session-updates.ts 362/343 +19 Applied. Moved cache publication to the existing entry-handle owner; first-turn and refresh branches share exact persistence request construction and empty-entry defaults. Resolve counts, caller checks and current-row reads stay in their original order. | session-updates.test.ts; session-updates.exec-preparation.test.ts; session-updates.lifecycle.test.ts Required formatting after the private callback parameter rename expands the persistence request by 6 lines (337 to 343).
agent-runner-embedded-candidate.ts 350/325 +25 Embedded lazy previews now use canonical presentation mode. Enumerable memoized text getter, media presence, empty false result, sanitizer timing and typing/callback ordering preserved. Compaction facts remain finally-owned.
reply-run-registry.tool-authority.ts 346/346 +0 No retained change. Public-field composition draft grows this file 346 -> 348 while removing forwarding elsewhere, but needs descriptor reflection and transient getter reads; no clearer owner results. Snapshot/route admission retain pre/post-await owner, generation, backend, route and fingerprint checks. Combined participant/release state draft (346 -> 343) rejected because retention and participant publication have distinct reentrant commit points. | reply-run-registry.preparation.test.ts; reply-tool-authority tests; agents/harness/tool-authority.runtime.test.ts
queue/types.ts 332/313 +19 Retained exact Pick for identical runtime field types; queue-required fields and narrower nullable/exec/readonly variants remain explicit. Baseline retained. Exact type equivalence and public API evidence pending frozen proof.
followup-runner.ts 328/328 +0 Retained admission/consumption/delivery cleanup owner. Closed execution consumes before accounting; source terminal callback occurs once and failed terminal handling refuses replay.
bash-command.ts 325/325 +0 Retained source: Run, poll and stop paths already share scoped lookup, snippet and output renderers. Their different text, final-delivery acknowledgment and cancellation side effects are kept in the owning branch; a shared reply object would need a branch-specific producer without eliminating another owner. | bash-command.stop.test.ts
reply-payloads-dedupe.ts 316/314 +2 Retained common origin-route channel/account projection with explicit target/thread overrides and direct optional-provider result. Callback normalization order and scoped evidence fallback unchanged. Proof: reply-payloads and reply-payloads-transport-dedupe.
dispatch-from-config.prepare-delivery.ts 313/306 +7 Narrowed sendPayloadAsync to its three actual tool-progress callers and fixed mirror=false at the shared tool/block sender; removed unused kind/intent/abort/mirror wrapper parameters. Prepared/raw routes and durable recovery remain in the existing operation core.
commands-export-session.ts 312/312 +0 Removed redundant AgentSessionEntry assertion from a discriminant-preserving spread; runtime bytes unchanged (312 to 312). Template placeholder substitution and exported transcript shape unchanged. Proof: commands-export-session.test.ts plus production typecheck.
queue/state.ts 312/314 -2 Retained shared queue-content reset and completion iteration. Tried ordered lazy run visitor: formatted 312→315; rejected added owner wrapper/lines, byte-restored before retained reset changes. Proof: queue/state tests plus stale retirement and restart drain.
model-selection-directive.ts 308/296 +12 Retained one selection builder with explicit alias source, one final fuzzy/explicit result projection, and removed one-use variant array/slash-only lowercasing. Normalized score-key alias shortcut rejected. | Fuzzy lookup uses original provider spelling, explicit lookup uses resolved alias; optional alias omission, rank order, policy calls unchanged. | model-selection-directive.test.ts; directive-handling.model.test.ts
history.ts 304/304 +0 Retained source: Pending/history builders already share the map/entry owner. Rechecked fresh HistoryEntry whitelist: optional fields must stay absent when false/empty, and map-spread projection is barred by the existing allocation guard. SDK aliases remain shipped contracts. | history.test.ts
commands-approve.ts 294/277 +17 Applied one ordered decision parse result and one channel-behavior/owner refusal result across no-method and exhausted-not-found cases (294 to 277). Gateway probe order/current owner revalidation unchanged. Proof: commands-approve.test.ts.
dispatch-from-config.harness-defaults.ts 293/271 +22 Retained one lazy level-precedence core, one full/any async completion predicate, shared exact model context, shared group classification, and direct heartbeat conditional. Formatted trial removes 22 lines. | Sync per-turn override still avoids a store read; async always performs the worker path and revalidates before/after it and after the outer await; current run verbosity is read after await. Model selection and visible-delivery precedence stay exact. | dispatch-from-config.verbose-worker.test.ts; dispatch-from-config.turn-model-selection-differential.test.ts; dispatch-from-config.test.ts
commands-plugins.ts 291/287 +4 Shared JSON rendering and derive enabled from the already-discriminated enable/disable action in the mutation owner; removes invalid redundant input state. Snapshot/lease/consent/afterWrite behavior unchanged. Proof: commands-plugins.test.ts and install suites.
session-reset-command.ts 291/286 +5 Applied. Removed redundant string guard ahead of the canonical unknown-input normalizer. Nonempty normalized prefix means absent candidates cannot match. Removed the empty-source early exit: this private payload parser is only called for nonempty normalized triggers, and the anchored trigger owner already returns undefined for empty input. Envelope and raw-payload positions unchanged. | session.test.ts RawBody and reset authorization groups
agent-runner-error-handler.ts 290/290 +0 Retained one terminal failure settlement core with separate live switch, restart and compaction branches. These branches have different model-patch and lifecycle obligations; error copy priority unchanged.
agent-runner-result-complete.ts 287/287 +0 Retained replay-intent creation and delivery metadata. Heartbeat, private source, blocked hook and command-owner recovery require distinct payload facts; persistence remains fenced to expected session identity.
directive-handling.model.ts 286/276 +10 Retained common current/active heading, removed guaranteed-empty summary element/filter, and normalized optional model text once. | Current/active labels, summary/status text, channelData omission, catalog/auth ownership and model order unchanged. | directive-handling.model.test.ts; directive-handling.model-status.test-support.ts
agent-runner-event-handler.ts 283/283 +0 Retained source-tool progress suppression and compaction status owner. Tool start, completion item, approval and patch projections intentionally retain distinct field presence; optional callbacks stay lazy.
commands-system-prompt.ts 280/280 +0 Full read: sandbox-only fallback and fresh eligibility closures preserve inspection boundaries; prompt construction remains unchanged. Proof: commands-system-prompt*.test.ts.
commands-info.ts 276/274 +2 Applied common More /commands prefix with optional remainder count (276 to 274). Inventory disposal and skill-load boundaries unchanged. Proof: commands-info.test.ts.
startup-context.ts 273/273 +0 Retained source: Date selection, bounded file read and budget fitting each have one owner. Reading files eagerly before fitting preserves later I/O errors. Truncation binary search is already shared by all memory files; no behavior-preserving duplicate pipeline remains. | startup-context.test.ts
dispatch-from-config.block-reply.ts 271/270 +1 Updated prepared block call for fixed mirror policy; same block kind, abort and durable intent. Retained distinct routed receipt vs queued receipt callback timing and pending text source ownership.
reply-delivery.ts 263/250 +13 Retained named handler-local direct custody owner, removes per-call dependency projection; no await boundary removed. Preserves insertion-before-send, callback arity, receipt mutation, intent retry throw and terminal confirmation. Proof: reply-delivery concurrent/independent/completed/source-recovery tests.
conversation-turn-capture.ts 261/261 +0 Retained source: Correlation, durable reply commit and optional audit artifact are separate ordered effects. The three reply/thread projections cannot spread the whole input without adding transport/private fields; each exact output shape remains explicit. | conversation-turn-capture.test.ts
model-runtime-normalization.ts 257/253 +4 Completed second pass; retained direct normalized-runtime return and removed filename narration. Existing runtimeFacts already supplies the shared runtime projection; owner/async boundaries retained. | Runtime choice and hydration await boundaries, selected literal model identity, ready-result optional keys unchanged. | model-selection.test.ts; directive-handling.model.test.ts
prompt-prelude.ts 252/248 +4 Retained edit: Revisited prior rejection and retained one body-annotation core for prefixed and queued prompts: 252 to 248. Media prelude runs before live provenance lookup in the original order. Runtime/transcript/resumable-room bodies remain separate byte contracts. | prompt-prelude.test.ts; get-reply-run-context tests
strip-inbound-meta.ts 243/243 +0 PROTECTED RETENTION: scripts/pr import-closure boundary; inspected, never edited, byte-identical to pinned base. | protected-path byte comparison and scripts/pr wrapper closure gates
agent-runner-run-params.ts 241/280 -39 Owns explicit media-scope and run-entry selection whitelists. Both have production callers; exact config/auth/account/group/requester fields retained. Early shared timeout/exec trial rejected after inspecting await timing.
dispatch-from-config.audit.ts 242/228 +14 Shared identical failure and abort terminal envelopes with explicit reason selection. No audit owner/storage/collection change; exact vocabulary, property order, priority and fallback remain. Private baseline differential required before publication.
queue/cleanup.ts 270/266 +4 Retained shared lifecycle completion with caller-supplied error continuation; all accepted detachments settle before authority revalidation. Proof: queue/cleanup.session-authority callback-revoke cases.
conversation-label-generator.ts 240/240 +0 Retained source: Measured resolved-input sharing trial: 240 to 244 after formatting. Rejected longer wrapper; runLabelAttempts remains the shared selection/completion/retry owner, with utility-only preclaim and current-authority checks unchanged. | conversation-label-generator.test.ts
commands-private-route.ts 235/239 -4 Applied shared exec-approval defaults for diagnostics/trajectory; the builder rereads current command/config inputs per call, with no new runtime imports/awaits. The initial extraction made the combined helper and callers shrink by 8 lines. The subsequent reviewed correction inlines the five route fields at their existing evaluation position and removes the obsolete resolver/signature (257 to 239, 18 fewer production lines). Reviewer custody, private outcomes, nullish channel/to/account handling, thread conversion and property/evaluation order are preserved. Proof targets: private-route, diagnostics, export-session and gateway approval suites; final-head validation remains pending.
commands-goal.ts 234/218 +16 Applied one create/edit objective/result core with distinct storage calls and create-only continuation; shared action parser retains unknown-action-as-objective and multiline tail. 234 to 218. Proof: commands-goal.test.ts; embedded backend consumer inspected.
dispatch-from-config.context.ts 229/228 +1 Retained direct Boolean group predicate (-1); binding read/revalidation and reset authority owners remain unchanged after full review. | Known group/channel still skips fallback group lookup; direct/unknown still queries it. Before/after binding-route assertions and worker-read authority remain intact. | dispatch-from-config.owner-metadata.test.ts; dispatch-from-config.binding-activity.test.ts; dispatch-from-config.restart-tombstone.test.ts
commands-acp/runtime-options.ts 228/228 +0 Read full setter/status/reset module and dedicated runtime-option command cases. Six variants already share SINGLE_RUNTIME_OPTIONS and one parse/target/error owner; status/reset use existing optional-target resolver and error boundary. No additional implementation retained; do not remove its awaited resolver layer.

@steipete

steipete commented Oct 8, 2026

Copy link
Copy Markdown
Contributor Author

Coverage 2 of 3 — rows 111–242 of 407

Final head: 0cbd6f542c1a80a7d9e5ebd0121bb6335e07041c; tree: 6fc7e092b47e026314b037d6b6577a2a1194c7ac, compared against base 35e5f4ab9818deb9347e2ec87c38aee8c05b3e05. The production reduction is 853 net lines (+1,851/−2,704 across 149 production files; 163 total changed paths). Local changed-check, suppression and cycle gates passed on this tree; hosted CI and landing status belong to the PR body.

Paths are relative to src/auto-reply/reply/. Positive delta means production lines removed. All 407 files retain their complete substantive disposition; Before/after columns use the final rebased production comparison. Formatted trial numbers inside dispositions are historical measurements and can differ from those counts. Named tests and proof targets identify required boundary coverage; they do not assert that every suite has passed at the final head. Validation status and remaining gaps belong to the main PR body.

File Before/after Δ Disposition
typing.ts 228/228 +0 Retained source: Retained explicit scheduleTyping promise boundary after rechecking prior inlining rejection. Start, TTL, idle and sealed state each own different lifecycle moments; common guards are already combined. No timer/await cadence changed. | typing-policy.test.ts; typing-persistence.test.ts
dispatch-acp-payload.ts 227/227 +0 Existing delivery/TTS/visible-text helpers already share ACP payload ownership. Delivered vs recovered source sets answer different questions; pending-source removal and partial block recovery order retained.
dispatch-from-config.payloads.ts 227/227 +0 One normalized side-effect preparation and finalization-aware TTS owner. Kept explicit dedupe/public payload whitelist and status/media/approval checks; no new field dropping or whole-payload spread.
get-reply-fast-path.ts 223/220 +3 Fully read. Completeness is checked once before strict fast-test admission; three normalized metadata values reused (223 to 220). Selective reset lineage/selection fields retained; no whole-entry reset spread. Proof: get-reply.fast-path.test.ts and get-reply.config-override.test.ts.
inbound-context.ts 217/217 +0 Retained source: Measured typed loop over six homogeneous text fields: 217 to 221. Rejected because it adds a key inventory and loop to six direct assignments. SDK/deprecated media normalization already has one implementation with explicit preserveLegacyMedia. | inbound-context-marker.test.ts; inbound-context.test.ts
directive-handling.model-selection.ts 214/205 +9 Retained positive-delimiter/nonempty-prefix invariant, direct optional profile result, successful validation fallthrough, and removed filename narration. Numeric/profile provider checks remain intact. | Eight-digit version/profile disambiguation, auth provider equivalence, and current model/account authority preserved. | directive-handling.model.test.ts
get-reply-directives-routing.ts 213/208 +5 Retained shared parse policy and status cleanup for command and sender source. | Parse order, group privileged filtering, verified sender-only projection, repeated status stripping, and raw prompt bytes preserved. | get-reply-directives-routing.test.ts; reply.directive.parse.test.ts
block-reply-coalescer.ts 209/197 +12 Retained overflow replacement strategy plus shared source text/range merge for text/media. Captured source fields precede synchronous flush reentry; overflow replaces reentrant buffer, normal append merges it, transport joiners never count as source bytes. Existing idle timer clear accepts undefined. Trials: overflow-only 207, source core 200, final cleanup 197. Proof: reply-utils coalescer cases; block-reply-pipeline source coverage; frozen reentry differential probe needed.
post-compaction-context.ts 209/209 +0 Retained source: Measured extracted reader owner preserving bridged/direct UTF-8, size diagnostics and close behavior: 209 to 217. Rejected one-caller indirection. Section extraction remains common to H2/H3; distinct reader protocols remain in one function. | post-compaction-context.test.ts
commands-acp/bindings.ts 205/205 +0 Full read: optional builder absence avoids await; bind/current/thread strategies preserve policy, current-binding expectation and assertions. Prior optional await draft remains rejected for scheduling. Proof: commands-acp*.test.ts.
steering-delivery-preparation.ts 205/198 +7 Retained edit: Actor/native current steering reads share one prepare-and-capture adapter, 205 to 198. Their supplied assertions still execute before capture and remain installed as both prepared/legacy assertions. Persistent worker preparation is unchanged. | config/sessions/session-sharing-store.incognito.test.ts; agent-runner-steer-adoption.worker.test.ts; gateway/server-methods/chat-send-message-injection.test.ts
commands-config.ts 204/203 +1 Applied combined set/unset mutation owner and shared JSON rendering; missing unset still skips write; redaction remains before output. Proof: commands-gating.test.ts, commands-config.owner.test.ts.
commands-acp/diagnostics.ts 203/203 +0 Full read and doctor/status tests inspected. Ordered doctor and session projections already data-driven; current owner assertions bracket each awaited session/binding read. No duplicate decision/state owner remains.
source-reply-delivery-mode.ts 203/203 +0 Retained source: Existing mode and expectation functions share the canonical command and synthetic-turn classifiers. Stable-session resolution deliberately projects sender-independent fields; collapsing with live resolution would require keeping the same explicit projection and extra mode flags. | source-reply-delivery-mode.test.ts
block-streaming.ts 202/202 +0 Actual shared character-bounds trial 202→205 after formatting; rejected greater size and extra bounds wrapper. Preserved floor defaults versus rounded effective overrides and channel/account precedence. Proof: block-streaming.test.ts.
dispatch-from-config.ts 200/200 +0 Retained typed stage exits under one error/retry/admission-ticket owner. A loop across heterogeneous stages would require widening/casts and obscure which preparation errors are lifecycle-owned. One session-refresh retry remains exact.
session-reset-model.ts 200/196 +4 Applied. Uses the shared entry publication owner after snapshot adoption, retaining handle/store/key captured before persistence awaits. | session-reset-model.test.ts; session-entry-persistence.test.ts
memory-flush-prepare.ts 198/198 +0 Retained exact override route, selected-slot audience/delegation and detached target preparation. File/tool variants share admission but differ in provider audience and writable target eligibility.
reply-threading.ts 198/198 +0 Retained source: Mode filter already shares preview/send core. Off-mode clearing and first-slot suppression have different metadata contracts; existing projected clones are minimal and account/channel precedence remains explicit. | reply-threading.test.ts
get-reply-run-helpers.ts 196/190 +6 One ordered available-index pool replaces image list, suppression lookup and used-index ownership. Successful delete admits exactly one unsuppressed image, positional inference selects the oldest remaining index, and unclaimed indexes remain offloaded in original order. Suppressed arrays and empty-layout presence unchanged. Added the coordinated finishReplyPreparation terminal owner (+7 helper lines, offset by -11 in sessions-owned admission/context callers): synchronous typing cleanup precedes its optional lazy reply factory.
agent-runner-auto-fallback.ts 195/191 +4 Simplified the timestamp-only comparison and removed an unreachable absent-current-entry branch after the exact cache identity fence proves the captured active entry still applies. Delete-versus-undefined and no-store fast path remain distinct shipped state behavior.
commands-reset.ts 194/192 +2 Applied common ACP success/failure status-notice construction (194 to 192); success-only callbacks/tail rewrite and failure logging remain exactly ordered. Soft reset selective fields preserved. Proof: commands-reset-hooks.test.ts.
session-delivery.ts 193/187 +6 Applied. Direct-key variants select the first direct/dm marker among the first three parts, then share channel/account/tail checks. Strict peer/thread-tail validation also handles short input; absent/empty keys reach the same no-marker outcome without duplicate guards. Main/internal/inter-session routing unchanged. | session-delivery.test.ts; session.test.ts delivery groups; differential direct-key matrix after freeze
session-usage.ts 193/189 +4 Applied. Inline one-use normalized values into the existing update projection and use the optional onCommitted callback directly. Both writer APIs forward options.onCommitted identically; monetary/context/visible-state policy and all authority checks unchanged. | session.test.ts persistSessionUsageUpdate; session-updates.lifecycle.test.ts; agent-runner-result-accounting.persistence.test.ts
agent-lifecycle-terminal.ts 192/192 +0 Retained source: Pending/captured/emitted union already owns terminal lifecycle. Shared prepareTerminal handles success/error/restart with explicit metadata rules; capture and publish are separate authority moments and cannot use one mutation. | agent-lifecycle-terminal.test.ts
groups.ts 192/186 +6 Retained edit: Direct-chat variants now render their exact line sets through one join; group intro initializes its first line directly. All strings and lazy plugin lookup stay unchanged, 192 to 186. | groups.test.ts; prompt-session-context.test.ts
agent-runner-fallback-settlement.ts 191/191 +0 Retained one lifecycle error publisher plus explicit settled backstop. Abort drain, host terminal commitment, model-patch capture and terminal metadata have different ordering and may not be combined.
dispatch-from-config.turn-ledger.ts 188/188 +0 Prepared/raw sends already converge at one capture+record owner. Source outcome and terminal delivery differ; admission/unknown receipts cannot derive confirmed delivery. Receiver-preserving sender table would add map setup without reducing the nine-line selector.
normalize-reply.ts 187/184 +3 Retained removal of exact-silence recheck after broader isSilentReplyPayloadText already excluded it (or cleared text). Silent/heartbeat/speech and transform-owner stages remain distinct. Proof: reply-utils normalization tables and normalize-reply.heartbeat.
session-conversation-binding.ts 187/184 +3 Applied. Account and missing-channel early returns share one branch. Rejected common mismatch assertion draft grew 2 lines beyond that edit; predicate draft also grew 2 lines. Prepared route facts and all observation checks remain intact. | session.binding-activity.test.ts; dispatch-from-config.binding-activity.test.ts; dispatch-acp.owner.test.ts
commands-export-trajectory.ts 186/171 +15 Applied common exec-approval defaults with diagnostics (186 to 171). Private target before exec, agent-mode followup, session identity, timeout capture and encoded request key order unchanged. Proof: commands-export-session.test.ts imports trajectory support.
reply-elevated.ts 186/179 +7 Retained edit: Global and per-agent authorization now share the same isApprovedElevatedSender call with an explicit allowFrom argument. Global rejection still precedes agent evaluation; callback lookups, identity semantics and failure text remain unchanged, 186 to 179. | reply-elevated.test.ts; get-reply-directives target-session tests
directive-handling.parse.ts 182/182 +0 Retained ordered parser and exact projection inventory. Formatted generic projection trial is 202 vs 182 lines (+20), with a new mapped assertion and no caller simplification. | Think/verbose/trace/fast/reasoning/elevated/exec/status/model/queue order and full own-property projection must remain exact. | reply.directive.parse.test.ts; get-reply-text-slash-directives.test.ts
queue/lifecycle.ts 182/198 -16 Retained shared completion iteration with explicit onError strategy; fail-fast remains default, cancellation callers continue after logged errors. Individual lifecycle/admission/heartbeat behavior untouched. Actual shared lifecycle-flag core trial 198→211; rejected thirteen extra lines and indirect flag access, restored independent weak sets/maps. Proof: lifecycle.test and queue.collect admission/heartbeat/callback-order cases.
current-turn-images.ts 179/179 +0 Retained source: Ordered append already shares one core; source index and sequence have different stable-sort duties. Current unresolved slots and extracted inline slots cannot be collapsed without retaining the same tagged identity. | current-turn-images.test.ts
command-gates.ts 177/181 -4 Added shared JSON block renderer consumed by MCP/plugins/config/debug. Existing authorization wrapper sequencing untouched. Proof: command and config/MCP/plugin suites.
commands-btw.ts 176/176 +0 Full read: capability finally owner and conditional absent fields preserved. Two same-condition message channel/provider one-liners would become a larger multiline object; no separate state/decision core is duplicated. No edit retained.
agent-runner-presentation.ts 175/209 -34 Added one partial-reply operation with explicit CLI eager/embedded lazy modes; removed old classifier/sanitizer exports. Real typing/presentation authority fence and media-block handler unchanged.
agent-turn-attachments.ts 173/173 +0 Retained source: Current/history image reads already share resolveImageAttachment. The described-current-image path intentionally suppresses history fallback; replacing the two loops with a combined list would need the same selection state and extra tagging. | existing reply subsystem boundary suite and changed types/checks
prompt-session-context.ts 172/172 +0 Retained source: Measured typed copy loop/helper for ten-field conversation snapshot: 172 to 178. Rejected larger implementation; explicit field whitelist preserves stale-route isolation and absent inherited metadata. | prompt-session-context.test.ts
commands-mcp.ts 171/168 +3 Applied common JSON renderer (171 to 168). Concrete generic mutation-result core including both call sites measured 168 to 173 (+5), rejected; typed set/unset result and not-found text remain explicit. Trial retained. Proof: commands-mcp.test.ts and config owner suite.
memory-flush.ts 171/165 +6 Shared configured provider/model api, base URL and context-window facts, with explicit Anthropic versus Responses defaults and exact optional field presence. Formatted trial 171 to 169 accepted; condensed the one-flush-per-cycle comment. Transport source and parity tests inspected.
session-stable-reply-mode.ts 167/163 +4 Applied. One profile-policy preparer retains explicit profile and additive allow-list inputs and original resolution order. Canonical delivery readers already accept absent entries, so redundant wrappers are removed. | source-reply-delivery-mode.test.ts; get-reply-run.media-only.test.ts; dispatch-from-config reply policy tests
commands-learn.ts 153/153 +0 Full read: CLI and native-runtime policy already converge on one workshop availability decision; sandbox and personal authoring outcomes are distinct. Proof: commands-learn.test.ts.
message-injection-authority.ts 164/164 +0 Retained source: Admission/consumption/accepted-unconfirmed and revoked authority are separate outcomes. Queue release and promise settlement already share the keyed queue; merging distinct Error subclasses would change prototype contracts or retain wrappers with extra base-class machinery. | existing reply subsystem boundary suite and changed types/checks
commands-session-abort.ts 219/219 +0 Full read: stop and natural abort share applyAbortTarget; stop additionally captures child generations before hooks. No alternate abort owner introduced. Proof: commands-abort-trigger.test.ts and commands-stop*.test.ts.
agent-runner-result-diagnostics.ts 160/160 +0 Retained authorized trace assembly and pre-await snapshots. Provider auth, trace override and plugin status fields have different fallback precedence; exact diagnostics format preserved.
dispatch-acp-finalize.ts 160/160 +0 Retained TTS generated-media/text-fallback/identity-notice variants; they share deliver and recovery owners but expose different transcript source metadata, cancellation points and fallback eligibility. No duplicated end-to-end owner remains.
block-reply-delivery.ts 159/159 +0 Fully read. Actual shared delivered-receipt predicate with explicit complete-source strategy grew aggregate 881→889 across this file, pipeline and direct handler; rejected and restored. Per-source sequence/pending/parser/last-delivery states remain independent. Proof: reply-delivery deferred-tail recovery and block pipeline source tests.
channel-run-admission.ts 158/158 +0 Retained source: Lazy evidence consumption has one owner, consumeChannelRunAdmission. Gateway/channel variants converge on prepareAgentRunAdmission; inlining requires carrying the same facts/callback record while weakening the visible admission boundary. No duplicate admission writer exists. | channel-run-admission.test.ts
commands-reset-hooks.ts 157/157 +0 Full read: routed hook delivery must settle before before_reset launch. Agent/store aliases retain compact repeated named argument projections; replacing async try/catch IIFE would change synchronous-throw handling or scheduling. No edit retained.
session-hooks.ts 155/155 +0 Retained. Concrete detached-runner core: 155 -> 161 (+6), session-hooks-detached-core.ts. Start/end payload whitelists and transcript source carriers remain separate; shared runner adds callbacks without removing policy. | session-hooks-context.test.ts
get-reply.types.ts 151/151 +0 Explicit internal/public reply fields retain independent authority, runtime and callback contracts. prepareInternalGetReplyOptions pins authority and withExtractedFileImages preserves original options when empty; neither is a no-op facade.
effective-reply-route.ts 153/153 +0 Retained source: Current and automatic routes already share final projection. Trusted sessions_send inheritance has a narrower thread-provenance check, preserved explicitly. A general projection helper would retain both whitelists and add parameters. | effective-reply-route.test.ts
reply-run-finalization-lease.ts 153/151 +2 Retained unconditional idempotent timer cancellation (-2). Actual deleting-map-entry idempotence draft shrinks 153 -> 150 but loses one late-release schedule after clear()/begin(); retained release closure has a lifetime independent of cleared deadline entries. | reply-run-registry.test.ts finalization timeout, progress and bounded-work cases
streaming-directives.ts 153/148 +5 Retained one final-line start and one head slice, preserving separator restoration and earliest possible directive tail. Proof: reply-utils split directives/literal Markdown/media-prefix cases.
agent-runner-question-input.ts 151/151 +0 Retained question custody owner. Unsupported falls back only after authority recheck; refused/invalid/unconfirmed paths share error payload helper, and committed uncertainty is never replayable.
agent-runner-context-recovery.ts 150/140 +10 Inlined the sole-call heartbeat-model lookup into its hint owner, retaining default/agent normalization and lookup at the same branch point. Preserved normalized model equality, exact runtime match and decimal-M versus binary-k labels.
session-entry-handle.ts 150/172 -22 Applied. Owns publishReplySessionEntry, moved unchanged from session-updates and also used by reset-model. Its +22 lines are offset by caller deletions; generation adoption, publication and compatibility proxy remain unchanged. | session-updates.test.ts; followup-turn-execution.worker.test.ts; get-reply.message-hooks.test.ts
session-system-events.ts 151/145 +6 Applied. Unset/local/host timezone inputs share fallback; user/explicit IANA paths share result construction. UTC format, user-host fallback and unknown-time copy unchanged. | session.test.ts drainFormattedSystemEvents; differential timezone byte matrix after freeze
acp-reset-target.ts 146/146 +0 Retained source: Accepted-key predicate and conversation lookup inputs are already shared. Service/config/raw fallback order includes terminal non-ACP decisions; no same-effect duplicate branch remains. | existing reply subsystem boundary suite and changed types/checks
session-reset-cleanup.ts 145/145 +0 Retained. Concrete shared agent ownership predicate: 145 -> 146 (+1), session-reset-cleanup-agent-owner.ts. Existing cancellation assertions remain immediately before and after child stop and before queue/run effects. | session-reset-cleanup.test.ts; session.test.ts guarded initialization/rollover tests
agent-runner-execution.types.ts 142/146 -4 One shared fourteen-field ReplyAgentTurnContext eliminates admission/execution type drift without changing optionality, source shapes or runtime imports. Closed aborted/rejected/settled unions remain.
config-mutations.ts 142/126 +16 One source path mutation owner for set/unset, removed unused allowlist cfg input, and derive plugin enabled from enable/disable action. 142 to 126. No-op sentinel, validation source shape, retry, afterWrite and live assertCurrent retained. Proof: commands-gating, commands-config.owner, commands-plugins tests.
session-fork.ts 139/134 +5 Applied. Fork parameter types reuse the parent decision contract with explicit required key/agent overrides; path helper uses its exact Pick. Further value-level parent projection core measured 134 -> 136 (+2), because required key needs restoring at the creation adapter. | session-fork.test.ts; session-parent-fork-prepare.test.ts; Gateway session-create and subagent fork tests
commands-plugin.ts 137/118 +19 Applied shared plugin metadata projection with diagnostics; runtimeContext compaction lifecycle and structured target snapshot remain local. Proof: commands-plugin.test.ts.
memory-flush-plan.ts 137/137 +0 Retained explicit per-field timing defaults, selected-slot tool admission and lookup/persistence disjointness. A blanket spread would erase defaults when plugin properties are explicitly undefined.
reply-turn-rotation.ts 137/137 +0 No retained change. Actual operation-source constructor core grows 137 -> 138. Current common merge/recordSources already share algorithm; snapshots keep captured source-lane lineage while active sources revalidate current database/key ownership. | reply-turn-admission.rotation.test.ts; reply-turn-admission.store-owner.test.ts; reply-turn-admission.module-identity.test.ts
typing-mode.ts 135/135 +0 Retained source: refreshTyping already shares mode-specific activity handling. Generic callback wrappers need lazy hasRenderableText readers and preserve disabled no-await returns; they add indirection without removing the existing common owner. | existing reply subsystem boundary suite and changed types/checks
acp-elicitation.ts 133/133 +0 Retained source: Wire adaptation already delegates forms/URLs to structured-input compiler. Correlation text rejects both C0 and C1 controls; existing narrower sanitizer is not equivalent. Field-specific error strings and correlation shapes retained. | acp-elicitation-handler.test.ts
commands-session-store.ts 136/136 +0 Full read: snapshot merge and abort replace semantics differ. Repeated abort field writes span pre-await and persistence callback; do not coalesce Date.now or current checks. Proof: commands-session-store.test.ts.
dispatch-from-config.transcript.ts 128/128 +0 Retained identity/lifecycle/writer whitelist and observedFinal latch: a seen empty/owner-transferred final is different from no callback. Existing payload projection owns delivered-only mirroring.
runtime-policy-session-key.ts 127/127 +0 Retained source: Alias recognition and direct peer selection are distinct input contracts. Main aliases preserve exact precedence; nested candidate iteration is no smaller or clearer than four explicit owner calls. | runtime-policy-session-key.test.ts
agent-runner-fallback-cycle.types.ts 126/122 +4 Applied formatted shared fallback context trial, 126 to 122. Candidate and cycle keep unique result/state/lifecycle fields; eight truly shared facts now have one type owner.
agent-runner-usage-line.ts 125/121 +4 Use canonical payload-metadata copier and a focused transcript-mirror update. Preserves all private metadata and exact appended text, including newline handling and standalone status footers.
session-entry-persistence.ts 123/115 +8 Applied. One lifecycle error preparation and one snapshot-change record. Deleted/creation early returns preserve prior callback outcome state; lifecycleError/lifecycleEntry/lockedEntry/commitEntry remain independent across replay. Getter returns one cached clone per callback. | session-entry-persistence.test.ts; session-reset-model.test.ts; model-selection.test.ts
agent-runner-turn-timing.ts 121/121 +0 Retained one shared timing owner with explicit log projection. Startup/terminal/output milestones differ in warning and repeated-log policy; observer exceptions remain isolated.
elevated-allowlist-matcher.ts 120/120 +0 Retained source: Mutable labels and formatted identities already share token construction. Their query values intentionally differ in normalization. Combining overlap checks via temporary arrays would add allocations to the existing short-circuit Set loops. | existing reply subsystem boundary suite and changed types/checks
memory-flush-session.ts 120/120 +0 Retained UUIDv8 hash input/layout, detached bounded transcript and guarded target preparation. Assertions around mkdir/open/close protect distinct awaited effects; replacing finally with await-using changes combined errors.
commands-types.ts 119/119 +0 Full read: pure declarations; no duplicate owner/state or discarded seam found. Existing public and private types remain unchanged.
commands-subagents/shared.ts 118/118 +0 Retained source: Exact/prefix matching already shares one core with explicit ambiguity labels. Task-name and display-name collections must retain their ordered fallback and index semantics; requester key normalization is independently shared. | existing reply subsystem boundary suite and changed types/checks
pending-final-delivery.ts 118/118 +0 Retained direct metadata-reader callback; admissible persisted marker shapes remain explicit whitelist and normalize before rejection. No broader sound duplicate found. Proof: pending-final-delivery exact output and unreplayable shape cases.
reply-operation-run-state.ts 118/118 +0 Retained source: One per-state loop already projects settled/aborted outcomes. Same-owner nonsettled calls intentionally retain delivery facts; a single unconditional assignment would erase them. | existing reply subsystem boundary suite and changed types/checks
session-reset-prompt.ts 118/118 +0 Retained. Concrete shared mode-to-prompt map: 118 -> 120 (+2), session-reset-prompt-map.ts. Short-circuit access rewrite stayed 118 with no shared policy improvement. Runtime-model lease disposal and exact prompt strings remain unchanged. | session-reset-prompt.test.ts; session-reset-prompt.runtime-model.test.ts
reply-turn-recovery-notice.ts 117/117 +0 No retained change. Full read: claim-before-await suppresses ambiguous duplicate delivery, identity mutations invalidate exact notices, bounded map owns retention, ACP/send policy gates have distinct purposes. No duplicate implementation or sound state removal found. | reply-turn-admission.recovery.test.ts and existing recovery-notice caller behavior
history-media.ts 116/116 +0 Retained source: Reverse traversal keeps newest-four source indexes and short-circuit classification. Flatten/map variants need to reconstruct indexes and lose early bounded traversal. Prompt-note formatting is a separate exported operation. | existing reply subsystem boundary suite and changed types/checks
inbound-dedupe.ts 116/116 +0 Retained source: Claim owner identity, recovered receipt and in-flight entry are distinct facts. Commit and release overlap only in conditional Map.delete; extracting that one statement adds a callback and obscures owner matching. | inbound-dedupe.test.ts
reply-dispatch-outcome.ts 114/114 +0 Retained source: Outcome-count mapping is already table-driven. Dispatcher identityless ambiguity and routed queue custody use different input contracts and precedence; shared adapter requires more input projection than the two final literals remove. | existing reply subsystem boundary suite and changed types/checks
exec/directive.ts 113/110 +3 Retained first-separator search and removed narration. Enum setter trial adds 9 lines; complete four-option setter with explicit preserve-empty-node policy is 110 vs 110 lines, adding a per-token closure/computed keys without reduction. | Matched/unmatched own keys, enum overwrite versus empty-node retention, cumulative invalid flags and first-unconsumed token preserved. | reply.directive.parse.test.ts
commands-acp/targets.ts 112/112 +0 Full read: explicit-token attempts ordered key/id/label; bound fallback and requester resolution already share target creation. Preserve gateway not-found and ambiguity behavior. Proof: commands-acp/targets.test.ts.
directives.ts 112/104 +8 Retained complete factory cutover: removed private compile/match helpers and intermediate match object, preserved exported extractor contracts. | Empty-body missing keys, nonempty unmatched undefined keys, strict/inline accepted-token policy, normalization calls, and byte span removal unchanged. | reply.directive.parse.test.ts; get-reply-text-slash-directives.test.ts
reply-operation-abort.ts 112/112 +0 Retained source: Restart and supersession use the existing common code/reason matcher. User abort classification excludes placement closure and has different precedence, so parameterizing it would add a predicate adapter while retaining that branch. | reply-operation-abort.test.ts
reply-usage-state.ts 112/112 +0 Retained source: Usage normalization already has shared projectHookUsage and finite-number owners. Hook projection is an explicit public whitelist; passing all params would leak config/agentDir/selection inputs. | reply-usage-state.test.ts
session-parent-fork-prepare.ts 112/108 +4 Applied. Decision and creation use one prepared fork target/parent record. Unknown parent, over-limit isolated start, locked parent and restart-tombstone refusal keep their existing branches. | session-parent-fork-prepare.test.ts; session-fork.test.ts; session.test.ts thread forking
commands-plugins-install.ts 110/110 +0 Full read: canonical installer owns effect and consent; warning aggregation preserves ANSI stripping/order. No duplicate path to collapse. Proof: commands-plugins.install*.test.ts.
queue/directive.ts 109/109 +0 Actual shared option-name/value parser trial 109→111 after formatting; rejected two extra lines and conditional raw-value bookkeeping, restored original. Stop-at-unknown and raw invalid options retained. Proof: directive-handling.queue-validation and queue-policy.
reply-model-levels.ts 108/108 +0 Completed owner/caller/test second pass; existing lazy resolver is the shared owner. Pre/post-await and per-caller cancellation checks protect independently exercised contracts and remain intact. | Per-caller cancellation is rechecked after shared discovery; explicit off/default and primary probe precedence preserved. | reply-model-levels.test.ts
agent-runner-fallback-authority.ts 107/107 +0 Retained pre-read route capture and post-await identity check. Closed target returns incoming fingerprint without resolving fallback selection; shared return construction would obscure that temporal branch.
reply-dispatcher.types.ts 107/107 +0 No edit. Public raw/prepared union, delivery metadata and released receipt callbacks remain typed; shared count mapper already owns per-kind projection. Dispatcher now consumes that owner for initialization rather than adding another helper. | SDK/export and production type gates; before-deliver.test.ts; final-outcome-counts tests
source-turn-id.ts 107/107 +0 Retained source: Two private symbol setters preserve truthy-string versus strict-true semantics. A generic symbol writer would need wrappers and indexed generic assignments, replacing tiny explicit mutations without removing a state owner. | source-turn-id.test.ts
commands-loop.ts 105/105 +0 Full read: fixed/self-paced creation already shares one final work-order rewrite; status/stop use distinct prompt producers. A common continuation wrapper would add a result/closure owner around three existing one-line rewrites. Existing authorization, text and interval grammar retained.
commands-models-menu.ts 105/105 +0 Concrete typed readiness tuple core including caller measured 105 to 116 (+11), rejected. Existing loop owns one projection; inline native/auth/default variants preserve route-specific guidance. Trial retained. Proof: commands-models.test.ts.
dispatch-from-config.reply-dispatch-hook.ts 105/105 +0 One hook owner already parameterizes initial/tail admission and trace differences. Retained takeover wrapper for commit/complete semantics; tail adds dispatch completion and late session metadata reads in a different owner.
acp-elicitation-handler.ts 104/104 +0 Retained source: Form/URL execution already shares runStructuredInput; action shapes differ only at the documented response boundary. Question ID object ordering is hash input and remains explicit. | acp-elicitation-handler.test.ts
reply-timing-tracker.ts 104/104 +0 Retained source: Custom/default renderers converge on one warn call. Timing snapshot, repeat and threshold behavior already have one owner; no duplicate publication remains. | reply-timing-tracker.test.ts
agent-runner-memory-transcript-context.ts 103/103 +0 Retained one fence retry and canonical-versus-legacy read contracts. Abort rechecks and fail-closed taint results stay at all current boundaries; no unbounded retry rewrite.
get-reply-preprocessing.ts 101/101 +0 Full read plus formatted shared failure-core trial, 101 to 104 (+3), rejected: a kind-dispatched adapter adds indirection to two independent loader owners. Media returns an optional result and clears on failure; link propagates abort without clearing and otherwise returns false. Eligibility is rechecked after caller awaits, so outer request flags cannot replace it.
reply-payloads-base.ts 101/101 +0 Retained redundant truthy conditional simplification; directive parsing, explicit-ID metadata, current reply selection and filtering order unchanged. Proof: reply-payloads/reply-utils threading tests.
stranded-reply-recovery.ts 101/101 +0 Retained source: Retry policy already constructs one explicit run. Clearing original lifecycle/persistence ownership is necessary; reusing stalled-recovery projection would need flags for media, source delivery and authoring differences and not eliminate the whitelist. | stranded-reply-recovery.test.ts
reply-dispatch-before-deliver.ts 100/100 +0 Retained source: Stage normalization and timeout execution already have one owner. Per-stage media selection capture is ordered around each awaited hook; no duplicate lifecycle path remains. | existing reply subsystem boundary suite and changed types/checks
plugins-commands.ts 99/99 +0 Retained source: Install/enable flag handling differ in accepted flags and peeling/duplicate rules. A generalized flag parser would retain usage messages and add policy descriptors to two small branches. | existing reply subsystem boundary suite and changed types/checks
session-writer-delivery-authority.ts 98/98 +0 Retained. Concrete flattened writer narrowing: 98 -> 99 (+1), session-writer-delivery-authority-narrowing.ts. Current-writer check and owed harness completion task remain independent conjunctive authority. | final reply delivery authority tests; followup-delivery.test.ts
abort-cutoff.ts 96/96 +0 Retained edit: Revisited prior approximate rejection. Shared construction now owns finite timestamp plus absent-cutoff handling for context/session adapters; measured 96 to 96. Retained because duplicate normalization/output construction is removed without changing exported signatures. | dispatch-from-config.abort-cutoff.test.ts; abort-cutoff.runtime.test.ts; abort.test.ts
agent-event-bridge.ts 96/96 +0 Retained source: Start order and settlement order are independent promises; common schedule already owns joining/failure isolation. Combining them serializes progress or permits terminal overtaking, so retention is a concrete ordering contract. | agent-event-bridge.test.ts
commands-handlers.runtime.ts 94/94 +0 Full read: fresh ordered handler array preserves per-load isolation and lazy boundary. No removal of reset/model-load sequencing. Proof: command dispatcher suites.
commands-name.ts 93/93 +0 Full read: canonical patch owner handles uniqueness; reread after persistence retains current params identity. One-use local labels reviewed. Proof: commands-name.test.ts.
dispatch-from-config.pending-final.ts 92/92 +0 Existing identity and per-delivery terminal fence is canonical. Recovery-run and hook-owned cleanup preserve distinct retained fields and activity semantics; no config/session owner edited.
explicit-steer-routing.ts 92/92 +0 Retained source: Authorized source resolution and live-owner probing already run once. Slash/direct/dm candidates retain ordered lookup; alternate table construction is longer than the three-entry conditional list. | existing reply subsystem boundary suite and changed types/checks
agent-runner-command-output.ts 90/86 +4 Retained typed result/details/raw-content adapter; condensed its description. Output, status, exit code, duration and args have different precedence; null exit code and original command title remain meaningful.
dispatch-from-config.plugin-binding.ts 89/89 +0 Early malformed/unauthorized/native/text gates differ by public command source contract; plugin dispatch plan is cached only after authorization. Existing parsing/runtime owners already share matching.
progress-narrator-model.ts 89/89 +0 Retained source: Completion/error rendering already shares one owner. Local controller timeout fences cancellation and late results independently from completion timeout; deleting it is a behavior change, not simplification. | progress-narrator-model.test.ts
source-reply-delivery-runtime.ts 89/89 +0 Retained source: applyMode already centralizes prepared/unprepared projection with explicit updatePrompt. The two exported adapters preserve their API and are one line each. | existing reply subsystem boundary suite and changed types/checks
commands-subagents/action-info.ts 87/87 +0 Retained source: Output uses one data line array. Three timestamp rows are shorter than introducing a label/value mapping loop; persisted session read is not repeated. | existing reply subsystem boundary suite and changed types/checks
conversation-binding-input.ts 85/85 +0 Retained source: Binding context is one explicit projection with original precedence. Channel/account helpers differ from channel-context in stringification and registry owner; a shared generic adapter would need both policies plus wrappers. | existing reply subsystem boundary suite and changed types/checks
commands-acp.ts 84/84 +0 Full read: 15-action lazy loader table already owns dispatch. Grouping loaders adds a second export-selection map/type boundary with unchanged import cases; existing order and per-action authorization retained. No implementation retained.
followup-delivery-payloads.ts 84/84 +0 Retained preview/dedupe/consume threading owner. Metadata source projection matches runner conceptually but requires distinct field naming and normalization; previous shared-constructor trial grows.
commands-core.ts 83/83 +0 Full read: result normalization shared by reset and handler paths; reset before model-level loading preserved. No competing dispatch owner. Proof: commands.test.ts and command fast-path suites.
commands-status-subagents.ts 83/79 +4 Applied one Map of wait suffixes with shared waiting-for prefix (83 to 79); unknown/absent/external keys retain external-work fallback without prototype lookup. Active/done counts and row cap unchanged. Proof: commands-status-subagents.test.ts.
dispatch-acp-transcript.runtime.ts 82/82 +0 Retained transcript session identity checks before and after persistence; both protect different awaits. Wrapper adapts ACP body/final and exact transcript ownership metadata, not a forwarding-only layer.
abort.ts 81/81 +0 Retained source: Fast ingress normalization remains separate from lazy cancellation authority. Formatting and target resolution are already single owners; no additional duplicate mutation remains. | abort-cutoff.runtime.test.ts; abort.acp-boundary.test.ts; abort.test.ts
completion-delivery-policy.ts 81/81 +0 Retained source: Target prefixes already use one map. Chat type selection and durable transport selection are different public decisions; existing mode owner is reused. | completion-delivery-policy.test.ts
directive-handling.model-runtime.ts 81/78 +3 Retained shared update predicate and removed narration; ordered trial 79 vs 81 before header cleanup. | Clear deletes even undefined own properties in original order; set preserves equal consent and invalid/unchanged returns false. | directive-handling.model.test.ts; model-picker/apply-session-model-selection.test.ts

@steipete

steipete commented Oct 8, 2026

Copy link
Copy Markdown
Contributor Author

Coverage 3 of 3 — rows 243–407 of 407

Final head: 0cbd6f542c1a80a7d9e5ebd0121bb6335e07041c; tree: 6fc7e092b47e026314b037d6b6577a2a1194c7ac, compared against base 35e5f4ab9818deb9347e2ec87c38aee8c05b3e05. The production reduction is 853 net lines (+1,851/−2,704 across 149 production files; 163 total changed paths). Local changed-check, suppression and cycle gates passed on this tree; hosted CI and landing status belong to the PR body.

Paths are relative to src/auto-reply/reply/. Positive delta means production lines removed. All 407 files retain their complete substantive disposition; Before/after columns use the final rebased production comparison. Formatted trial numbers inside dispositions are historical measurements and can differ from those counts. Named tests and proof targets identify required boundary coverage; they do not assert that every suite has passed at the final head. Validation status and remaining gaps belong to the main PR body.

File Before/after Δ Disposition
dispatch-acp-delivery.types.ts 81/81 +0 Fields retain pending vs confirmed, text vs audio, and recovered vs original answer distinctions. No redundant persisted/public mirror; coordinator removal changes only private callable seam.
agent-runner-helpers.ts 80/80 +0 Retained explicit verbosity override plus TTL refresh. Audio MIME and content-based typing predicates have multiple live callers and are not redundant exports.
commands-status.ts 80/80 +0 Full read: common metadata marking serves all result paths; unauthorized labels and fixed error replies differ. Try/catch acquisition boundaries preserved. Proof: commands-info.test.ts and status suites.
commands-subagents/action-agents.ts 80/80 +0 Retained source: One batch binding read and one shared session filter already serve both lists. Visible-run rows and requester binding rows retain different index/label formats; abstracting them adds a variant descriptor for two templates. | action-agents.test.ts
channel-prompt-context.ts 79/79 +0 Retained source: Context entries share one append owner; recursive sanitizer and history-limit selection are independent contracts. No equivalent duplicate path remains. | existing reply subsystem boundary suite and changed types/checks
commands-update.ts 79/79 +0 Full read: durable ack/handoff/result branches are distinct outcomes, using same gateway options. No lifecycle changes. Proof: commands-update.test.ts.
stalled-turn-recovery.ts 79/79 +0 Retained source: One explicit recovery whitelist removes original media/signal/lifecycle/receipts. A generic clearing loop would add a field inventory and indexed type handling; retaining the projection keeps run ownership visible. | existing reply subsystem boundary suite and changed types/checks
commands-export-common.ts 76/76 +0 Full read: path grammar and session-target identity have distinct consumers. Existing output path errors/file resolution preserved. Proof: commands-export-session.test.ts and trajectory suites.
commands-session-cost.runtime.ts 76/76 +0 Full read: shared aggregate row callback would introduce tuple typing and projection machinery for only two rows; session row additionally owns token-only availability and separate freshness. All existing formatting stays; no new helper retained.
dispatch-acp-manager.runtime.ts 76/72 +4 Inlined one-use stale-init predicate into its cleanup owner; exact code, regex, unbind reason, lazy transcript watermark and synchronous completion handoff preserved.
get-reply-run.types.ts 76/76 +0 Explicit prepared-run input captures distinct session/runtime/command settings. Existing aliases own model/queue types; another shared generic would not shorten this one input contract.
private-message-tool-final.ts 76/76 +0 Retained source: Shared shouldClassify predicate already serves recovery and classification. CJK estimate and sentence-count thresholds are different required signals and remain bounded constants. | private-message-tool-final.test.ts
agent-runner-execution-outcome.ts 75/75 +0 Retained ordered visible-spawn dedupe, terminal observer then message-tool outcome persistence. Canonical execution status also serves reply-operation state and cannot inline only here.
mcp-channel-actions.ts 75/75 +0 Retained source: Both presentations already share attachChannelPresentation. Lazy action minting is correctly after visible terminal selection; no repeated cloning owner remains. | mcp-channel-actions.test.ts
reply-directives.ts 75/75 +0 Fully read; media extraction and inline/silent parsing already separate canonical owners. No identified duplicate implementation.
agent-runner-auth-profile.ts 74/74 +0 Retained provider alias auth scope and fallback-probe pin ownership. Both scoped auth APIs have live callers; absent auth-profile source uses deletion intentionally.
pending-tool-task-drain.ts 74/74 +0 Retained source: observePendingTask is a retention boundary: detached tasks retain only a detachable observer. Inlining would retain active drain state after timeout. Finish owner already clears callbacks/timer once. | pending-tool-task-drain.test.ts
agent-runner-maintenance.ts 73/73 +0 Retained one eligibility gate and foreground-authority-free descriptor. Deferred owner settlement gates new maintenance, and actual harness/model/auth facts cannot be inferred from requested selection.
session-init-conflict-retry.ts 72/72 +0 Retained. Concrete shared error-prefix construction: 72 -> 75 (+3), session-init-conflict-retry-message-core.ts. Keep literal regex and fixed message together without an extra template dependency. Retry count, backoff, cancellation and outside-writer wait unchanged. | session.init-conflict-retry.test.ts
commands-export-session-file.ts 70/69 +1 Inlined one-use relative path local without changing lexical workspace alias validation or fs-safe owner. 70 to 69. Proof: commands-export-session-file.test-support.ts via export suite.
dispatch-from-config.abort.ts 69/69 +0 Public dispatcher adapter binds prepare receiver, preserves optional method presence and abort-before-send behavior. Existing sendIfActive shares three variants; other methods have distinct receiver/live lookup semantics.
group-id.ts 69/69 +0 Retained source: Explicit syntax and plugin-inferred targets have different precedence but share canonical prefix stripping. Extracting the single strip chain adds a wrapper with no second caller. | group-id.test.ts
commands-dashboard.ts 66/66 +0 Full read: guaranteed bundled skill selection and explicit skill expansion own distinct errors. No shared-default change. Proof: commands-dashboard.test.ts.
directive-handling.queue-validation.ts 66/60 +6 Retained one ordered conditional-message collection and inlined the trivial drop-label fallback. Six formatted lines removed. | Status differs from malformed raw options; all ordered text and numeric type tests preserved. | directive-handling.queue-validation.test.ts
command-session-metadata.ts 65/65 +0 Full read: WeakMap has one write/take owner; root/ctx dedupe preserves target order and consume semantics. No cache lifecycle change. Proof: command-session-metadata.test.ts.
directive-handling.params.ts 65/63 +2 Retained direct ModelCatalogEntry[] type after verifying prepared-model-catalog return type. | Same imported catalog-entry type and array mutability; no runtime or public contract change. | Typecheck; directive-handling.model.test.ts
get-reply-run.ts 65/65 +0 Three-stage context/admission/execution flow retains prepared plugin-generation lease and current-generation accessor invalidation before disposal. No redundant owner or return path remains.
commands-slash-parse.ts 64/65 -1 Shared splitCommandAction for whole-token/slash/goal/TTS parsing plus common leading-slash recognizer for native and inline paths. Grammars retain optional colon, nested slash-name distinction, case folding and exact tail whitespace. Proof: parser, goal, TTS and fast-path suites.
session-rollover-state.ts 64/64 +0 Retained. Concrete generic selected-field core: 64 -> 74 (+10), session-rollover-state-field-core.ts. Same explicit field inventory still needed, with extra dynamic projection plumbing; retain exact whitelist and conditional spawn lineage. | session.test.ts rollover model/workspace/lineage/permissions groups
commands-context.ts 63/88 -25 Added one shared plugin command metadata projection, consumed by plugin and diagnostics handlers; auth decision remains in buildCommandContext. Combined trio shrinks 700 to 688. Proof: commands-plugin and commands-diagnostics tests.
agent-runner-reminder-guard.ts 62/62 +0 Retained regex contract, existing cron lookup and first-payload note insertion. Store read stays in current error-isolated boundary even with no session key.
abort-trigger-text.ts 61/61 +0 Retained source: Trigger inventory is intentional public language coverage; normalization and membership each have one direct expression. | existing reply subsystem boundary suite and changed types/checks
waiting-status.ts 61/61 +0 Retained source: Visible wait payload and child progress custody are separate contracts; the latter keeps lazy import and a live close fence. No repeated execution core exists. | waiting-status.delivery.test.ts
compaction-notice.ts 60/60 +0 Retained source: All phases and hook messages already share createNoticePayload. Empty hook arrays suppress a payload while empty text override remains allowed. | existing reply subsystem boundary suite and changed types/checks
dispatch-from-config.timing.ts 60/60 +0 Explicit five-field milestone projection strips outcome/reason from supplied runtime objects before adding exact values. Timing owner already shares measurement/logging; retained whitelist and repeat behavior.
agent-runner-execution-mcp-context.ts 59/59 +0 Retained leased MCP context projection. No-image path preserves object identity; appended images preserve existing order and conditional media layout.
commands-subagents.ts 59/59 +0 Full read: lazy imports preserve selected action dependencies and context read ordering. No duplicate subagent state owner. Proof: commands-subagents*.test.ts.
agent-runner-compaction-accounting.ts 58/58 +0 Retained ordered same-writer compaction folding. CLI command accounting is a live sibling caller; latest target order and explicit invalidation cannot become an unordered map.
commands-subagents/action-log.ts 58/58 +0 Retained source: Empty/populated history already share one final render. Tool filtering and assistant text extraction are existing owners; no duplicate path remains. | existing reply subsystem boundary suite and changed types/checks
directive-handling.levels.ts 57/57 +0 Retained explicit precedence chains. Formatted shared inheritance helper is 61 vs 57 lines (+4) and still needs typed result projections. | Thinking await and configured fallback order, fast normalization, and explicit off retained. | directive-handling.levels.test.ts
message-received-hooks.ts 57/57 +0 Retained source: Plugin/internal hooks share canonical context factory but intentionally call it separately, so plugin mutation cannot freeze the second hook facts. Shared fireAndForgetHook owns async isolation. | existing reply subsystem boundary suite and changed types/checks
reply-run-registry.ts 57/57 +0 No retained change. Explicit public barrel preserves export surface and symbol owner; wildcard/export relocation cannot eliminate implementation and would widen the boundary. | production/core type graph and existing imports
directive-handling.auth-profile.ts 56/49 +7 Retained shared provider-compatible selection result after each source validates. | Personal authority validation remains after await and before provider match; stored credentials still precede noninteractive store; ordinary result omits callback. | gateway/model-account-connect.worker.test.ts; directive-handling.model.test.ts
reply-inline.ts 55/55 +0 Retained source: Simple command and status parsers have different regex/case/alias contracts. The status stripping loop already delegates span removal to one owner. | reply-inline.test.ts
queue/settings.ts 54/46 +8 Retained one finite/nonnegative debounce normalizer shared with runtime defaults; inline/session values keep original separate handling. Proof: queue/settings and settings-runtime.
agent-runner-result.types.ts 51/51 +0 Retained Pick-based public/internal finalization input projection; no repeated declaration owner remains.
response-prefix-template.ts 51/51 +0 Retained source: Template key aliases are data; one replace callback owns rendering. Own-property check prevents inherited field access and unresolved placeholders retain literal text. | existing reply subsystem boundary suite and changed types/checks
stored-model-override.ts 51/51 +0 Retained source: Heartbeat fallback provenance, explicit origin and encoded notice are ordered contracts. Shared catalog-ref owner is already used; no duplicate normalization pipeline remains. | existing reply subsystem boundary suite and changed types/checks
dispatch-from-config.types.ts 50/50 +0 Published dispatch result/options contract and deprecated SDK field retained exactly; no removal or private-helper coupling for LOC.
reply-reference.ts 50/50 +0 Retained source: peek/use share one resolver. use and markSent differ because only a resolved reference consumes the former; these two state writes are intentional. | existing reply subsystem boundary suite and changed types/checks
commands-system-agent.ts 49/49 +0 Full read: captured host lifecycle wrapper adds invocation signal revalidation and cannot be replaced by unbound method. Resolve/import/auth ordering remains. Proof: commands-system-agent.test.ts.
reply-tool-authority.native-read.ts 49/49 +0 Retained source: One captured assertion serves initial, prepared and legacy reads. Native owner identity plus session identity fences are separate required checks. | existing reply subsystem boundary suite and changed types/checks
reply-workspace.ts 48/48 +0 Retained source: Bootstrap fast path and provisioning path share current assertion. All awaited owner boundaries revalidate; a common final return would not remove the earlier required checks. | existing reply subsystem boundary suite and changed types/checks
commentary-progress-owner.ts 47/47 +0 Retained source: Sync/async visibility publication preserves distinct await cadence and callback return contracts. Each branch freezes the same conceptual decision at its own invocation boundary; a Promise adapter would change sync timing. | existing reply subsystem boundary suite and changed types/checks
queue/normalize.ts 47/47 +0 Fully read; three explicit alias tables and one-line lookups preserve user versus persisted compatibility. No identified duplicate implementation beyond lookup call.
stage-remote-inbound-media.ts 46/46 +0 Retained source: Single lazy staging adapter already forwards a shared parameter object and overrides sessionCtx. Detailed comment names the staged-media single-owner contract. | stage-remote-inbound-media.owner.test.ts
acp-stream-settings.ts 45/45 +0 Retained source: Tag defaults are a protocol inventory and override validation is one branch. Explicit enum guard is reused by indexing, not duplicate policy. | existing reply subsystem boundary suite and changed types/checks
channel-context.ts 45/45 +0 Retained source: Channel and account fallback normalize strings without coercion and use loaded-by-id registry. Binding-message helper has distinct coercion/registry contracts; no shorter common wrapper identified. | existing reply subsystem boundary suite and changed types/checks
fast-approve.ts 44/44 +0 Retained source: Early parser delegates context/auth and approval to existing owners. Result shape preserves omitted reply; no duplicate write or responder path remains. | fast-approve.test.ts
queue/recent-message-ids.ts 44/44 +0 Fully read; owner-token delete/check and abandonment release are ordered, callback capture preserves prior owner. No identified duplicate implementation.
queue/summary-consumption.ts 43/42 +1 Retained one indexed splice/accounting path with explicit normal versus elided source storage. Stale sourceRefs still consume count even when mapped item absent; settlement remains per-source before final count subtraction. Proof: concurrent summary drain, compact-source Stop, admitted summary failure.
commands-acp/install-hints.ts 42/42 +0 Full read: local/bundled/registry hints preserve ordered filesystem checks and workspace containment. No duplicate existence helper justified. Proof: commands-acp/install-hints.test.ts.
reply-payload-sending-hook.ts 42/42 +0 Fully read; exact hook event whitelist excludes context, cancel short-circuits metadata copy. No identified duplicate implementation.
config-value.ts 41/41 +0 Retained source: Object/array and quote JSON parsing differ in error fallback. One common parse try would need to preserve both error messages and quotation fallback plus ordering of booleans/numbers; existing branches are smaller. | existing reply subsystem boundary suite and changed types/checks
message-preprocess-hooks.ts 41/41 +0 Retained source: Transcribed/preprocessed hooks already use one explicit action/mapper table. Suppression and canonical context are computed once. | message-preprocess-hooks.test.ts
directive-parsing.ts 40/40 +0 Completed byte-span/token owner and caller review. Existing three primitives already share all span/token behavior; no duplicate owner or smaller complete cutover identified. | CRLF, directive-only line endings, inline single separator, trailing indentation and no-match bytes unchanged. | reply.directive.parse.test.ts
pending-final-delivery-state.ts 39/33 +6 Retained removal of redundant exact-silence guard and folded empty/terminal-silence return. Final post-strip silence check remains because stripping can reveal a silent envelope. Lazy admission remains separate from outbound runtime. Proof: pending-final-delivery sentinel/JSON/code/punctuation cases.
routed-delivery-thread.ts 39/39 +0 Retained source: Direct Slack classification and thread resolution are distinct functions. Existing nullish fallback preserves numeric/empty thread identity; no duplicate owner. | existing reply subsystem boundary suite and changed types/checks
routing-policy.ts 39/39 +0 Retained source: Normalized channel facts are carried into one routing decision. Sharing internal-channel predicate with source-mode module would add an adapter/import coupling or repeat normalized inputs, for a larger result. | routing-policy.test.ts
typing-policy.ts 39/39 +0 Retained source: Single nested selection owns precedence of heartbeat, internal webchat, system event and requested mode; suppression derives from that selected policy. | typing-policy.test.ts
commands-steer.ts 38/38 +0 Full read: one text rewrite followed by optional queue override; already shared continuation owner. No scheduling changes. Proof: commands-steer.test.ts.
dispatch-processed-outcome.ts 38/38 +0 AsyncLocalStorage singleton and terminal observation are independent of returned SDK shape; one sink/write owner, no redundant state.
inbound-media.ts 38/38 +0 Retained source: Meaningful media is already shared; audio classification uses structured MIME/kind, intentionally distinct from sticker/understanding counts. | inbound-media.test.ts
provider-dispatcher.ts 38/37 +1 Retained edit: Shared explicit six-field projection serves plain and buffered dispatch, preserving key order and own undefined properties. Buffered-only dispatchReplyFromConfig remains explicit. 38 to 37; no API type/signature change. | provider-dispatcher.test.ts; auto-reply/dispatch tests; SDK contract/build gate
provider-dispatcher.types.ts 38/38 +0 Retained source: Recreated shared generic parameter signature draft, formatted 38 to 38. Rejected on review: private helper coupling and public declaration churn provide marginal clarity. Original explicit signatures restored byte-identically. | existing reply subsystem boundary suite and changed types/checks
abort-primitives.ts 36/36 +0 Retained source: Canonical trigger parser and bounded abort memory already use shared owners. Delete-before-set refreshes ordering; no-op false setter remains a required clear contract. | existing reply subsystem boundary suite and changed types/checks
commands-setunset.ts 36/36 +0 Full read: shared parser now uses consolidated token core; falsy known-action fallback and assignment parsing remain. No added parser seam. Proof: commands-setunset.test.ts, commands-parse.test.ts.
config-write-authorization.ts 36/36 +0 Retained source: Thin policy adapter returns existing owner denial text. No duplicate authorization owner; public parameters are explicit to prevent accidental bypass inputs. | existing reply subsystem boundary suite and changed types/checks
directive-handling.arguments.ts 35/35 +0 Retained prioritized exec rejection and bounded argument owner. Formatted first-error message array is 38 vs 35 lines (+3) and evaluates later predicates unnecessarily. | Exec host/security/ask/node error priority and one-token bounded argument rejection unchanged. | get-reply-text-slash-directives.test.ts; get-reply-directives-apply.test.ts
dispatch-from-config.acp-tail.ts 35/35 +0 Reset tail consumes its flag before hook dispatch, records agent completion and reads session metadata after hook settlement. Initial takeover lacks those effects; existing hook core already parameterizes shared admission.
dispatcher-registry.ts 35/35 +0 Retained source: Distinct registration objects prevent callback identity collision. Sum loop is already the single read projection; replacing wrappers would break independent unregister. | existing reply subsystem boundary suite and changed types/checks
abort-cutoff.runtime.ts 34/34 +0 Retained source: Clears in-memory state before optional persistence by explicit owner operations. Patch only contains cutoff fields plus timestamp, so a spread would leak session data. | abort-cutoff.runtime.test.ts
command-exec-result.ts 34/34 +0 Full read: formatter normalizes caller-supplied running labels as well as real exec output. Removing trim for the currently fixed labels would narrow its existing string contract. Existing status fallback owner retained.
reply-turn-recovery-wait.ts 34/34 +0 No retained change. Subscription, owner release race, bounded retry timer and finally unsubscribe each serve separate settlement behavior; timeout/revalidation remain unchanged. | reply-turn-admission.recovery.test.ts deferred/concurrent recovery and abort cases
commands-whoami.ts 33/27 +6 Applied ordered conditional line array (33 to 27), retaining nonempty identity checks, group-only chat, present-but-empty thread and AllowFrom precedence. Proof: commands-info.test.ts.
dispatch-acp-command-bypass.ts 33/33 +0 Reset/ACP bypass deliberately differs from configured text/owner-enabled bash. Canonical command owners already shared; evaluation order retained.
session-diff-baseline.ts 33/27 +6 Applied. Removed redundant direct store publication. Sole production caller immediately uses full initSessionState, whose unfenced handle owns that exact committed sessionStoreView. Parent confirmed get-reply changes preserve this provenance. Pick now requires only used fields. | get-reply.config-override.test.ts; get-reply.message-hooks.test.ts; sessions/session-diff-baseline.test.ts
skill-command-loaders.ts 33/33 +0 Retained source: Full/bundled command loaders already share captured context and runtime loader; bundled-only skillName stays explicit. | existing reply subsystem boundary suite and changed types/checks
commands-acp/context.ts 32/32 +0 Full read: resolved binding canonicalization differs from fallback route construction; single normalization owner retained. Proof: commands-acp/context.test.ts.
commands-subagents/action-list.ts 32/32 +0 Retained source: Active/recent rows already share formatRows; status rows come from the existing subagent-list owner. | existing reply subsystem boundary suite and changed types/checks
dispatch-from-config.events.ts 32/32 +0 Published synchronous getter remains live and enumerable; asynchronous visibility methods remain fields. Admission restriction predicate is already shared by two consumers.
dispatch-from-config.restricted-runtime.ts 32/32 +0 Single typed takeover projection captures unchanged runtime restriction policy and exact error/reason text; no unused strategy/general API.
dispatch-from-config.session-metadata.ts 32/32 +0 Set owns dedupe identity while new array snapshots own publication; mutating prior arrays would change retained snapshots. One callback receives only fresh entries.
get-reply-directives-utils.ts 32/32 +0 Completed reset-owner/caller review. Exact exec field inventory and one canonical empty directive projection retained; no runtime owner or unused field removed. | Full directive clear preserves command:undefined and supplied cleaned body; exec-only reset cannot clear siblings. | get-reply-directives-routing.test.ts; reply.directive.parse.test.ts
directive-handling.defaults.ts 31/24 +7 Retained one explicit cfg/agentId/manifest context for default and alias owners, removing seven formatted lines without extra forwarded properties. | One shared manifest snapshot used for default and alias resolution. | get-reply-text-slash-directives.test.ts
mentions.types.ts 31/31 +0 Retained source: Exported function types and explicit signal shape are API contracts, with no executable duplication. | existing reply subsystem boundary suite and changed types/checks
reply-run-typing.ts 31/31 +0 Retained source: WeakMap owns one controller per operation, cleanup tied to operation clear. Refresh remains separate and conditionally restarts existing controller. | existing reply subsystem boundary suite and changed types/checks
session-init.types.ts 31/30 +1 Applied. Required Pick reuses the exact sessionId/systemSent/abortedLastRun field types while retaining required output properties. | changed graph typecheck
cli-reply-payload.ts 30/30 +0 Retained source: Explicit directive projection avoids leaking parser control fields. Media failure and assistant/silent metadata differ in presence conditions; common metadata object would need equivalent conditional projections. | existing reply subsystem boundary suite and changed types/checks
commands-openclaw-cli.ts 30/30 +0 Full read: pure invocation preparation and platform quoting preserved. Shared exec defaults belong to existing private-route approval projection instead, keeping this pure module free of exec runtime imports. Proof: commands-openclaw-cli.test.ts.
get-reply-directive-aliases.ts 29/29 +0 Retained two clear filters. Formatted fused narrowing/reservation filter is 31 vs 29 lines (+2). Built-in/skill reservation timing remains unchanged. | Whitespace/case normalization, built-in reservation before skill loading, skill reservation after await, no-slash empty result preserved. | get-reply-directive-aliases.test.ts
get-reply-exec-overrides.ts 29/29 +0 Retained explicit precedence and exact output projection. Formatted common-field resolver with stored-value policy is 34 vs 29 lines (+5). | Host/node inherit session placement; security/ask stay message/config-only; nodeCwd requires matching selected node and remains absent when falsey; fixed host/security/ask/node keys stay present. | get-reply-exec-overrides.test.ts; get-reply-text-slash-directives.test.ts
mcp-commands.ts 29/29 +0 Retained source: Shared set/unset parser already owns command grammar. Boundary renames path to name in two different result shapes; merging requires conditional object properties and more code. | existing reply subsystem boundary suite and changed types/checks
queue/collected-run.ts 28/28 +0 Fully read; shared source returned for same/unverifiable participants; mixed known participants clear exact downstream authority fields. No identified duplicate implementation.
system-event-session-key.ts 32/32 +0 Retained source: Private symbol carries prepared event selection; setter clone and typed reader are distinct minimal operations. | existing reply subsystem boundary suite and changed types/checks
btw-command.ts 27/27 +0 Retained source: Recognition accepts colon/whitespace while question extraction requires optional whitespace body. Sharing regex would alter the grammar; normalization itself already has an owner. | existing reply subsystem boundary suite and changed types/checks
command-context-rewrite.ts 27/27 +0 Full read: one owner updates all inbound-text projections then command mirrors; rootCtx identity protection and ordering retained. Proof: command continuation suites.
commands-compact.runtime.ts 27/27 +0 Full read: session generation getter plus lazy reexports. Runtime facade cannot be removed locally without breaking mocked/lazy owner boundaries. Proof: commands-compact.test.ts.
reply-config-runtime-mode.ts 27/27 +0 Retained source: WeakMap avoids mutating frozen config. Complete/full readers use distinct predicates; converting both to one untyped getter would add a wrapper and casts. | existing reply subsystem boundary suite and changed types/checks
commands-bash.ts 26/26 +0 Full read: /bash versus bang authorization grammar stays distinct; existing shared wrapper already removes gates. Proof: commands-gating.test.ts and bash suites.
directive-handling.directive-only.ts 26/26 +0 Completed owner/caller review. This is already the shared predicate for three flows; no smaller complete cutover identified. | Registered command ownership bypasses prose check; group mention stripping remains separate and after structural prefixes. | get-reply-text-slash-directives.test.ts; directive-handling.mixed-inline.test.ts
get-reply-run-queue.ts 26/26 +0 Interrupt and wait callbacks have different arity; both already share refresh+busy result. Retained exact callback invocation and text.
memory-flush-errors.ts 26/26 +0 Retained visible error filtering, text aggregation and UTF-16-limited detail as distinct production contracts; no test-only export or duplicate pipeline.
reply-dispatch-delay.ts 26/26 +0 Retained source: Range selection already shared by sampled and maximum delay. Random generation occurs only for valid increasing ranges. | existing reply subsystem boundary suite and changed types/checks
dispatch-acp.runtime.ts 25/25 +0 Two lazy loaders isolate command classification from full ACP runtime. Both adapt sync/async results and keep distinct module closures; not mergeable without eager load or a longer generic adapter.
elevated-unavailable.ts 23/23 +0 Retained source: One line-array renderer preserves user-facing config keys and failure text; no duplicate implementation. | existing reply subsystem boundary suite and changed types/checks
session-route-reset.ts 23/23 +0 Retained. Concrete generic omit core: 23 -> 26 (+3), session-route-reset-omit-core.ts. Route normalization and context empty-string checks remain explicit; helper adds machinery around two short projections. | session.test.ts stale-thread/system-event route groups
get-reply-conversation-type.ts 22/19 +3 Retained canonical normalizer result with only channel-to-group translation (-3), removing duplicate direct/group enumeration. | normalizeChatType admits only direct/group/channel/undefined; target/source mismatch still returns undefined before classification. | get-reply-run-context.ts and dispatch-from-config.prepare-delivery.ts boundary suites; get-reply.fast-path.runtime.test.ts; dispatch-from-config.delivery.test.ts
history-limit.ts 22/22 +0 PROTECTED RETENTION: scripts/pr import-closure boundary; inspected, never edited, byte-identical to pinned base. | protected-path byte comparison and scripts/pr wrapper closure gates
queue-policy.ts 22/22 +0 Retained source: Single ordered decision tree preserves heartbeat/reset precedence; no duplicate queue owner. | queue-policy.test.ts
queue/settings-runtime.ts 22/17 +5 Retained shared debounce normalization; only already-loaded plugin lookup, explicit pluginDebounce bypass preserved. Proof: settings-runtime lazy fallback and per-channel override tests.
reply-admission-ticket.ts 22/22 +0 Retained source: Single adapter normalizes keys before existing FIFO registry; symbol/type alias are API boundary facts. | existing reply subsystem boundary suite and changed types/checks
inbound-context-marker.ts 21/21 +0 PROTECTED RETENTION: scripts/pr import-closure boundary; inspected, never edited, byte-identical to pinned base. | protected-path byte comparison and scripts/pr wrapper closure gates
body.ts 20/20 +0 Retained source: Interrupted-run prefix and optional abort-memory clearing form one small owner; literal text is a prompt contract. | body.test.ts
agent-runner-fallback-cycle.ts 19/19 +0 Retained two-operation wrapper: fallback execution then completed timing then settlement. Direct forwarding would drop timing observation.
directive-runtime-context.ts 19/19 +0 Completed owner/caller review. Prepared agent and independent runtime-policy session key remain explicit; existing forwarding is the common owner. | Prepared agent identity and independent policy session key preserved; no extra caller context passed to sandbox owner. | get-reply-directives-apply.test.ts
dispatch-acp-prompt.ts 19/19 +0 Public source-delivery guidance and paragraph separator are unchanged; one branch adds exactly the needed instruction and retains blank prompt behavior.
mixed-silent-reply-tokens.ts 18/18 +0 New since PR1; fully read, already canonical shared mixed-token normalization owner. No identified duplicate implementation.
model-selection-context.ts 18/18 +0 Completed owner/caller review. Thin policy owner retains explicit async-load prohibition and nullish token fallback; no duplicate runtime implementation exists. | Context calculation stays synchronous and DEFAULT_CONTEXT_TOKENS remains nullish fallback. | model-selection.test.ts
prepared-reply-dispatch-context.ts 18/18 +0 Retained source: One AsyncLocalStorage binds runtime generation per call; forwarding wrapper carries dynamic arguments and must remain. | existing reply subsystem boundary suite and changed types/checks
config-commands.ts 17/17 +0 Retained source: Thin adapter already delegates shared show/set/unset grammar; only config-specific action projection remains. | existing reply subsystem boundary suite and changed types/checks
subagents-utils.ts 17/17 +0 Retained source: Label selection and bounded status formatting are separate exported contracts; canonical sanitizer/truncator already reused. | subagents-utils.test.ts
skill-filter.ts 16/16 +0 Retained source: Channel/agent filters share one normalization closure and one Set intersection pass; no duplicate policy. | existing reply subsystem boundary suite and changed types/checks
acp-elicitation-handler-lazy.ts 15/15 +0 Retained source: Per-turn memoized promise owns lazy structured-input stack and exact handler identity. Removing it changes import/identity lifetime. | existing reply subsystem boundary suite and changed types/checks
agent-runner-result.ts 15/15 +0 Retained accounting, preparation and conditional completion pipeline; already minimal fifteen-line closed-return branch.
commands-reset-mode.ts 15/15 +0 Full read: ordered reset/soft token loop preserves normalization/trim behavior and exact untouched tail. No further sound structural reduction. Proof: reset parser suites.
dispatch-from-config.runtime-loaders.ts 15/15 +0 Named lazy singleton imports keep seven runtime boundaries and one owning cached loader each; table construction adds indirection without removing declarations.
followup-presentation.ts 15/15 +0 Retained best-effort queued cleanup error owner. Inlining optional callback would lose exact logged failure semantics in two callers.
queue.ts 15/15 +0 Fully read public facade; no runtime ownership or duplicated logic.
history.types.ts 14/14 +0 Retained source: History record and MediaFact Pick are declaration-only contracts; no duplicate executable paths. | existing reply subsystem boundary suite and changed types/checks
origin-routing.ts 13/13 +0 Retained source: One nullish fallback expression delegates channel normalization; no removable wrapper within owned callers. | origin-routing.test.ts
commands-context-command.ts 12/12 +0 Full read: 12-line declaration already delegates gates/matching/report construction. No duplicate flow remains. Proof: commands-context-report.test.ts.
debug-commands.ts 12/12 +0 Retained source: Thin adapter already delegates shared parser with debug-specific reset action. | existing reply subsystem boundary suite and changed types/checks
message-timestamp.ts 12/12 +0 Retained source: Positive timestamp gate and seconds/milliseconds distinction are explicit contract; canonical asDateTimestampMs performs range admission. | existing reply subsystem boundary suite and changed types/checks
block-reply-source.types.ts 11/11 +0 Fully read source custody interface; concrete complete/pending/settle/recover contracts.
context-text.ts 10/10 +0 Retained source: Two tiny exported helpers serve trim and explicit-prefix checks; prefix helper consumes canonical trim owner. | existing reply subsystem boundary suite and changed types/checks
user-envelope-display.ts 10/10 +0 Retained source: One ordered composition of four distinct sanitization owners; deletion/reordering changes visible text. | existing reply subsystem boundary suite and changed types/checks
agent-runner-execution-status.ts 9/9 +0 Retained shared three-state projection, used by outcome persistence and reply-operation run state. Inline nested conditional would duplicate two owners.
dispatch-acp-media.runtime.ts 9/9 +0 Mixed six-export lazy media namespace composes three owners. Retained published runtime entry composition; deleting requires equivalent namespace reconstruction.
display-text-sanitize.ts 9/9 +0 PROTECTED RETENTION: scripts/pr import-closure boundary; inspected, never edited, byte-identical to pinned base. | protected-path byte comparison and scripts/pr wrapper closure gates
reply-dispatch-outcome.types.ts 8/8 +0 Retained source: Closed outcome union is contract-only and intentionally mirrored in count mapping by satisfies. | existing reply subsystem boundary suite and changed types/checks
dispatch-session-refresh-error.ts 7/7 +0 Named Error subclass/cause identity is a retry boundary, not removable forwarding.
normalize-reply-skip-reason.ts 7/7 +0 Fully read import-free discriminated union; no duplicate implementation.
reply-preprocessing-abort.ts 7/7 +0 Retained source: One abort assertion preserves custom cancellation message and arbitrary cause; direct throwIfAborted would change error shape. | existing reply subsystem boundary suite and changed types/checks
inbound-text.ts 6/6 +0 Retained source: Two replacements normalize CRLF/CR while preserving literal escape text; no other owner within scope duplicates this implementation. | existing reply subsystem boundary suite and changed types/checks
commands.ts 4/4 +0 Full read: four-line command export boundary with external consumers. No removal without coordinated import graph cutover; no facade chain within this scope.
commands-status.runtime.ts 3/3 +0 Full read: three-line lazy export boundary has no duplicated implementation. Keep loading boundary for status consumers.
get-reply-from-config.runtime.ts 3/3 +0 Three-line lazy namespace combines resolver and prewarm owners; inlining creates a longer asynchronous namespace adapter and changes loader boundary.
abort.runtime.ts 2/2 +0 Retained source: Lazy runtime facade retained: dispatch runtime-loader and shared harness consumers name this seam; removing it needs cross-manifest topology work. | existing reply subsystem boundary suite and changed types/checks
directive-handling.ts 2/2 +0 Read two-line type-only barrel and consumers; public import path retained. | No runtime implementation; removing barrel would spread type-path churn without ownership reduction.
groups.runtime.ts 2/2 +0 Retained source: Lazy plugin-registry boundary retained, with existing runtime-load proof. Direct eager imports would broaden group-prompt startup closure. | existing reply subsystem boundary suite and changed types/checks
provider-dispatcher.runtime.ts 2/2 +0 Retained source: Retained named emitted runtime entrypoint: tsdown/runtime-postbuild contract tests and SDK lazy loader name this chunk. | existing reply subsystem boundary suite and changed types/checks
reply-dispatcher.runtime-types.ts 2/2 +0 Retained source: Type-only facade used by plugins/runtime/types-channel keeps runtime loading absent; a type-forwarder is not duplicate behavior. | existing reply subsystem boundary suite and changed types/checks
delivery-hints.ts 1/1 +0 PROTECTED RETENTION: scripts/pr import-closure boundary; inspected, never edited, byte-identical to pinned base. | protected-path byte comparison and scripts/pr wrapper closure gates
fast-approve.runtime.ts 1/1 +0 Retained source: Lazy approval runtime seam used by dispatch runtime-loader and test harness; no cross-manifest removal authorized here. | existing reply subsystem boundary suite and changed types/checks

@steipete
steipete marked this pull request as ready for review October 8, 2026 12:59
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. 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 Oct 8, 2026
@clawsweeper

clawsweeper Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed October 8, 2026, 9:16 AM ET / 13:16 UTC.

ClawSweeper review

What this changes

This PR consolidates reply preparation, command setup, delivery accounting, and lifecycle cleanup while preserving existing contracts.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Useful consolidation with no actionable finding, supported by substantial but primarily harness-based validation.
Proof confidence 🦐 gold shrimp (3/6) Not applicable: The supplied Repository State identifies maintainer authorship, so the ordinary external-contributor proof gate does not apply. Recorded harness and differential evidence covers reply, queue, session, and approval owners with explicit revision limits; no material authority-policy or stored-data contract change was found.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Refactor · Worth it: Yes
Reason: The change reduces duplicated maintenance within existing owners without adding product surface. Prior merged area history supports the preservation-focused direction.

Merge readiness

⛔ Blocked before merge - 2 items remain

Keep open: this PR provides useful consolidation of existing reply owners, and no concrete blocking regression was found. Validation is extensive but primarily harness-based and explicitly qualified by revision.

Priority: P3
Reviewed head: 0cbd6f542c1a80a7d9e5ebd0121bb6335e07041c

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.

Findings

None.

Tests

  • Missing end-to-end proof: The recorded reply and Gateway suites are harness evidence; a shipped application run covering the broader refactor is not established. Tests were not rerun during this read-only review.
Agent review details

How this fits together

OpenClaw’s reply subsystem turns incoming messages and commands into agent runs and outgoing replies. It coordinates session state, authorization, streaming, queued follow-ups, and delivery completion.

flowchart TD
  A[Incoming message or command] --> B[Reply preparation]
  B --> C[Session and authorization checks]
  C --> D[Agent execution or command handler]
  D --> E[Reply presentation and delivery]
  E --> F[Lifecycle settlement]
  F --> G[Queued follow-ups]
Loading

Technical review

Best possible solution:

Retain the consolidated existing owners and their explicit authorization, delivery, and recovery boundaries.

Do we have a high-confidence way to reproduce the issue?

Not applicable: this PR proposes behavior-preserving consolidation rather than a reported product bug; validation was assessed from source and recorded evidence.

Is this the best way to solve the issue?

Yes: the inspected changes reuse existing owners, remove redundant projections, and preserve caller-specific timing and authority checks.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 47cbd73e6f0e.

Testing

Proof path: in-process harness. Added test files: 11.

Security

None.

Evidence

What I checked:

  • Pinned introduction and clean checkout: The independently inspected merge-base-to-head delta matches the introduced scope. The head tree is 6fc7e092b47e026314b037d6b6577a2a1194c7ac, matching the body’s validation identity; initial and final status were clean. (0cbd6f542c1a)
  • Canonical registry projection: Active session IDs now derive from active operations; reverse lookup and historical wait indexes remain separate. Waiter settlement retains cancellation, timer cleanup, and promise resolution. (src/auto-reply/reply/reply-run-registry.registry.ts:250, 0cbd6f542c1a)
  • Session persistence compatibility: The persistence refactor retains lifecycle rejection, model-selection locking, touched-field conflict checks, and merging against the authoritative current entry. No stored schema, serialized field contract, default, or migration changes were found. (src/auto-reply/reply/session-entry-persistence.ts:43, 0cbd6f542c1a)
  • Existing area direction and ownership: Current-main history repeatedly associates these owners with Peter Steinberger. The merged refactor(auto-reply): consolidate reply preparation and command flows #166685 expressly preserves command output, authorization, cancellation, replay, public contracts, and persisted shapes; this PR continues that direction rather than replacing its product contract. (src/auto-reply/reply/session.ts, 0abba2b16016)
  • Qualified validation evidence: The full body and all three coverage comments were inspected, including omitted prompt ranges. Reported proof includes 3,946 passing shared-project tests, 416 final-correction boundary tests, differential comparisons, SDK checks, and exact-tree changed checks. Earlier build and E2E results remain prior-revision evidence; no reviewer-side tests were executed. (0cbd6f542c1a)
  • Verified merge preservation: The supplied test merge has the exact recorded base and head parents. GitHub blob reads verified that it retains main’s CLI assistant identity, indeterminate transcript-receipt handling, and awaited session-memory read alongside the PR’s extractions. These overlapping paths do not establish a revert. (src/auto-reply/reply/session.ts, 45f4b52d928f)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

PR surface

PR surface statistics unavailable: the file list is incomplete.

Stored data model

Persistent data-model change detected: serialized state: src/auto-reply/reply/restart-recovery-claim.ts, serialized state: src/auto-reply/reply/session-entry-persistence.ts, unknown-data-model-change: src/auto-reply/reply/restart-recovery-claim.ts, unknown-data-model-change: src/auto-reply/reply/session-entry-persistence.ts, unknown-truncated-pull-files. Confirm migration or upgrade compatibility proof before merge.

Labels

Label changes:

  • add P3: This is internal maintenance with no intended user-visible behavior or configuration change.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P3: This is internal maintenance with no intended user-visible behavior or configuration change.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only; repair and merge need explicit maintainer commands such as @clawsweeper autofix or @clawsweeper automerge.

@steipete

steipete commented Oct 8, 2026

Copy link
Copy Markdown
Contributor Author

Compatibility and final CI disposition for 0cbd6f542c1a80a7d9e5ebd0121bb6335e07041c:

The two compatibility checklist items in the completed ClawSweeper review are addressed. A paginated GitHub file inventory contains all 163 changed paths, exactly matching the local merge-base diff. Runtime config and state/schema directories have no changed paths. The two files under config/ are exact shrink-only test ratchets.

  • Config compatibility: no config keys, defaults, CLI flags, public protocol fields or migrations change. The config-command refactors keep the existing parsing, authorization and mutation owners. The review's source inspection likewise found no default or migration change.
  • Stored-data compatibility: restart-recovery-claim.ts factors the same post-admission tracking assignments; its durable patches, execution fences and stored field names remain unchanged. session-entry-persistence.ts keeps the same create opt-in, lifecycle and model-lock rejection, touched-field conflict detection, authoritative merge owner and writer options. The shared argument record adds no serialized fields: the unchanged merge owner projects only session-entry fields. There is no new stored shape requiring migration. The five persistence cases and 53 restart-recovery cases passed on source/test bytes unchanged at this head.

ClawSweeper reported no actionable findings and explicitly found no stored schema, serialized-field contract, default or migration changes. Its automatic compatibility checklist included unknown-truncated-pull-files; the complete inventory and source checks above resolve that uncertainty. The documented boundary harnesses and exact-head CI provide the requested refactor proof; no shipped-application live run is claimed.

Main CI run succeeded on this exact head: 64 successful jobs / 24 planned skips, including openclaw/ci-gate. Its aggregate job duration was 14,255 seconds, including builds, setup and existing tests. The latest PR checks were 86 passing / 60 planned skips, with no pending, cancelled or failing current checks.

All three earlier failures on this head were owned PR-body metadata failures, individually attributed below. They were corrected by restoring the required authored template sections; the subsequent context check passed. No source push, main-red attribution or admin exception was used.

Failed job Attribution and resolution
PR context and evidence — 113321379810 Initial body lacked the exact required section headings; corrected in the PR body.
PR context and evidence — 113322394982 Same heading failure after coverage-link publication; corrected in the PR body.
PR context and evidence — 113323360015 Same heading failure on ready-for-review; corrected in the PR body.

The complete check-run census contains no cancellations or failed zero-step jobs. Historical draft/unselected jobs are explicitly skipped; current selected CI finished successfully. The source tree remains 6fc7e092b47e026314b037d6b6577a2a1194c7ac, with 853 net production lines removed and no protected-path intersection or added lint suppression.

@steipete
steipete merged commit 3ff30b3 into main Oct 8, 2026
232 of 235 checks passed
@steipete
steipete deleted the deslop/d02-p2-20261007 branch October 8, 2026 13:29
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 9, 2026
…claw#167236)

* refactor(auto-reply): share reply state and handler cores

Consolidate command projections, runtime presentation, queue settlement,
session publication, and delivery accounting while retaining caller-specific
authority, recovery, and replay boundaries. Revisit the previous pass with
measured shared-core trials and preserve public contracts and output text.

Remove 845 net production lines. Migrate only tests bound to retired private
presentation/count seams; retain their observable assertions.

* fix(auto-reply): complete shared helper validation

* test: align reply registry and session fixture cleanup

* refactor(reply): finish approval route consolidation

* test(reply): isolate model auth and complete logger fixtures

* refactor(reply): clarify callback bindings
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.
scribe-dandelion-cult added a commit to karmaterminal/openclaw that referenced this pull request Oct 13, 2026
…167236)

openclaw#167236 consolidated reply setup and lifecycle. Kept ours on its shapes:
- FollowupRun.run is now Pick<RunEmbeddedAgentParams> & {...}: our
  drainsContinuationDelegateQueue and traceparent ride the extension block.
- AgentTurnParams: sessionKey/runtimePolicySessionKey moved into the shared
  context upstream; our hookTrigger stays.
- get-reply-run-admission: upstream's traced rebuildPromptBodies with our
  block-text mapping; our refreshSystemEventPromptBodies no longer double-traces.
- agent-runner-core cleanup keeps the preserved post-compaction delegate
  re-stage; RunReplyAgentParams keeps isContinuationWake (replyOperation moved
  upstream).
- agent-runner-execution uses upstream's buildReplyMediaContextParams; our
  line-cap extraction agent-runner-execution-reply-media.ts is deleted.
- continuation fallback-candidate fixture: presentation now takes
  presentPartialReply (classify/sanitize folded upstream).
Field-use counts for hookTrigger, drainsContinuationDelegateQueue, traceparent,
isContinuationWake, sessionContinuationTraceparent unchanged across the merge.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Jhynq2GVpzuVQQieebEubg
scribe-dandelion-cult added a commit to karmaterminal/openclaw that referenced this pull request Oct 14, 2026
…atile-map guard

Upstream openclaw#167236 (absorbed at step 7, 3239e30) moved four reply-run
registry fields out of the resolveGlobalSingleton initializer into
module-level `replyRunState.field ??= new ...()` assignments, and removed
activeSessionIdsByKey. The guard only recognized initializer properties, so
those maps became invisible and their allowlist entries reported "missing"
(red since step 7, carried by checkpoint 23e9574).

- Recognize module-level `??=` property assignments whose right side
  constructs a Map/Set/WeakMap; report a field declared both ways once.
- Drop the allowlist entry for the removed activeSessionIdsByKey.
- Review clearOperationByOperation, previously invisible in the same form.

Control: with the `??=` branch disabled the guard reports the four lazy
fields missing again.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Jhynq2GVpzuVQQieebEubg
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: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. 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