feat(insta): dedup_window_days config end-to-end wiring (spec 6.4)
- insta-lab ranked_keywords: add dedup_window_days Query param (default 14, ge=1, le=90); pass to db.list_recent_issued_topics - service_proxy.insta_ranked: add dedup_window_days param (default 14); include in GET params - InstaAgent.on_schedule: read dedup_window_days from custom_config (default 14); pass to insta_ranked call - test_ranked_respects_dedup_window: verifies window param gates eligible flag correctly Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -74,6 +74,7 @@ class InstaAgent(BaseAgent):
|
||||
autonomous = bool(custom.get("autonomous_issue", False))
|
||||
threshold = float(custom.get("select_threshold", 0.6))
|
||||
max_per_day = int(custom.get("max_per_day", 2))
|
||||
dedup_window_days = int(custom.get("dedup_window_days", 14))
|
||||
|
||||
task_id = create_task(self.agent_id, "insta_daily", {"auto_select": auto_select},
|
||||
requires_approval=False)
|
||||
@@ -86,7 +87,7 @@ class InstaAgent(BaseAgent):
|
||||
add_log(self.agent_id, f"insta preferences unavailable: {_pref_err}", "warning", task_id)
|
||||
await self._run_collect_and_extract()
|
||||
if autonomous:
|
||||
ranked = await service_proxy.insta_ranked(threshold=threshold, limit=20)
|
||||
ranked = await service_proxy.insta_ranked(threshold=threshold, limit=20, dedup_window_days=dedup_window_days)
|
||||
eligible = [r for r in ranked if r.get("eligible")][:max_per_day]
|
||||
if not eligible:
|
||||
await messaging.send_raw("📰 [인스타 큐레이터] 오늘은 발행할 가치 있는 주제가 없습니다.")
|
||||
|
||||
Reference in New Issue
Block a user