Skip to content

perf(subagents): stop retained child Git polling - #216

Merged
tt-a1i merged 1 commit into
mainfrom
codex/issue-182-stop-child-git-polling
Aug 28, 2026
Merged

tt-a1i merged 1 commit into
mainfrom
codex/issue-182-stop-child-git-polling

Conversation

@tt-a1i

@tt-a1i tt-a1i commented Aug 28, 2026

Copy link
Copy Markdown
Collaborator

Problem

Retained Direct and Workflow child sessions load OpenPI's interactive git-info extension even though headless children cannot use its dashboard or slash commands. Each loaded instance refreshes every five seconds and starts four Git subprocesses (one repository probe plus branch, head, and status reads), so idle work scales the polling load with the retained child count.

Closes #182.

Value

Headless children no longer create recurring Git work while they are retained. The structural subprocess count per refresh interval changes from 4/32/256 for 1/8/64 retained children to 0/0/0, without removing child model tools, skills, or ordinary OpenPI extensions. Parent sessions keep the interactive Git dashboard unchanged.

Approach

  • Apply a child-only package filter that force-excludes OpenPI's built-in extensions/git-info/index.ts before extension import for npm, Git, and local OpenPI package sources.
  • Add an exact canonical-path fallback at the child resource boundary for Pi's direct extension file and directory settings, which do not use package filters.
  • Preserve package settings that already disable all extensions, and avoid matching unrelated manifestless packages nested under an OpenPI checkout.
  • Keep this at createChildResources, the shared Pi-native resource seam used by both Direct and Workflow children.

Validation

  • Regression-first check: the new retained-child test failed on the base revision because one child still created one git-info poller.
  • node --test --experimental-strip-types tests/extensions/shared/child-session.test.ts tests/extensions/git-info/index.test.ts tests/extensions/subagents/pi-backend.test.ts — 20 passed.
  • bun run check — passed; the 12 reported Effect diagnostics are pre-existing and tracked by file-search: 修复 Effect failure channel 与多次 provide 诊断 #170.
  • bun run test — 917 Node tests and 30 Vitest tests passed.
  • Independent design, adversarial, and test reviews completed with no remaining findings. Review fixes included making force-exclusion override absolute + includes, covering direct extension sources, preventing nested-package false positives, and adding non-vacuous parent/pre-load controls.
  • No manual Pi/TUI smoke was run; this change affects only headless child resource loading and has deterministic loader coverage.

Impact

  • User-visible behavior: retained headless children stop idle Git polling; parent-session Git UI remains available.
  • Model-visible context/tools: unchanged. git-info provides commands and UI handlers, not child model tools.
  • Runtime/lifecycle: Direct and Workflow child resources omit the built-in OpenPI git-info extension; all other child resources retain existing behavior.
  • Persisted config/data: unchanged. Filtering is applied only to ephemeral child settings and resources.
  • Compatibility/risk: child-local /lg, /pr, and Git dashboard handlers are absent, but these interactive surfaces are not usable in print-mode headless children. Exact package identity and canonical-path checks preserve unrelated extensions, including same-relative-path nested packages.

@tt-a1i
tt-a1i merged commit 87f62e9 into main Aug 28, 2026
2 checks passed
@tt-a1i
tt-a1i deleted the codex/issue-182-stop-child-git-polling branch August 28, 2026 04:46
agnitum2009 pushed a commit to agnitum2009/openpi that referenced this pull request Aug 28, 2026
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): retained child 持续运行每 5 秒 Git polling

1 participant