chore: remove dead code and unused exports (-159 lines)

Remove confirmed-unused code found via team-based codebase analysis:
- Dead interfaces: SessionResponse (types.ts), PlannerResult (plan-orchestrator.ts)
- Dead functions: withTimeout (session.ts), getOpenCodeAugmentedPath, resetOpenCodeCache (opencode-cli-resolver.ts)
- Dead config constants: MAX_RUN_SUMMARY_EVENTS, TRIM_RUN_SUMMARY_TO, MAX_MESSAGES_PER_CHANNEL (buffer-limits.ts), MAX_TRACKED_AGENTS, MAX_SUBAGENT_ACTIVITY_PER_AGENT, MAX_TOOL_RESULTS_PER_AGENT, COMPLETED_TODO_TTL_MS (map-limits.ts)
- Dead legacy code: idleTimer property + clearIdleTimer() no-op method + 6 call sites (respawn-controller.ts)
- Stale barrel re-exports: createAnsiPatternFull/Simple, validateTokenCounts/Cost, stripAnsi, normalizePhrase, getOpenCodeAugmentedPath (utils/index.ts)
- Un-exported internal-only symbols: ErrorMessages (types.ts), destroyRalphLoop (ralph-loop.ts)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
arkon
2026-02-28 02:01:21 +01:00
co-authored by Claude Opus 4.6
parent cbb1ce8657
commit 545913790b
9 changed files with 7 additions and 159 deletions
+1 -22
View File
@@ -641,9 +641,6 @@ export class RespawnController extends EventEmitter {
/** Current state machine state */
private _state: RespawnState = 'stopped';
/** Timer for idle detection timeout */
private idleTimer: NodeJS.Timeout | null = null;
/** Timer for step delays */
private stepTimer: NodeJS.Timeout | null = null;
@@ -1505,7 +1502,6 @@ export class RespawnController extends EventEmitter {
this.elicitationDetected = false; // Clear on new work cycle
this.resetHookState(); // Clear hook signals on new work
this.lastWorkingPatternTime = now;
this.clearIdleTimer();
// Cancel hook confirmation timer if running
this.cancelTrackedTimer('hook-confirm', this.hookConfirmTimer, 'working patterns detected');
@@ -1608,7 +1604,6 @@ export class RespawnController extends EventEmitter {
* @fires stepCompleted - With step 'update'
*/
private checkUpdateComplete(): void {
this.clearIdleTimer();
this.log('Update completed (ready indicator)');
this.emit('stepCompleted', 'update');
@@ -1643,7 +1638,6 @@ export class RespawnController extends EventEmitter {
* @fires stepCompleted - With step 'clear'
*/
private checkClearComplete(): void {
this.clearIdleTimer();
// Clear the fallback timer since we got prompt detection
this.cancelTrackedTimer('clear-fallback', this.clearFallbackTimer, 'prompt detected');
this.clearFallbackTimer = null;
@@ -1667,7 +1661,6 @@ export class RespawnController extends EventEmitter {
* @fires stepCompleted - With step 'init' (if no kickstart)
*/
private checkInitComplete(): void {
this.clearIdleTimer();
this.log('/init completed (ready indicator)');
// P2-004: Record step completion
@@ -1715,7 +1708,6 @@ export class RespawnController extends EventEmitter {
* @fires stepCompleted - With step 'init'
*/
private checkMonitoringInitIdle(): void {
this.clearIdleTimer();
if (this.stepTimer) {
clearTimeout(this.stepTimer);
this.stepTimer = null;
@@ -1757,7 +1749,6 @@ export class RespawnController extends EventEmitter {
* @fires stepCompleted - With step 'kickstart'
*/
private checkKickstartComplete(): void {
this.clearIdleTimer();
this.log('Kickstart completed (ready indicator)');
this.emit('stepCompleted', 'kickstart');
@@ -1767,22 +1758,10 @@ export class RespawnController extends EventEmitter {
this.completeCycle();
}
// Note: Legacy startIdleTimer removed - now using completion-based detection
// with startCompletionConfirmTimer() and startNoOutputTimer() instead.
/** Clear the idle detection timer if running (legacy cleanup) */
private clearIdleTimer(): void {
if (this.idleTimer) {
clearTimeout(this.idleTimer);
this.idleTimer = null;
}
}
/** Clear all timers (idle, step, completion confirm, no-output, pre-filter, step confirm, auto-accept, hook confirm, and clear fallback) */
/** Clear all timers (step, completion confirm, no-output, pre-filter, step confirm, auto-accept, hook confirm, and clear fallback) */
private clearTimers(): void {
// Clear tracked timers map first to avoid stale entries during individual cleanup
this.activeTimers.clear();
this.clearIdleTimer();
if (this.stepTimer) {
clearTimeout(this.stepTimer);
this.stepTimer = null;