Skip to content

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

Open
Juliusolsson05 wants to merge 2 commits into
fix/subagent-refresh-coalescingfrom
perf/codex-child-discovery
Open

perf(subagents): bound missing Codex rollout discovery#811
Juliusolsson05 wants to merge 2 commits into
fix/subagent-refresh-coalescingfrom
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.

Dependency: based on fix/subagent-refresh-coalescing / #809. Review this PR's incremental diff. Merge #809 first, then retarget this PR to main and rerun checks. No merge is currently authorized.

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. Both full CI gates pass after the main rebase.

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

Current validation: rebased onto main f7507980 (toolkit #812 and MCP repair #818), head 64b4b105. Source changes from the earlier implementation are preserved; both required CI gates pass on this head (CI run). No merge is authorized.

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 fix/subagent-refresh-coalescing branch from 689b110 to 51f47af Compare September 6, 2026 00:21
@Juliusolsson05
Juliusolsson05 force-pushed the perf/codex-child-discovery branch from db0f063 to 64b4b10 Compare September 6, 2026 00:21
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.

1 participant