fix(briefing): exclude paused-project tasks from briefing tooling

list_notes gains exclude_paused_projects; list_tasks tool sets it when
no explicit project filter is given. Paused projects no longer leak
tasks into briefings or list_tasks results.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-10 20:42:33 -04:00
parent 5f4759a5e8
commit 66f906a629
2 changed files with 13 additions and 0 deletions
+12
View File
@@ -136,6 +136,7 @@ async def list_notes(
milestone_ids: list[int] | None = None,
parent_id: int | None = None,
no_project: bool = False,
exclude_paused_projects: bool = False,
sort: str = "updated_at",
order: str = "desc",
limit: int = 50,
@@ -211,6 +212,17 @@ async def list_notes(
query = query.where(Note.project_id.is_(None))
count_query = count_query.where(Note.project_id.is_(None))
if exclude_paused_projects:
from fabledassistant.models.project import Project
paused_ids = (
select(Project.id)
.where(Project.user_id == user_id, Project.status == "paused")
.scalar_subquery()
)
paused_filter = or_(Note.project_id.is_(None), Note.project_id.not_in(paused_ids))
query = query.where(paused_filter)
count_query = count_query.where(paused_filter)
sort_col = getattr(Note, sort, Note.updated_at)
if order == "asc":
query = query.order_by(sort_col.asc())
+1
View File
@@ -1509,6 +1509,7 @@ async def execute_tool(
due_after=_parse_due_date(arguments.get("due_after")),
project_id=project_id,
milestone_id=milestone_id,
exclude_paused_projects=project_id is None,
limit=int(arguments.get("limit", 10)),
sort="due_date",
order="asc",