Per-session workspace, tools only when workspace set

- Session has workspace field (absolute path, optional)
- ToolService stateless, receives workspace per call
- No workspace = no tools sent to API
- Removed hardcoded workspace from Program.cs
- Workspace field in session edit form
This commit is contained in:
Meleki committed 2026-02-26 22:26:53 +01:00
1 parent 002ef293f0
commit b752c99a64
9 files changed
+50 -40

No files matched your search

+6 -1
View File
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net.Http;
using System.Text.Json;
@@ -121,7 +122,11 @@ public static class ChatEndpoint
new { type = "text", text = systemPromptText }
};
var workspace = session.Workspace;
if (!string.IsNullOrEmpty(workspace))
Directory.CreateDirectory(workspace);
var anthropic = new AnthropicService(httpFactory, token, toolService, db);
await anthropic.StreamChat(res, modelId, systemPrompt, messages, chainId);
await anthropic.StreamChat(res, modelId, systemPrompt, messages, chainId, workspace);
}
}