Skip to content

fix: skip target subreddits the bot is banned from - #88

Merged
Toldry merged 3 commits into
masterfrom
claude/banned-target-subreddit
Oct 16, 2026
Merged

Toldry merged 3 commits into
masterfrom
claude/banned-target-subreddit

Conversation

@Toldry

@Toldry Toldry commented Oct 16, 2026

Copy link
Copy Markdown
Owner

Requested by Querent · project thread

Before: when AutoCrosspostBot was banned from the target subreddit, Phase 3 ran the full duplicate scan (13 s in the --process-one run that surfaced this) and then the crosspost failed with SUBREDDIT_NOTALLOWED_BANNED, logged as Crosspost failed unexpectedly at ERROR with a traceback.

After: Phases 2 and 3 check the target's user_is_banned before the duplicate scan and drop the row with reason BANNED_FROM_TARGET_SUBREDDIT. If a ban lands between that check and the crosspost, SUBREDDIT_NOTALLOWED_BANNED is now a familiar error and is logged as a graceful rejection at INFO.

How: phase2.is_banned_from_subreddit reads user_is_banned through the PRAW instance that fetched the comment (one request); if the subreddit can't be read it returns False so the later steps report the real reason. Tests cover the ban rejection, the unreadable-subreddit fallback and the new familiar error type. AGENTS.md and CHANGELOG are updated.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Ac5m5aP3tK612BNDEstqrD


Generated by Claude Code

Check the target's user_is_banned in run_filters before the duplicate scan,
and treat SUBREDDIT_NOTALLOWED_BANNED as a graceful crosspost rejection.

Co-Authored-By: Toldry <toldry@gmail.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ac5m5aP3tK612BNDEstqrD
@Toldry Toldry self-assigned this Oct 16, 2026
claude and others added 2 commits October 16, 2026 07:49
Co-Authored-By: Toldry <toldry@gmail.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ac5m5aP3tK612BNDEstqrD
@Toldry
Toldry merged commit b06df9c into master Oct 16, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants