From 72929c36af2df02cf3902bb827af41cd8596a8e0 Mon Sep 17 00:00:00 2001 From: Sam Catlow Date: Mon, 19 Oct 2026 11:15:20 +1100 Subject: [PATCH] fix(archiegateway): create the chat workspace before enabling its tools --- internal/app/archiegateway/tools.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/internal/app/archiegateway/tools.go b/internal/app/archiegateway/tools.go index 3e2e861d1..e77d7a6c5 100644 --- a/internal/app/archiegateway/tools.go +++ b/internal/app/archiegateway/tools.go @@ -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