revert: roll back v12.3.3 (Issue Blowout 2026)
SessionStart context injection regressed in v12.3.3 — no memory context is being delivered to new sessions. Rolling back to the v12.3.2 tree state while the regression is investigated. Reverts #2080. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -382,13 +382,11 @@ export class DataRoutes extends BaseRouteHandler {
|
||||
}
|
||||
|
||||
// Import observations (depends on sessions)
|
||||
const importedObservations: Array<{ id: number; obs: typeof observations[0] }> = [];
|
||||
if (Array.isArray(observations)) {
|
||||
for (const obs of observations) {
|
||||
const result = store.importObservation(obs);
|
||||
if (result.imported) {
|
||||
stats.observationsImported++;
|
||||
importedObservations.push({ id: result.id, obs });
|
||||
} else {
|
||||
stats.observationsSkipped++;
|
||||
}
|
||||
@@ -400,53 +398,6 @@ export class DataRoutes extends BaseRouteHandler {
|
||||
if (stats.observationsImported > 0) {
|
||||
store.rebuildObservationsFTSIndex();
|
||||
}
|
||||
|
||||
// Sync imported observations to ChromaDB for vector search.
|
||||
// Fire-and-forget: Chroma sync failure should not block the import response.
|
||||
// Bounded concurrency to prevent overwhelming Chroma on large imports.
|
||||
const chromaSync = this.dbManager.getChromaSync();
|
||||
if (chromaSync && importedObservations.length > 0) {
|
||||
const CHROMA_SYNC_CONCURRENCY = 8;
|
||||
const safeParseJson = (val: string | null): string[] => {
|
||||
if (!val) return [];
|
||||
try { return JSON.parse(val); } catch { return []; }
|
||||
};
|
||||
|
||||
const syncOne = async ({ id, obs }: { id: number; obs: any }) => {
|
||||
const parsedObs = {
|
||||
type: obs.type || 'discovery',
|
||||
title: obs.title || null,
|
||||
subtitle: obs.subtitle || null,
|
||||
facts: safeParseJson(obs.facts),
|
||||
narrative: obs.narrative || null,
|
||||
concepts: safeParseJson(obs.concepts),
|
||||
files_read: safeParseJson(obs.files_read),
|
||||
files_modified: safeParseJson(obs.files_modified),
|
||||
};
|
||||
|
||||
await chromaSync.syncObservation(
|
||||
id,
|
||||
obs.memory_session_id,
|
||||
obs.project,
|
||||
parsedObs,
|
||||
obs.prompt_number || 0,
|
||||
obs.created_at_epoch,
|
||||
obs.discovery_tokens || 0
|
||||
).catch(err => {
|
||||
logger.error('CHROMA', 'Import ChromaDB sync failed', { id }, err as Error);
|
||||
});
|
||||
};
|
||||
|
||||
// Fire-and-forget: process in batches but don't block the response
|
||||
(async () => {
|
||||
for (let i = 0; i < importedObservations.length; i += CHROMA_SYNC_CONCURRENCY) {
|
||||
const batch = importedObservations.slice(i, i + CHROMA_SYNC_CONCURRENCY);
|
||||
await Promise.all(batch.map(syncOne));
|
||||
}
|
||||
})().catch(err => {
|
||||
logger.error('CHROMA', 'Import ChromaDB batch sync failed', {}, err as Error);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// Import prompts (depends on sessions)
|
||||
|
||||
Reference in New Issue
Block a user