Skip to content

perf(agent-manager): enrich only candidate PIDs and cache start times - #277

Merged
codeaholicguy merged 3 commits into
mainfrom
perf/266-enrich-candidate-pids
Sep 29, 2026
Merged

codeaholicguy merged 3 commits into
mainfrom
perf/266-enrich-candidate-pids

Conversation

@codeaholicguy

@codeaholicguy codeaholicguy commented Sep 28, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Run lsof and process-start enrichment only for PIDs accepted by an adapter’s canHandle check.
  • Cache process start times.
  • Prevent broad process names such as node from enriching every matching machine process.

Closes #266

Validation

  • Commit passed the repository pre-commit secret scan, lint, and tests for all six projects.

Risks

  • None known.

codeaholicguy and others added 3 commits September 29, 2026 14:52
…#266)

listAgents now passes an isCandidate predicate (some adapter whose processNames match and whose canHandle accepts) to the shared snapshot. lsof and ps lstart run only for those PIDs; other name-matched processes are still returned unenriched so Kiro can keep walking parent chains. Start times are cached per PID, evicted when the PID leaves the base ps listing and ignored when its ppid/command change (PID reuse).
…refresh test (#266)

The shared capture now caches start times (#266), so earlier tests in the file skip ps lstart. Use createProcessSnapshotCapture() to assert a cold refresh.
…dapter snapshots (#281) (#287)

Every adapter's fallback captureProcessSnapshot call now passes isCandidate: canHandle, so lsof and ps lstart no longer run for unrelated processes (every Node.js process for the node-based Gemini, Pi and Kiro adapters). Non-candidates are still returned un-enriched, which keeps Kiro's kiro-cli-chat parent-chain walk working.
@codeaholicguy
codeaholicguy force-pushed the perf/266-enrich-candidate-pids branch from bb33096 to 5a7fb9d Compare September 29, 2026 12:54
@codeaholicguy
codeaholicguy merged commit 2fb92e8 into main Sep 29, 2026
7 checks passed
@codeaholicguy
codeaholicguy deleted the perf/266-enrich-candidate-pids branch September 29, 2026 12:59
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(agent-manager): enrich only candidate PIDs ("node" in processNames enriches every Node process)

1 participant