jackwener/OpenCLI · error · CommandExecutionError
Reddit rejected reply: ${result.detail}
Error message
Reddit rejected reply: ${result.detail} What it means
This error is thrown by the reddit `reply` CLI command when the in-page Reddit API call completes but Reddit itself rejects the reply with a domain-specific error (result.kind === 'reddit-error'). The CommandExecutionError wraps Reddit's own `detail` string so the developer sees exactly why Reddit refused the post. It indicates authentication was fine and HTTP succeeded, but Reddit's business logic (rate limits, banned subreddit, archived post, etc.) blocked the reply.
Source
Thrown at clis/reddit/reply.js:169
: null;
const createdName = created?.data?.name || (created?.data?.id ? 't1_' + created.data.id : '');
if (!createdName) {
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
- Read `result.detail` in the error message to see Reddit's specific rejection reason and address it directly
- Check the target post is not locked or archived before replying
- Verify the account is not banned or muted in the target subreddit
- Slow down posting to respect Reddit rate limits and retry later
- Catch CommandExecutionError in the calling code and surface the detail to the user
Example fix
// before
await cli.run('reddit reply', { 'post-id': oldPostId, text });
// after
try {
await cli.run('reddit reply', { 'post-id': oldPostId, text });
} catch (e) {
if (/archived|locked/.test(e.message)) console.warn('Post is closed to new replies');
else throw e;
} Defensive patterns
Strategy: try-catch
Validate before calling
// Reddit-side rejections (archived, banned, rate-limited) cannot be checked locally;
// ensure inputs are non-empty before calling:
if (!postId || !text?.trim()) throw new Error('postId and text are required'); Type guard
function isRedditErrorResult(r) {
return r != null && typeof r === 'object' && r.kind === 'reddit-error' && typeof r.detail === 'string';
} Try / catch
try {
await cli.run('reddit reply', { 'post-id': postId, text });
} catch (e) {
if (e instanceof CommandExecutionError && /Reddit rejected reply/.test(e.message)) {
console.error('Reddit says:', e.message.replace('Reddit rejected reply: ', ''));
} else throw e;
} Prevention
- Skip posts that are locked/archived before replying
- Respect Reddit rate limits (throttle replies, add jitter)
- Check subreddit ban/mute status for the account beforehand
- Always log result.detail — Reddit's reason is in the message
When it happens
Trigger: Calling the reddit reply command when Reddit returns a reddit-error kind result: e.g. replying to a locked/archived post, being rate-limited, replying in a subreddit where the user is banned, or the comment body being rejected (too long, empty, filtered).
Common situations: Automating replies to old threads that have been archived after 6 months; bots hitting Reddit's posting rate limit; accounts shadow-banned or banned from a specific subreddit; replying to a deleted post.
Related errors
- Reddit /comments fetch returned no result envelope.
- Reply failed: ${result.detail}
- Unexpected 12306 probe: ${JSON.stringify(probe)}
- Waiting for 12306 tk auth cookie
- amazon.com
AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29).
Data as JSON: /api/errors/20064ab87859bf1a.
Report an issue: GitHub.