Yeachan-Heo/oh-my-codex · error · Error
shutdown_prompt_teardown_failed:${promptTeardownFailures.joi
Error message
shutdown_prompt_teardown_failed:${promptTeardownFailures.join(',')} What it means
Thrown during team shutdown when one or more prompt-mode workers failed to terminate cleanly. The error lists each failed worker as name:error pairs so you can see which worker survived teardown and why.
Source
Thrown at src/team/runtime.ts:5506
if (!sessionName.includes(':')) {
await destroyConfiguredDetachedTeamSession(sanitized, cwd, config);
}
} else {
const promptTeardownFailures: string[] = [];
for (const w of config.workers) {
const teardown = await teardownPromptWorker(
sanitized,
w.name,
w.pid as number | undefined,
cwd,
'shutdown',
);
if (!teardown.terminated) {
promptTeardownFailures.push(`${w.name}:${teardown.error || 'unknown_error'}`);
}
}
if (promptTeardownFailures.length > 0) {
throw new Error(`shutdown_prompt_teardown_failed:${promptTeardownFailures.join(',')}`);
}
}
const shutdownReports = await prepareWorkerWorktreeShutdownReports(config, cwd);
const commitHygieneEntries: TeamOperationalCommitEntry[] = [];
for (const report of shutdownReports) {
const worker = config.workers.find((entry) => entry.name === report.workerName);
if (report.syntheticCommit) {
commitHygieneEntries.push({
recorded_at: new Date().toISOString(),
operation: 'shutdown_checkpoint',
worker_name: report.workerName,
task_id: worker?.assigned_tasks[0],
status: 'applied',
operational_commit: report.syntheticCommit,
source_commit: report.sourceRef,
worktree_path: report.worktreePath,View on GitHub (pinned to 3ad79a8a6f)
Solutions
- Check the worker names in the message; verify whether their prompt processes still exist (ps / tmux list-panes)
- Manually kill leftover worker processes or panes, then rerun shutdown
- Inspect teardown.error for the root cause (e.g. ESRCH, EPERM)
- If recurring, delete the team state dir so shutdown has no stale worker entries
Defensive patterns
Strategy: try-catch
Validate before calling
const alive = config.workers.filter(w => isPromptWorkerAlive(config, w)); if (alive.length === 0) skip shutdown prompt teardown;
Try / catch
try { await shutdownTeam(...); } catch (e) { if (String(e.message).startsWith('shutdown_prompt_teardown_failed:')) { /* parse name:err pairs, kill stragglers, retry once */ } else throw e; } Prevention
- Check worker liveness before initiating shutdown
- Ensure workers are stopped gracefully before killing panes
- Run shutdown from the same cwd the team was created in
When it happens
Trigger: Calling the team shutdown API with worker_launch_mode='prompt'; teardown of a worker returns terminated=false (e.g. process already dead, kill signal failed, or an unknown teardown error).
Common situations: Workers whose prompt process crashed or exited before shutdown, stale pane/process IDs in team config, or kill permission issues on the host.
Related errors
- Usage: omx team shutdown <team-name> [--force] [--confirm-is
- cleanupErrors.join(' | ')
- Conflicting setup Team mode flags: ${source} selects ${next}
- Invalid setup Team mode: ${next}. Expected one of: enabled,
- Missing setup Team mode value after --team-mode. Expected on
AI-assisted analysis of Yeachan-Heo/oh-my-codex@3ad79a8a6f (2026-08-27).
Data as JSON: /api/errors/c23026827c2a64f8.
Report an issue: GitHub.