fix(agent): isolate conversation workspaces
This commit is contained in:
+7
-2
@@ -155,7 +155,9 @@ export const buildChatRouter = (
|
||||
const actorKey = toActorKey(userId);
|
||||
const projectKey = toProjectKey(projectId);
|
||||
const requestedSessionId = parsed.data.session_id?.trim();
|
||||
const sessionId = requestedSessionId || (await runtime.createSession()).id;
|
||||
const sessionId =
|
||||
requestedSessionId ||
|
||||
(await runtime.createSession(undefined, { conversationWorkspace: true })).id;
|
||||
|
||||
const { record, created } = await sessionMetadataStore.ensure({
|
||||
actorKey,
|
||||
@@ -451,7 +453,9 @@ export const buildChatRouter = (
|
||||
res.status(404).json({ message: "source session not found" });
|
||||
return;
|
||||
}
|
||||
const forkSession = await runtime.createSession();
|
||||
const forkSession = await runtime.createSession(undefined, {
|
||||
conversationWorkspace: true,
|
||||
});
|
||||
const { record: targetSessionRecord } = await sessionMetadataStore.ensure({
|
||||
actorKey,
|
||||
parentSessionId: sourceSessionId,
|
||||
@@ -874,6 +878,7 @@ export const buildChatRouter = (
|
||||
traceId: requestContext.traceId,
|
||||
projectId: requestContext.projectId,
|
||||
signal: abortController.signal,
|
||||
workspaceRoot: binding.workspaceDirectory,
|
||||
write: (event, data) => {
|
||||
publish(event, data);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user