Yeachan-Heo/oh-my-codex · error · Error
Worker ${toWorker} not found in team
Error message
Worker ${toWorker} not found in team What it means
Thrown when dispatching a worker-to-worker message: the recipient name toWorker does not match any worker in the team config.
Source
Thrown at src/team/runtime.ts:6950
config,
dispatchPolicy,
cwd,
fallbackNotify: async () => await notifyLeaderAsync(config, triggerDirective.text, cwd),
});
}
async function sendRecipientMailboxMessage(params: {
teamName: string;
fromWorker: string;
toWorker: string;
body: string;
config: TeamConfig;
dispatchPolicy: TeamPolicy;
cwd: string;
}): Promise<DispatchOutcome> {
const { teamName, fromWorker, toWorker, body, config, dispatchPolicy, cwd } = params;
const recipient = config.workers.find((worker) => worker.name === toWorker);
if (!recipient) throw new Error(`Worker ${toWorker} not found in team`);
const triggerDirective = buildMailboxTriggerDirective(
toWorker,
teamName,
1,
resolveInstructionStateRoot(recipient.worktree_path),
);
const transportPreference = resolveWorkerMailboxTransportPreference(config, dispatchPolicy);
const queuedOutcome = await queueDirectMailboxMessage({
teamName,
fromWorker,
toWorker,
toWorkerIndex: recipient.index,
toPaneId: recipient.pane_id,
body,
triggerMessage: triggerDirective.text,
intent: triggerDirective.intent,
cwd,View on GitHub (pinned to 3ad79a8a6f)
Solutions
- List the team's workers from its config and use an exact name
- If the worker was removed by scaling, re-dispatch to an existing worker or scale up first
- Avoid assuming worker names; resolve them dynamically
Example fix
// before
dispatch({ teamName, fromWorker: 'w1', toWorker: 'workr-2', body, ... });
// after
const config = await readTeamConfig(teamName, cwd);
const toWorker = config.workers.find(w => w.name.startsWith('workr'))!.name; Defensive patterns
Strategy: type-guard
Validate before calling
const cfg = await readTeamConfig(teamName, cwd); if (!cfg.workers.some(w => w.name === toWorker)) throw new Error(`unknown worker ${toWorker}`); Type guard
const workerExists = (cfg: TeamConfig, name: string) => cfg.workers.some(w => w.name === name);
Prevention
- Resolve worker names from config at runtime instead of hardcoding
- Handle not-found before dispatch with a clear user error
When it happens
Trigger: Calling the dispatch/send API with a toWorker name not present in config.workers (typo, renamed worker, or scaled-down worker).
Common situations: Hardcoding worker names after a team is recreated with different names, or referencing a worker removed by scaleDown.
Related errors
- mailbox_notify_failed:${finalOutcome.reason}
- 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
- Usage: omx team [N:agent-type] "<task description>"
AI-assisted analysis of Yeachan-Heo/oh-my-codex@3ad79a8a6f (2026-08-27).
Data as JSON: /api/errors/b5cb306a56b2293a.
Report an issue: GitHub.