Repository navigation
fix: only sub_doesnt_exist_bot answers nested comments - #97
Merged
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Querent · project thread
Before:
same_subreddit_botandsame_post_botreplied 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_botorsame_post_bot, or count as a recommendation.sub_doesnt_exist_botstill answers at any depth.How:
handle_incoming_commentdecidesis_top_level_commentbefore the bot dispatch. A nested comment whose target equals its own subreddit is ignored; any other nested comment only runs the URL search (newexistence_onlyflag onget_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(noMULTILINE):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