AI Auto-Reject setting does nothing when enabled #94

Closed
opened 2026-08-14 06:38:39 +00:00 by agent-pi · 1 comment
Collaborator

The ai_auto_reject setting is wired into the settings UI and stored, but enabling it has no effect. During a fetch, _classify_fetched_posts records an ai_would_reject recommendation on each post, but that verdict is only surfaced as a badge + filters in the review UI — nothing ever rejects a post based on it.

The AI auto-reject behaviour was deliberately deferred at launch ("the AI does not auto-reject at launch — it records a recommendation"), with ai_auto_reject added as a placeholder flag. This issue is to implement the actual behaviour: when the setting is enabled, posts the AI would reject should be auto-rejected.

The `ai_auto_reject` setting is wired into the settings UI and stored, but enabling it has no effect. During a fetch, `_classify_fetched_posts` records an `ai_would_reject` recommendation on each post, but that verdict is only surfaced as a badge + filters in the review UI — nothing ever rejects a post based on it. The AI auto-reject behaviour was deliberately deferred at launch ("the AI does not auto-reject at launch — it records a recommendation"), with `ai_auto_reject` added as a placeholder flag. This issue is to implement the actual behaviour: when the setting is enabled, posts the AI would reject should be auto-rejected.
Author
Collaborator

Findings: ai_auto_reject + get_ai_auto_reject_setting are defined but never consumed — check_reblog_filters/reject_blocked_posts only apply the five deterministic filters. Classification (which sets ai_would_reject) runs only in the scheduler's _fetch_stream_job, not the manual POST /hashtags/{id}/fetch.

Plan:

  1. Add reject_ai_flagged_posts(db) in services/export_eligibility.py mirroring reject_blocked_posts: when ai_auto_reject is on, reject unreviewed posts where ai_would_reject is True, setting auto_reject_reason from text_reason/vision_reason and writing a review_feedback row.
  2. Call it in _fetch_stream_job right after _classify_fetched_posts.
  3. TDD: unit test for reject_ai_flagged_posts, then a scheduler integration test.

Key files: services/export_eligibility.py, services/scheduler.py, tests/test_reblog_controls.py.

Branch: feat/issue-94-wire-ai-auto-reject, PR into feat/issue-80-collect with Refs #94.

Note: the manual fetch endpoint doesn't run AI classification today, so this auto-reject applies to scheduler fetches; wiring the manual Fetch button to also classify is a separate follow-up.

Findings: `ai_auto_reject` + `get_ai_auto_reject_setting` are defined but never consumed — `check_reblog_filters`/`reject_blocked_posts` only apply the five deterministic filters. Classification (which sets `ai_would_reject`) runs only in the scheduler's `_fetch_stream_job`, not the manual `POST /hashtags/{id}/fetch`. Plan: 1. Add `reject_ai_flagged_posts(db)` in `services/export_eligibility.py` mirroring `reject_blocked_posts`: when `ai_auto_reject` is on, reject unreviewed posts where `ai_would_reject is True`, setting `auto_reject_reason` from `text_reason`/`vision_reason` and writing a `review_feedback` row. 2. Call it in `_fetch_stream_job` right after `_classify_fetched_posts`. 3. TDD: unit test for `reject_ai_flagged_posts`, then a scheduler integration test. Key files: `services/export_eligibility.py`, `services/scheduler.py`, `tests/test_reblog_controls.py`. Branch: `feat/issue-94-wire-ai-auto-reject`, PR into `feat/issue-80-collect` with `Refs #94`. Note: the manual fetch endpoint doesn't run AI classification today, so this auto-reject applies to scheduler fetches; wiring the manual Fetch button to also classify is a separate follow-up.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
marvin8/dujiangyan#94
No description provided.