fix(archiegateway): create the chat workspace before enabling its tools

This commit is contained in:
sam committed 2026-10-19 11:15:20 +11:00
1 parent b9e2855a56
commit 72929c36af
1 file changed
+6
+6
View File
@@ -3,6 +3,7 @@ package archiegateway
import (
"context"
"log/slog"
"os"
"path/filepath"
"strings"
"time"
@@ -37,6 +38,11 @@ func (b *server) registerTools() error {
b.mcpMu.Unlock()
if workspace := cfg.Chat.Workspace; workspace != "" {
unrestricted := cfg.Chat.UnrestrictedFilesystem
// A workspace chosen in the dashboard names a directory nobody has
// created yet; every file tool would fail on it.
if err := os.MkdirAll(workspace, 0o700); err != nil {
log.Error("create chat workspace", "workspace", workspace, "err", err)
}
if err := b.providerRegistry.Register(builtintoolprovider.New(workspace, unrestricted)); err != nil {
log.Error("workspace tool provider registration failed", "err", err)
return err