fix(server): keep late memory refs from completing a collaboration Room (P1.5)
Chat collaboration writes run results to memory in the background and records the memory refs when the writes finish. That update recomputed the parent Room, so a workflow Room turned 'completed' while its synthesis step was still running and could no longer be cancelled. A memory-refs update never changes a run's status, so it no longer recomputes the parent. The collaboration tests use an in-memory memory store and wait for the background writes before reading memory refs.
This commit is contained in:
@@ -812,7 +812,9 @@ function recordResult(
|
||||
metadata,
|
||||
}).then((memoryRefs) => {
|
||||
try {
|
||||
server.agentRunRegistry.update(run.id, { memoryRefs });
|
||||
// Memory refs never change a run's status, so a late write must not
|
||||
// recompute the Room: that would complete it while synthesis still runs.
|
||||
server.agentRunRegistry.update(run.id, { memoryRefs }, { recomputeParent: false });
|
||||
} catch { /* the run was removed meanwhile */ }
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user