fix(hindsight): scoped project mental model seeds
Project-tagged Hindsight mental-model seeds now use project-qualified ids and legacy bare ids only satisfy the matching project tag. The injected mental-model block also filters tagged models to the active project while retaining untagged models.\n\nFixes #2218
This commit is contained in:
@@ -21,6 +21,7 @@ import {
|
||||
loadHindsightConfig,
|
||||
reloadMentalModelsForSession,
|
||||
resolveSeedsForScope,
|
||||
seedAlreadyExists,
|
||||
summarizeMentalModel,
|
||||
} from "../../hindsight";
|
||||
import { resolveMemoryBackend } from "../../memory-backend";
|
||||
@@ -712,11 +713,11 @@ export class CommandController {
|
||||
return;
|
||||
}
|
||||
const list = await state.client.listMentalModels(state.bankId, { detail: "metadata" });
|
||||
const existing = new Set((list.items ?? []).map(m => m.id));
|
||||
const existing = list.items ?? [];
|
||||
let created = 0;
|
||||
let skipped = 0;
|
||||
for (const seed of seeds) {
|
||||
if (existing.has(seed.id)) {
|
||||
if (seedAlreadyExists(seed, existing)) {
|
||||
skipped++;
|
||||
continue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user