8326fa59df
Phase 2 of worker lifecycle fix - applying timeout increases: - hook-constants.ts: DEFAULT 120s→300s, HEALTH_CHECK 1s→30s, RETRIES 15→300 - worker-service.ts: context init 30s→300s, MCP 15s→300s, PowerShell 5s→60s - BranchManager.ts: GIT_COMMAND 30s→300s, NPM_INSTALL 120s→600s - hooks.json: worker start/restart 30s→180s, hook execution 120s→300s 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
25 lines
789 B
TypeScript
25 lines
789 B
TypeScript
export const HOOK_TIMEOUTS = {
|
|
DEFAULT: 300000, // Standard HTTP timeout (5 min for slow systems)
|
|
HEALTH_CHECK: 30000, // Worker health check (30s for slow systems)
|
|
WORKER_STARTUP_WAIT: 1000,
|
|
WORKER_STARTUP_RETRIES: 300,
|
|
PRE_RESTART_SETTLE_DELAY: 2000, // Give files time to sync before restart
|
|
WINDOWS_MULTIPLIER: 1.5 // Platform-specific adjustment
|
|
} as const;
|
|
|
|
/**
|
|
* Hook exit codes for Claude Code
|
|
*/
|
|
export const HOOK_EXIT_CODES = {
|
|
SUCCESS: 0,
|
|
FAILURE: 1,
|
|
/** Show user message that Claude does NOT receive as context */
|
|
USER_MESSAGE_ONLY: 3,
|
|
} as const;
|
|
|
|
export function getTimeout(baseTimeout: number): number {
|
|
return process.platform === 'win32'
|
|
? Math.round(baseTimeout * HOOK_TIMEOUTS.WINDOWS_MULTIPLIER)
|
|
: baseTimeout;
|
|
}
|