fix(webui): retain system context graph after compaction (#6608)
This commit is contained in:
1 parent
d789e1bfc7
commit
4212ad726d
25 files changed
+748
-102
No files matched your search
@@ -40,9 +40,14 @@ function reloadPayload(body: WebuiThreadPersistedPayload): unknown {
|
||||
const { context_graph, ...rest } = event;
|
||||
return { ...rest, context_graph_ref: reference(context_graph) };
|
||||
}
|
||||
if (event.event === "context_compaction" && event.context_snapshot) {
|
||||
const { graph, ...snapshot } = event.context_snapshot;
|
||||
return { ...event, context_snapshot: { ...snapshot, graph_ref: reference(graph) } };
|
||||
if (event.event === "context_compaction" && (event.context_graph || event.context_snapshot)) {
|
||||
const { context_graph, context_snapshot, ...rest } = event;
|
||||
const snapshot = context_snapshot && (({ graph, ...fields }) => ({ ...fields, graph_ref: reference(graph) }))(context_snapshot);
|
||||
return {
|
||||
...rest,
|
||||
...(context_graph ? { context_graph_ref: reference(context_graph) } : {}),
|
||||
...(snapshot ? { context_snapshot: snapshot } : {}),
|
||||
};
|
||||
}
|
||||
return event;
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user