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

  1. Read the combined hint (buildFallbackHint output) — it names both the private-route failure and the UI-route failure
  2. Fix the root cause reported for the first (private API) failure; the UI error is often a downstream symptom
  3. Re-authenticate / refresh the Instagram session, then retry the post command
  4. 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

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


AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29). Data as JSON: /api/errors/7b70154277d439f4. Report an issue: GitHub.