fix(server): open Claude sessions on macOS share one process-table poll #37585
Mergedjuliusmarmingemerged 2 commits into
main fromrefs/pull/37585/headmerged by juliusmarminge View on GitHubPushedabed6b5
- @@ -554,17 +569,5 @@554- const roots = cliRunning ? [cliPid] : [];555- for (const [key, row] of tracked) {556- if (running.has(key)) roots.push(row.pid);557- else tracked.delete(key);558- }559- for (const row of claudeDescendants(rows, roots)) tracked.set(identity(row), row);560- return running;561- },562- (effect) => reading.withPermits(1)(effect),563- );569+ const read = <A>(apply: (rows: ReadonlyArray<ClaudeProcessRow>) => A) =>570+ reading.withPermits(1)(readProcessTable.pipe(Effect.map(apply)));564571 return {565- tracked: tracked as ReadonlyMap<string, ClaudeProcessRow>,566- refresh: refresh(true).pipe(Effect.asVoid),567- /** Reads the table after the CLI exited: what it left that is still the same process. */568- leftovers: refresh(false).pipe(569- Effect.map((running) => [...tracked.values()].filter((row) => running.has(identity(row)))),570- ),572+ poll: read((rows) => {573+ for (const tracker of live) tracker.record(rows, true);
Pushed0fa89dd
github-actions[bot](GitHub profile, opens in a new tab) removed labelssize:M
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:L
juliusmarminge merged this047a86f
juliusmarminge closed this
Sign in to join this conversation.
coderabbitai[bot](GitHub profile, opens in a new tab) reviewed
Actionable comments posted: 1
85aa9e93-7f30-4f00-8fb9-8979ec94f4f9Reviewing files that changed from the base of the PR and between 5e63b927d256b725bfde515e4e3a0e5d19b54397 and abed6b5cce48f2e2e92bb15083d3cdaf62833a08.
apps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.tsapps/server/src/orchestration-v2/Adapters/ClaudeAgentSdkQueryRunner.test.tsIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 3 remain after this review.