Skip to content

perf(subagents): bound missing Codex rollout discovery - #811

Merged
Juliusolsson05 merged 2 commits into
mainfrom
perf/codex-child-discovery
Sep 7, 2026
Merged

Juliusolsson05 merged 2 commits into
mainfrom
perf/codex-child-discovery

Conversation

@Juliusolsson05

@Juliusolsson05 Juliusolsson05 commented Sep 5, 2026 •

Copy link
Copy Markdown
Owner

Missing Codex child rollouts previously triggered a recursive stat walk for every child on every parent record/poll. This change performs one directory-entry traversal for all unresolved children in a tracker, retries misses at most once per five seconds, and stops unrelated parent records from requesting I/O. Known children retain the existing 1.2-second tail cadence. Deleted paths and changed roots discard stale offsets; symlinks are not followed.

Validation:

  • 39 focused subagent tests pass, including the bug(subagents): overlapping refreshes fold child transcript records repeatedly #802 concurrency/lifecycle regressions and five discovery cases (shared scan, late creation/tailing, symlinks, deletion/replacement, root changes).
  • Synthetic 1,000-file fixture: three missing children use 11 directory reads and zero file stats. Another 1,000 unrelated parent records and three sequential refreshes add no discovery work within the window. The earlier audit measured 1,010 stats per missing-child scan. These are operation counts, not claimed production CPU gains.
  • npm run typecheck, npm run test:contract and git diff --check pass. Fresh main-targeted full CI passed before merge.

Tradeoff: a newly available child can wait five seconds plus one poll (1.2 seconds) and scan duration. Misses are never permanent. The budget is per tracker; there is no archive-sized global filename cache and no cross-parent sharing. No settings/protocol migration or edits in A5/B7-owned areas. Plan was committed before code.

Fixes #803
Refs #809

Dependency #809 is merged. This PR now targets main bb84772a; range-diff confirms its implementation patches are unchanged after rebase. Current head: a5539a92. Fresh CI passed before merge. The user authorized merging once current checks pass on 2026-09-07.

Merged with explicit user authorization on 2026-09-07 as 7acc3986 after both current-head CI gates passed. No outstanding review feedback. The resolving issue is closed.

Share a Dirent traversal across unresolved children and cache misses for five seconds. Ignore unrelated parent records, keep known-child tailing independent, and invalidate vanished or changed-root paths.

Refs #803
@Juliusolsson05
Juliusolsson05 force-pushed the perf/codex-child-discovery branch from 64b4b10 to a5539a9 Compare September 7, 2026 17:04
@Juliusolsson05
Juliusolsson05 merged commit 7acc398 into main Sep 7, 2026
2 checks passed
@Juliusolsson05
Juliusolsson05 deleted the perf/codex-child-discovery branch September 7, 2026 17:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

perf(subagents): bound repeated full-tree discovery for missing Codex rollouts

1 participant