From 458227f489056125ca44ab745a00ddf389b79719 Mon Sep 17 00:00:00 2001 From: Maurice Date: Mon, 30 Nov 2026 14:40:27 +0100 Subject: [PATCH] fix(assistant): load the from-photos journey tools with the journey group JourneyEntriesFromPhotosMcp was in no tool group, so the assistant offered both tools as core on every step of every chat, and its write was not held to the journey like the other journal writes. --- server/src/nest/assistant/assistant-journey-offer.ts | 6 +++++- server/src/nest/assistant/assistant-tool-offer.ts | 2 ++ server/tests/unit/nest/assistant/assistant-home.test.ts | 3 ++- .../unit/nest/assistant/assistant-tools.service.test.ts | 2 ++ 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/server/src/nest/assistant/assistant-journey-offer.ts b/server/src/nest/assistant/assistant-journey-offer.ts index f69cf56d3..d131b21c3 100644 --- a/server/src/nest/assistant/assistant-journey-offer.ts +++ b/server/src/nest/assistant/assistant-journey-offer.ts @@ -30,7 +30,10 @@ export interface JourneyOffer { surface: AssistantJourneySurface; } -/** The controllers of the journal: the journey and its entries, its map and tracks, its recorded days and imports. */ +/** + * The controllers of the journal: the journey and its entries, its map and + * tracks, its recorded days and imports, and the drafts made from its photos. + */ const JOURNAL_CONTROLLERS: ReadonlySet = new Set([ 'JourneyMcp', 'JourneyPhotoLinksMcp', @@ -38,6 +41,7 @@ const JOURNAL_CONTROLLERS: ReadonlySet = new Set([ 'JourneyTracksMcp', 'JourneyRecordingsMcp', 'JourneyDayImportMcp', + 'JourneyEntriesFromPhotosMcp', ]); /** diff --git a/server/src/nest/assistant/assistant-tool-offer.ts b/server/src/nest/assistant/assistant-tool-offer.ts index 0d902148e..578be2a4d 100644 --- a/server/src/nest/assistant/assistant-tool-offer.ts +++ b/server/src/nest/assistant/assistant-tool-offer.ts @@ -246,6 +246,7 @@ const JOURNEY_WRITE_CONTROLLERS: ReadonlySet = new Set([ 'JourneyRecordingsMcp', 'JourneyDayImportMcp', 'JourneySocialMcp', + 'JourneyEntriesFromPhotosMcp', 'TripJournalLinkMcp', ]); @@ -396,6 +397,7 @@ const CORE_TOOL_GROUPS: ToolGroups = { 'JourneyRecordingsMcp', 'JourneyDayImportMcp', 'JourneySocialMcp', + 'JourneyEntriesFromPhotosMcp', 'TripJournalLinkMcp', 'MemoriesMcp', 'DawarichMcp', diff --git a/server/tests/unit/nest/assistant/assistant-home.test.ts b/server/tests/unit/nest/assistant/assistant-home.test.ts index 2236d1d1b..c9ac0d0dd 100644 --- a/server/tests/unit/nest/assistant/assistant-home.test.ts +++ b/server/tests/unit/nest/assistant/assistant-home.test.ts @@ -261,7 +261,8 @@ describe('the tools the home chat keeps', () => { it("ASTHOME-031: a journey's writes stay with the journey, also those that name only an entry", () => { expect(keptAtHome('read', ['entryId'], 'JourneyMcp')).toBe(true); - for (const className of ['JourneyMcp', 'JourneyRecordingsMcp', 'JourneyDayImportMcp']) { + const journeyWriters = ['JourneyMcp', 'JourneyRecordingsMcp', 'JourneyDayImportMcp', 'JourneyEntriesFromPhotosMcp']; + for (const className of journeyWriters) { expect(keptAtHome('write', ['entryId'], className), className).toBe(false); } // A Dawarich stay taken into a journal names the journey as `journalId`; one marked on the bucket list stays. diff --git a/server/tests/unit/nest/assistant/assistant-tools.service.test.ts b/server/tests/unit/nest/assistant/assistant-tools.service.test.ts index 5f33bdd5b..3a865971d 100644 --- a/server/tests/unit/nest/assistant/assistant-tools.service.test.ts +++ b/server/tests/unit/nest/assistant/assistant-tools.service.test.ts @@ -197,6 +197,8 @@ describe('the assistant tool catalog', () => { 'save_journey_recorded_day', 'review_journey_day_stays', 'take_over_journey_day_stays', + 'preview_journey_entries_from_photos', + 'create_journey_entries_from_photos', ]; expect(journey.map(groupOfTool)).toEqual(journey.map(() => 'journey')); });