{"record":{"id":"e42d49edb0a7fcb0","repo":"Yeachan-Heo/oh-my-codex","slug":"sendtoworker-submit-failed-trigger-text-still-vi","errorCode":null,"errorMessage":"sendToWorker: submit_failed (trigger text still visible after retries)","messagePattern":"sendToWorker: submit_failed \\(trigger text still visible after retries\\)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"warning","filePath":"src/team/tmux-session.ts","lineNumber":3841,"sourceCode":"  )) return;\n\n  // Adaptive escalation for \"likely unsent trigger text at ready prompt\" cases:\n  // clear line, re-send trigger, then re-submit with deterministic Enter rounds.\n  const latestCapture = await capturePaneAsync(resolveTarget);\n  if (shouldAttemptAdaptiveRetry(strategy, paneBusy, submitPlan.allowAdaptiveRetry, latestCapture || null, text)) {\n    // Keep this branch non-interrupting to avoid canceling active turns on false positives.\n    await sendKeyAsync(resolveTarget, 'C-u');\n    await sleep(80);\n    await sendLiteralTextOrThrow(resolveTarget, text);\n    await sleep(120);\n    if (await attemptSubmitRounds(resolveTarget, text, 4, false, submitPlan.submitKeyPressesPerRound)) return;\n  }\n\n  // Fail-open by default: Codex may keep the last submitted line visible even after executing it.\n  // If you need strictness for debugging, set OMX_TEAM_STRICT_SUBMIT=1.\n  const strict = process.env.OMX_TEAM_STRICT_SUBMIT === '1';\n  if (strict) {\n    throw new Error('sendToWorker: submit_failed (trigger text still visible after retries)');\n  }\n\n  // One last best-effort double Enter nudge, then verify.\n  await sendKeyAsync(resolveTarget, 'Enter');\n  await sleep(120);\n  await sendKeyAsync(resolveTarget, 'Enter');\n\n  // Post-submit verification: wait briefly and confirm the worker consumed the\n  // trigger (draft disappeared or active-task indicator appeared). Fixes #391.\n  await sleep(300);\n  const [verifyCapture, verifyVisibleCapture] = await Promise.all([\n    capturePaneAsync(resolveTarget),\n    captureVisiblePaneAsync(resolveTarget),\n  ]);\n  if (verifyCapture) {\n    if (paneHasActiveTask(verifyCapture)) return;\n    if (\n      !normalizeWorkerTriggerForDraftMatch(verifyCapture).includes(normalizeWorkerTriggerForDraftMatch(text))","sourceCodeStart":3823,"sourceCodeEnd":3859,"githubUrl":"https://github.com/Yeachan-Heo/oh-my-codex/blob/3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2/src/team/tmux-session.ts#L3823-L3859","documentation":"Strict-mode failure after the submit retry loop: the trigger text is still visible in the captured pane content, meaning the worker (e.g. Codex CLI) apparently never consumed the submitted line. By default the library fails open because workers often keep the last submitted line visible; setting OMX_TEAM_STRICT_SUBMIT=1 enables this hard failure for debugging.","triggerScenarios":"Running with OMX_TEAM_STRICT_SUBMIT=1 and, after all Enter retries plus verification, the normalized pane capture still shows the trigger text — worker never executed it (hung, busy, wrong pane, or input dropped).","commonSituations":"Enabling strict mode while a worker keeps echo of submitted lines on screen; worker stuck mid-tool-call; Enter keys sent while worker not reading stdin; slow worker where verification runs before consumption.","solutions":["If strictness isn't required, unset OMX_TEAM_STRICT_SUBMIT (default fail-open behavior)","Increase retry counts / delays before verification so slow workers can consume input","Inspect the pane capture to confirm the worker is actually stuck vs just echoing the line","Ensure Enter is sent when the worker is at a prompt (wait for paneLooksReady)"],"exampleFix":"// before\nOMX_TEAM_STRICT_SUBMIT=1 node orchestrator.js\n\n// after\n// accept fail-open default, or wait for readiness:\nawait waitForPaneReady(resolveTarget);\nawait sendToWorker(resolveTarget, text); // strict off","handlingStrategy":"retry","validationCode":"delete process.env.OMX_TEAM_STRICT_SUBMIT; // use fail-open default","typeGuard":null,"tryCatchPattern":"try { await submitWorker(resolveTarget, text); } catch (err) { if (!/submit_failed/.test(String(err))) throw err; await sleep(1000); await submitWorker(resolveTarget, text); }","preventionTips":["Only enable OMX_TEAM_STRICT_SUBMIT when actively debugging","Wait for the pane to look ready before submitting","Increase delays between Enter retries for slow workers"],"tags":["tmux","submit-verification","strict-mode","codex"],"backgroundTag":"submit-verification-failed","analyzedSha":"3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2","analyzedAt":"2026-08-27T22:18:39.783Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}