jackwener/OpenCLI · error · CommandExecutionError
${uiError.message}
Error message
${uiError.message} What it means
In post.js's private-route → UI fallback chain, when the UI-based share path (executeUiInstagramPost) throws a CommandExecutionError, it is re-thrown with a new hint built by buildFallbackHint(error, uiError), which combines why the private API path failed and why the UI path failed. The message is the original uiError message; only the remediation hint is enriched.
Source
Thrown at clis/instagram/post.js:1465
content,
existingPostPaths,
commandAttemptBudget,
preUploadDelaySeconds,
uploadAttemptBudget,
previewProbeWindowSeconds,
finalPreviewWaitSeconds,
preShareDelaySeconds,
inlineUploadRetryBudget,
installProtocolCapture,
drainProtocolCapture,
forceFreshStart: true,
});
}
catch (uiError) {
if (uiError instanceof AuthRequiredError)
throw uiError;
if (uiError instanceof CommandExecutionError) {
throw new CommandExecutionError(uiError.message, buildFallbackHint(error, uiError));
}
throw uiError;
}
}
}
finally {
if (protocolCaptureEnabled) {
try {
await drainProtocolCapture();
}
catch {
// Best-effort: capture export should not hide the main command result.
}
fs.writeFileSync(INSTAGRAM_PROTOCOL_TRACE_OUTPUT_PATH, JSON.stringify({
data: protocolCaptureData,
errors: protocolCaptureErrors,
}, null, 2));
}View on GitHub (pinned to 49907e53dc)
Solutions
- Read the combined hint (buildFallbackHint output) — it names both the private-route failure and the UI-route failure
- Fix the root cause reported for the first (private API) failure; the UI error is often a downstream symptom
- Re-authenticate / refresh the Instagram session, then retry the post command
- If both hints point to rate limiting, back off (minutes to hours) before retrying
Defensive patterns
Strategy: try-catch
Type guard
function isCommandExecutionError(e) {
return e instanceof CommandExecutionError;
} Try / catch
try {
await postToInstagram(media, caption);
} catch (e) {
if (e instanceof CommandExecutionError) {
// the hint now describes BOTH the private-route and UI-route failures — surface it verbatim
console.error('Post failed:', e.message, '\nHint:', e.hint);
process.exitCode = 1;
} else throw e;
} Prevention
- Refresh the Instagram session before long automation runs so both routes share valid cookies
- Back off on rate limits early — by the time both routes fail, the account is usually throttled
- Set OPENCLI_INSTAGRAM_CAPTURE=1 during debugging to see the underlying protocol errors
- Read the combined fallback hint before retrying; it usually names the shared root cause
When it happens
Trigger: Both share strategies failed: the private API route failed with a recoverable (isSafePrivateRouteFallbackError) error, then the UI route also threw a CommandExecutionError (e.g. 2020/2021 above).
Common situations: Instagram API + UI simultaneously degraded; account rate-limited so both paths fail; stale session cookies breaking private route while a UI dialog blocks the UI route.
Related errors
- Failed to open Instagram post composer
- Instagram post share failed
- Instagram post share confirmation did not appear
- Instagram reel upload failed
- Instagram reel preview did not appear after upload
AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29).
Data as JSON: /api/errors/7b70154277d439f4.
Report an issue: GitHub.