fix(archiegateway): create the chat workspace before enabling its tools
This commit is contained in:
1 file changed
+6
@@ -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
|
||||
|
||||
Reference in new issue
Block a user