From 810f63e749bbce77150ddd3ead91797353256681 Mon Sep 17 00:00:00 2001 From: Bryan Van Deusen Date: Wed, 11 Mar 2026 09:29:56 -0400 Subject: [PATCH] Associate research_topic notes with workspace project run_research_pipeline now accepts project_id; generation_task.py passes workspace_project_id when the tool is called from a workspace context. Co-Authored-By: Claude Sonnet 4.6 --- src/fabledassistant/services/generation_task.py | 2 +- src/fabledassistant/services/research.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/fabledassistant/services/generation_task.py b/src/fabledassistant/services/generation_task.py index 5d22ee6..1d6f869 100644 --- a/src/fabledassistant/services/generation_task.py +++ b/src/fabledassistant/services/generation_task.py @@ -260,7 +260,7 @@ async def run_generation( if tool_name == "research_topic": topic = arguments.get("topic", "") try: - note = await run_research_pipeline(topic, user_id, model, buf) + note = await run_research_pipeline(topic, user_id, model, buf, project_id=workspace_project_id) result = { "success": True, "type": "research_note", diff --git a/src/fabledassistant/services/research.py b/src/fabledassistant/services/research.py index 66bc7c0..0f6233b 100644 --- a/src/fabledassistant/services/research.py +++ b/src/fabledassistant/services/research.py @@ -26,6 +26,7 @@ async def run_research_pipeline( user_id: int, model: str, buf=None, + project_id: int | None = None, ) -> Note: """Full research pipeline: search → fetch → synthesize → create note. @@ -112,6 +113,7 @@ async def run_research_pipeline( title=title, body=body, tags=["research"], + project_id=project_id, ) logger.info("Research: created note id=%d title='%s'", note.id, note.title) return note