Repository navigation
Conversation
Prepare recorded child authority with immutable registry rows and index unfinished work plus retained cleanup deadlines. Keep runtime custody, recovery, and session-deletion checks at their effect boundaries. Avoid empty-sweep read scopes and non-yielded settlement promises.
|
🦞👀 Pull request received. I will update this pull request when review starts. |
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. |
|
CI attribution for head The same full file fails identically on the unchanged main baseline The mismatch predates this PR: #181260 ( The six other files in this CI shard pass (173 passing tests overall). Focused sweep, authority, recovery, retention, import-closure, lint, and core typecheck proof is recorded in the PR body; independent review is clean. This failure is retained and attributed, not rerun away or reported as green. |
Prepare recorded child authority with immutable registry rows and index unfinished work plus retained cleanup deadlines. Keep runtime custody, recovery, and session-deletion checks at their effect boundaries. Avoid empty-sweep read scopes and non-yielded settlement promises.
Prepare recorded child authority with immutable registry rows and index unfinished work plus retained cleanup deadlines. Keep runtime custody, recovery, and session-deletion checks at their effect boundaries. Avoid empty-sweep read scopes and non-yielded settlement promises. Source-commit: 619555b Co-authored-by: RomneyDa <[email protected]>
What Problem This Solves
Idle registry sweeps re-derived child identity up to three times per retained run, resolved an unchanged runtime owner just to read its retirement tombstone, and allocated async yield checks for non-yielded rows. Even settled history with no due cleanup took that path.
User Impact
Reduces idle subagent-registry allocation and sweep time while preserving completion, recovery, cancellation, and retention behavior. No configuration, schema, or public-contract changes.
Why This Change Was Made
The registry prepares recorded child authority alongside its immutable row projection. Its publication owner maintains unfinished-work and retention-deadline candidates; replacement, deletion, and reset update those indexes. Settled rows join the sweep only when cleanup is due. Empty sweeps skip read-scope preparation, and only yielded rows allocate a yield-settlement operation. Completion retirement reads the existing runtime-owner tombstone directly.
Live custody and current Gateway/row checks after awaits remain at the effect boundary. The original cleanup-identity capture and session-deletion compare-and-swap are preserved. Normal cadence remains 60 seconds; explicit scheduling defaults to 5 seconds, with recovery retries between 1 and 60 seconds.
Production delta: 164 additions / 51 deletions, net +113 lines. The additional in-memory index preserves existing future archive and strict five-minute session-retention deadlines while excluding settled history. It also preserves unfinished recovery, delivery, and cancellation obligations; there is no second persistent owner.
Evidence
Paired measurements
The committed
scripts/perf/subagent-sweep-measure.tsexercises the real production sweeper and canonical immutable registry.settledis retained completed history;mixedis 70% history, 10% live claimed runs, 10% pending delivery, and 10% future archive. Every run asserts exact record identity/digests and fails on unexpected effects.Each process executes 12,000 measured sweeps after 100 warmups, with 1 ms pacing and allocation sampling including collected objects. Linux, Node 26.12.1, identical dependency lockfiles, isolated synthetic state, concurrent baseline/candidate under one exclusive quiet lock. Preparation uses CPUs 0–63; measurement uses 64,66,…,94 versus 65,67,…,95, swapped for pair two. The shared production guard runs before/during each pair, with 8 GiB per-process memory limits. No guard-interrupted pair is included.
Acceptance was recorded before measurement: v5.2/v5.3, >=20% adverse mean or >=10% adverse in both pairs; opposite signs or >5× baseline differences require absolute deltas and a third pair for gating metrics. p95/p99 need 200/1,000 samples per side. Major GC is context below 50 collections. GC pause-tail shifts below 1 ms are context, as are higher tails with >=20% fewer collections and no total-GC increase. The maximum-pause gate remains
max(50 ms, 2 × baseline maximum).Baseline registry code is
7a1d72c44102; the candidate uses the final changed-source bytes. The publication rebase incorporated unrelated main changes without changing those registry bytes. Results are source-owner measurements, not whole-Gateway/model latency or post-deployment evidence. Allocation/minute is the same value as allocation/sweep at the normal one-minute idle cadence; earlier requested sweeps add proportionally.Values below are paired means. The 50-row settled case includes a third pair to resolve opposite-sign GC/event-loop deltas; the other cases use the two swapped pairs.
The 50-row settled third-pair decision uses absolute mean deltas: total GC +0.000036 ms/sweep (0.003902 → 0.003938), event-loop p99 -0.174421 ms (1.584810 → 1.410388). No gating metric is adversely beyond the acceptance thresholds. Per-pair total-GC deltas were +1.920 ms (+3.99%), −10.362 ms (−21.23%), and +9.747 ms (+22.41%) per 12,000 sweeps; the absolute mean is +0.435 ms (+0.93%). Event-loop p99 deltas were +0.021504 ms (+1.05%), −0.295936 ms (−21.28%), and −0.248832 ms (−18.81%), giving −0.174421 ms (−11.01%) from the absolute means.
Per-pair GC, promotion, and tail evidence
Every candidate minor-GC tail has fewer than 200 samples; these pause tails are context. Major GC remains below 50 collections per side. The largest candidate pause is 33.761 ms, below the 50 ms max-pause floor. Total GC/work and promotion remain the gating GC metrics.
Validation
pnpm tsgo:core, native checker) pass. No broad local suite or Testbox allocation.39937949361has one attributed inherited failure inchecks-node-changed-compact-large-16: the progress-card external-silence assertion expects retirement despite a still-required public reply. The same full file fails on unchanged main7a1d72c44102and this head (25 passed, 1 failed each); the exact pre-PR parent93a5a35ecf7falso reproduces the named assertion. fix(agents): settle consumed yield cohorts without retry #181260 changed the required-reply policy and added the opposite expectation in its delivery test, leaving this older worker assertion stale. The failing test and reply-policy sources are identical at CI basec4b9005153d9. All other jobs in the completed CI run pass or are intentionally skipped; security checks pass. The aggregate CI gate is red solely because of this attributed inherited failure. Landing uses the authorized inherited-failure exception. No CI rerun or deployment was performed.Reproduction (each side uses its own new state/log/result paths and a shared future start epoch):