feat(api): register default agent in config on workspace switch
Call setDefaultAgentInConfig when switching workspaces so the gateway picks up the active workspace agent.
This commit is contained in:
parent
38f3cb6efe
commit
1398e556a1
@ -4,6 +4,7 @@ import {
|
||||
resolveOpenClawStateDir,
|
||||
resolveWorkspaceRoot,
|
||||
setUIActiveWorkspace,
|
||||
setDefaultAgentInConfig,
|
||||
} from "@/lib/workspace";
|
||||
|
||||
export const dynamic = "force-dynamic";
|
||||
@ -45,6 +46,7 @@ export async function POST(req: Request) {
|
||||
}
|
||||
|
||||
setUIActiveWorkspace(requestedWorkspace);
|
||||
setDefaultAgentInConfig(requestedWorkspace);
|
||||
const activeWorkspace = getActiveWorkspaceName();
|
||||
const selected = discoverWorkspaces().find((workspace) => workspace.name === activeWorkspace) ?? null;
|
||||
return Response.json({
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user