Repository navigation
refactor(subagents): simplify prepared registry postimages - #175604
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex review: needs maintainer review before merge. What this changesThis PR replaces redundant deep copies, reuses semantic kill-intent comparison, and removes duplicate checks within synchronous Stop planning. Review scores
ProductKind: Refactor · Worth it: Yes Merge readiness✅ Ready for maintainer review Keep open: this is a useful maintainer-directed simplification with no actionable introduced defect found and passing exact-head CI. Priority: P3 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherSubagent registry owners receive prepared spawn, completion, recovery, and cancellation facts, persist canonical records through SQLite workers, and publish acknowledged state to lifecycle consumers. flowchart TD
A[Spawn and Stop requests] --> B[Registry mutation owner]
B --> C[Canonical record codec]
C --> D[SQLite worker]
D --> E[Commit receipts]
E --> F[Published lifecycle state]
Technical reviewBest possible solution: Merge the focused simplification while retaining the existing immutable publication, encoding, and Stop settlement boundaries. Do we have a high-confidence way to reproduce the issue? This PR claims behavior-preserving cleanup rather than a reproducible user bug; review used source and supplied CI evidence without executing target code. Is this the best way to solve the issue? The change fits the existing owners: modified nested containers are replaced before mutation, publication retains isolation, and removed authority checks remain enforced at meaningful boundaries. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 8cfa2ec42441. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
PR surfaceSource -5, Tests +20. Total +15 across 14 files. Added test files: 0. View PR surface stats
Review metrics
LabelsLabel changes: No label changes. Label justifications:
Rating scale6/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. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 17, 2026, 11:01 AM ET / 15:01 UTC. |
|
Merged via squash.
|
What Problem This Solves
Registry transitions were deep-copying owner-prepared records even when they only replaced the root or freshly constructed nested state. The codec likewise copied the entire run to normalize a small set of containers, and Stop repeated authority checks inside non-yielding code. This area-only refactor removes that duplicate work; it does not claim a measured speedup or change public configuration, stored formats, retention, or permissions.
User Impact
No user-visible behavior change is intended. Registry recovery, accepted Stop settlement, and persisted records retain their existing contracts; no migration or configuration change is required.
Why This Change Was Made
Reuse owner-prepared facts and existing comparison helpers instead of copying unchanged nested state or repeating same-frame authority checks. Preserve the actual trust, effect, and settlement boundaries.
Best-effort tradeoffs accepted
0ed453a7c436). All modified nested containers are replaced before mutation; unsupported internal mutation after handoff would now be shared. Current owners do not perform it, and no human incident requiring that private mutation contract is established. The termination plan retains its deep clone because normal collector completion does mutate nested completion.ba9c803ae214); terminal reply normalization constructs its own value. It no longer isolates unrelated private nested facts from unsupported mutation. The new codec case protects persisted restart-cleanup normalization and unchanged live/shared reply state; every invalid encoding case remains.f68a44810046). There is no intervening await requiring another currentness read. Checks after awaits, before abort/queue effects, after synchronous abort callbacks, at native transaction/commit grants, and during settlement remain; revoked authority is not accepted as best effort.f68a44810046). Reordered keys and absent versus undefined optional fields now compare equal; incidental object representation is not an intent distinction. No claim field or live row/session/generation predicate is removed. Accepted Stop custody, normal write settlement, unknown-write escalation, FIFO, and durable receipts remain.0ed453a7c436). These private constructors already supply optional non-null strings; unsupported untyped null calls no longer receive this extra normalization. Raw/public boundaries and all snapshot behavior remain. Newer main's queue logging deletion, missing-completion-source Gateway recovery settlement, and unavailable legacy wake/yield cleanup are preserved.Scope, provenance, and review
Recovered exact hunks from 0ed453a (seven registry and two typed spawn files), f68a448 (three cancellation files), and ba9c803 (codec and its test). Recovered on fresh main dca14ad; the prior independently reviewed packet used base 1761140. Fourteen files: thirteen production files +29/-34 (five net removed), one test +20/-0. Total +49/-34. No LSP privacy, Telegram, standalone session-memory Phase E, audit, cron, or other queued area changes.
Cancellation/recovery mechanisms from #133076/#131553/#163195 remain protected; their ownership, reselect, admission drain, FIFO publication, and accepted settlement are not retired. These PR references are mechanism history, not evidence of human actual-use incidents; #163195's publication/interleaving controls are synthetic. Author simplification and test-value audit completed: no new owner, compatibility path, test seam, suppression, baseline exception, or redundant test family. Independent P0-P2 review completed assessment and final source verification with one P1, not a scoped-clean verdict. The finding alleged absent completion could become an empty object and persist; declined after checking that isCanonicalSubagentRunRecord requires a completion record with boolean required, and bindSubagentRunRecord throws before the spread for absent completion. The unchanged normalizer never supplies missing completion either. No accepted/actionable findings remain; no source repair or cosmetic review rerun. The root coordinator owns final acceptance and publication.
Evidence
Exact donor hunks applied cleanly; git diff --check passes. No tests, typechecks, lint, install, build, broad checks, or remote leases were run by the preparation worker. Focused codec, worker claim/accepted-stop/publication/metadata, sweeper recovery, persistence, launch, and spawn owner proof was pending at preparation; the current hosted proof and retained local limitation are recorded below. Historical donor proof is not a new-head pass.
Fresh-main transfer: all 13 other postimages match the reviewed packet exactly. Gateway recovery keeps its newer missing-source and legacy continuation handling verbatim; its only packet change remains the root-only postimage copy. Current binary patch SHA256: 7a06d8d19b7602d6c4a678a6abd61aec8b299aefa4fe78950c50d410effc1688. Formatting passes all 14 TypeScript files and diff-check passes. The only new runtime import targets the existing six-field comparator leaf, which has no runtime import of its own, so it introduces no cycle component. Fresh functional/type proof is not qualified by the once-installed task dependency version; exact-head CI owns broad proof.
Pre-publication source freshness through main
6e7b10f4a05: the only later target change is the sender-profile restoration inrestoreSubagentCompletionSource, separate from this packet's root-copy change inrecoverSubagentRunGatewayOwner. That sender/accepted-hash binding must remain intact. This is source inspection, not a new functional or merge-result claim.The mandatory serial suppression audit completed in 54.83 seconds (Vitest 37.69 seconds; tests 16.37 seconds): four passed, one failed. The explicit allowlist expects 94 entries but current source yields 95: unchanged backup-restore has two preserve-caught-error directives rather than one, and unchanged native-bridge has an unlisted post-message-target-origin directive. This packet modifies no directive-bearing file: all 14 paths are modifications only, with no oxlint-disable or eslint-disable text on base or candidate. The complete suppression-bearing input set is therefore unchanged. The scanner/test/helpers and both reported files retain the same blobs. This is source/input attribution, not an executed baseline replay or a passing audit; no allowlist or suppression was added.
Exact-head hosted CI 39041005289, attempt 1 passed for
0fe2973816543906dbebdcf5d2dd7bf18b26e61d. The complete census has 194 exact-head completed checks: 69 success, 122 skipped, one neutral CodeQL, and two historical side-workflow cancellations with successful same-head replacements; no failure or active check remains. The actual workflow has 69 jobs: 41 success and 28 unselected skips. The aggregate gate confirms all 13 selected logical lanes passed, with no selected proof gap: changed Node tests, UI E2E, ratchets, lint, test types, extension boundaries, and additional checks. Build artifacts were not selected, so no build pass is claimed. This does not retroactively turn the earlier local inventory audit into a pass.Preflight attests tested merge
4a4cb1d32c068b9b6613722707be7afd1080c9f5, with ordered parentscc271f85709b3bea38fffecfc1c53ebc9a404109and the exact head, tree73a2eb08c6b5556a864aef3024d2fd5108818880. Independent commit/compare checks confirm precisely the 14 reviewed paths and production +29/-34 (five candidate net lines removed), with 20 test lines added. These describe the tested checkout, not a landed-result or unique-production-credit claim. No CI rerun, source push, or rebase was used to obtain green.