Skip to content

fix: only sub_doesnt_exist_bot answers nested comments - #97

Merged
Toldry merged 1 commit into
masterfrom
claude/project-thread-ujqmzo
Oct 16, 2026
Merged

Toldry merged 1 commit into
masterfrom
claude/project-thread-ujqmzo

Conversation

@Toldry

@Toldry Toldry commented Oct 16, 2026

Copy link
Copy Markdown
Owner

Requested by Querent · project thread

Before: same_subreddit_bot and same_post_bot replied to a comment that is only a subreddit reference at any depth of a thread, e.g. a reply to a reply. Only the database insert (the crosspost recommendation) was limited to top-level comments.

After: only top-level comments (direct answers to the post) get a reply from same_subreddit_bot or same_post_bot, or count as a recommendation. sub_doesnt_exist_bot still answers at any depth.

How: handle_incoming_comment decides is_top_level_comment before the bot dispatch. A nested comment whose target equals its own subreddit is ignored; any other nested comment only runs the URL search (new existence_only flag on get_posts_with_same_content), which is enough to tell a nonexistent subreddit, so it no longer costs the other-discussions call or the image scan either.

The "whole body must be the reference" rule was already enforced by subreddit_regex (no MULTILINE): r/brothrewinafunfact\n\nWait... does not match, now covered by tests. The reported reply was most likely to a comment edited after the bot answered.

AGENTS.md (section 1 note, Phase 1 decision diagram) updated; changelog fragment added.

🤖 Generated with Claude Code

https://claude.ai/code/session_01WLkGZFH1VQLrPQ59LmMepx


Generated by Claude Code

same_subreddit_bot and same_post_bot replied to a matching comment at any
depth; the top-level check only gated the database insert. They now answer
top-level comments only. A nested comment only gets the existence check
(one URL search) that sub_doesnt_exist_bot needs.

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_01WLkGZFH1VQLrPQ59LmMepx
@Toldry Toldry self-assigned this Oct 16, 2026
@Toldry
Toldry marked this pull request as ready for review October 16, 2026 20:00
@Toldry
Toldry merged commit 31b54b4 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