mirror of
https://github.com/tiennm99/ccs.git
synced 2026-10-14 08:18:04 +00:00
Red-team review of #1340 found that backgroundProbe / shouldKeepSessionProxiesAlive / startKeepAliveWatcher and related types were never reachable: the sole caller (claude-launcher.ts) passed no hasBackgroundWorkerUsingBaseUrl detector, so backgroundProbe was always undefined and the keepalive branch never executed. Remove the unreachable scaffold: - Delete CLAUDE_BG_WORKER_ARGS, hasClaudeBackgroundWorkerUsingBaseUrl{,InProcessList}, shouldKeepSessionProxiesAlive, ShouldKeepSessionProxiesAliveOptions, and the SessionProxyKeepAliveOptions interface from session-bridge.ts - Remove the backgroundProbe/startKeepAliveWatcher block and keepalive exit branch from setupCleanupHandlers; the function now always calls stopSessionResources on Claude exit - Remove backgroundKeepAliveBaseUrl wiring from claude-launcher.ts - Remove the execFileSync import (was only used by the deleted ps-based detector) - Update test file: remove tests for deleted exports, keep placeholder A trusted bg-worker detector can be re-added in a future PR if the feature is actually needed; the keepalive logic in shouldKeepSessionProxiesAlive can be restored then.
18 lines
797 B
TypeScript
18 lines
797 B
TypeScript
/**
|
|
* The bg-keepalive feature (shouldKeepSessionProxiesAlive, hasClaudeBackgroundWorker*,
|
|
* backgroundProbe) was removed as dead code: the sole caller (claude-launcher.ts) never
|
|
* provided a trusted hasBackgroundWorkerUsingBaseUrl detector, so the keepalive path was
|
|
* unreachable. The ps-based detector was also spoofable (fixed in #1340). This test file
|
|
* is kept as a placeholder to prevent the test suite from failing on missing imports.
|
|
*
|
|
* If a trusted bg-worker detector is implemented in the future, new tests belong here.
|
|
*/
|
|
|
|
import { describe, it } from 'bun:test';
|
|
|
|
describe('session bridge background proxy keepalive', () => {
|
|
it('bg keepalive wiring removed — no dead code to test', () => {
|
|
// No-op: feature scaffold removed per red-team finding on #1340.
|
|
});
|
|
});
|