jackwener/OpenCLI · error · CommandExecutionError
${result.detail}
Error message
${result.detail} What it means
Thrown by the reddit `reply` command for postcondition failures: the reply action reported an unexpected end state (result.kind === 'postcondition'), e.g. the comment was submitted but could not be verified to exist afterwards. The raw `result.detail` is used as the message because it already describes the failed postcondition. It signals a verification/integrity failure rather than an HTTP or auth problem.
Source
Thrown at clis/reddit/reply.js:172
return { kind: 'postcondition', detail: 'Reddit comment response did not include a created reply id' };
}
return { kind: 'ok', detail: 'Reply posted on ' + fullname + ' as ' + createdName };
} catch (e) {
return { kind: 'exception', detail: String(e && e.message || e) };
}
})()`);
if (result?.kind === 'auth') {
throw new AuthRequiredError('reddit.com', result.detail);
}
if (result?.kind === 'http') {
throw new CommandExecutionError(`HTTP ${result.httpStatus} from ${result.where}`);
}
if (result?.kind === 'reddit-error') {
throw new CommandExecutionError(`Reddit rejected reply: ${result.detail}`);
}
if (result?.kind === 'postcondition') {
throw new CommandExecutionError(result.detail);
}
if (result?.kind === 'exception') {
throw new CommandExecutionError(`Reply failed: ${result.detail}`);
}
if (result?.kind !== 'ok') {
throw new CommandExecutionError(`Unexpected result from reddit reply: ${JSON.stringify(result)}`);
}
return [{ status: 'success', message: result.detail }];
},
});
View on GitHub (pinned to 49907e53dc)
Solutions
- Inspect `result.detail` to see which postcondition check failed
- Retry the reply after a short delay, then check your profile's comment list to see if it was actually created
- Avoid immediately re-posting on failure — the comment may exist, causing duplicates
- Wrap the call in a try/catch and log the detail for diagnosis
Example fix
// before
await cli.run('reddit reply', { 'post-id': id, text });
// after
try {
await cli.run('reddit reply', { 'post-id': id, text });
} catch (e) {
console.error('Postcondition failure:', e.message); // verify before retrying
} Defensive patterns
Strategy: retry
Validate before calling
// Nothing to validate pre-call; plan a verification step after: const before = await getMyLatestCommentId();
Type guard
function isPostconditionResult(r) {
return r != null && typeof r === 'object' && r.kind === 'postcondition' && typeof r.detail === 'string';
} Try / catch
try {
await cli.run('reddit reply', { 'post-id': postId, text });
} catch (e) {
if (/Reply failed|postcondition/i.test(e.message)) {
await sleep(3000);
if (!(await commentExists(postId, before))) await retryOnce(); // avoid duplicates
} else throw e;
} Prevention
- Verify whether the comment actually exists before retrying (avoid duplicates)
- Back off before retries — verification fetches may be rate-limited
- Log result.detail to know which postcondition failed
When it happens
Trigger: Calling the reddit reply command when the page evaluate returns kind 'postcondition' — typically when the code checks that the new comment actually appears (e.g. fetching the comment permalink or the user's latest comment) and the verification fetch fails or returns nothing.
Common situations: Reddit accepting the POST but the verification GET being rate-limited or slow; new comments not immediately visible due to caching or spam filtering; race conditions in automated posting loops.
Related errors
- Codex send was not verified.
- Doubao blocked the request with a verification challenge
- Gmail ${operation} could not set the search query exactly
- ${name} menu item was clicked, but the conversation did not
- Kimi model switch did not verify the requested model: reques
AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29).
Data as JSON: /api/errors/db7e21712492bdb8.
Report an issue: GitHub.