From efbc469ee350defcbcaf3dd9d03bb966a29c1fb8 Mon Sep 17 00:00:00 2001 From: mruwnik Date: Tue, 23 Dec 2025 22:13:11 +0000 Subject: [PATCH] proper modality for github items --- src/memory/common/db/models/source_items.py | 7 +++++++ src/memory/workers/tasks/github.py | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/memory/common/db/models/source_items.py b/src/memory/common/db/models/source_items.py index e3ff57a..5ac4bc5 100644 --- a/src/memory/common/db/models/source_items.py +++ b/src/memory/common/db/models/source_items.py @@ -894,6 +894,13 @@ class GithubItem(SourceItem): merged_at=cast(datetime | None, self.merged_at), ) + def _chunk_contents(self) -> Sequence[extract.DataChunk]: + """Override to use 'github' modality instead of default 'text'.""" + content = cast(str | None, self.content) + if content: + return extract.extract_text(content, modality="github") + return [] + class NotePayload(SourceItemPayload): note_type: Annotated[str | None, "Category of the note"] diff --git a/src/memory/workers/tasks/github.py b/src/memory/workers/tasks/github.py index c61785f..2c69064 100644 --- a/src/memory/workers/tasks/github.py +++ b/src/memory/workers/tasks/github.py @@ -58,7 +58,7 @@ def _create_github_item( repo_tags = cast(list[str], repo.tags) or [] return GithubItem( - modality="text", + modality="github", sha256=create_content_hash(content), content=content, kind=issue_data["kind"],