Fully autonomous AI Agents system capable of performing complex penetration testing tasks
Go ai-agentsai-security-toolanthropicautonomous-agentsgolanggptgraphqlmulti-agent-systemoffensive-securityopen-sourceopenaipenetration-testingpenetration-testing-toolsreactsecurity-automationsecurity-testingsecurity-toolsself-hosted
feat(provider): add Bedrock provider configuration and update related documentation
Dmitry Ng55a063ecb307
diff --git a/CLAUDE.md b/CLAUDE.mdindex 600a5f27..b8451908 100644--- a/CLAUDE.md+++ b/CLAUDE.md@@ -71,9 +71,10 @@ The application is a monorepo:```bashgo mod download # Install dependencies-go generate ./cmd/installer/files/ # REQUIRED once per fresh clone: fs.go, fs_test.go and fs/ in- # cmd/installer/files/ are generated and gitignored; the installer- # tests fail without them+go generate ./cmd/installer/files/ # REQUIRED once per fresh clone and again after a change under+ # cmd/installer/files/links or to a file linked there: fs.go,+ # fs_test.go and fs/ in cmd/installer/files/ are generated and+ # gitignored; the installer tests fail without themgo build -trimpath -o pentagi ./cmd/pentagi # Quick compile; the binary reports version "ce"go test ./... # Default test tier (see Testing)golangci-lint run --timeout=5m # Lint — config backend/.golangci.yml (v2 schema); CI pins v2.12.2diff --git a/Dockerfile b/Dockerfileindex 0dc4a7a1..a776cbd7 100644--- a/Dockerfile+++ b/Dockerfile@@ -196,6 +196,7 @@ COPY examples/configs/vllm-qwen3.8-27b-fp8.provider.yml /opt/pentagi/conf/COPY examples/configs/vllm-qwen3.6-35b-a3b-fp8-no-think.provider.yml /opt/pentagi/conf/COPY examples/configs/vllm-qwen3.6-35b-a3b-fp8.provider.yml /opt/pentagi/conf/COPY examples/configs/vllm-qwen332b-fp16.provider.yml /opt/pentagi/conf/+COPY examples/configs/xai.provider.yml /opt/pentagi/conf/COPY LICENSE /opt/pentagi/LICENSECOPY NOTICE /opt/pentagi/NOTICEdiff --git a/README.md b/README.mdindex e2681ce0..3bfd587c 100644--- a/README.md+++ b/README.md@@ -658,7 +658,7 @@ The PentAGI web console already manages several settings areas after the serverThe following configuration areas still need to be set on the server through environment variables, compose files, or mounted config files:-- **LLM credentials and connection details**: API keys, endpoints, auth modes, and provider-specific connection settings for OpenAI, Anthropic, Bedrock, Ollama, custom providers, and similar backends; config-path settings apply only where supported, such as `OLLAMA_SERVER_CONFIG_PATH` and `LLM_SERVER_CONFIG_PATH`.+- **LLM credentials and connection details**: API keys, endpoints, auth modes, and provider-specific connection settings for OpenAI, Anthropic, Bedrock, Ollama, custom providers, and similar backends; config-path settings apply only where supported, such as `OLLAMA_SERVER_CONFIG_PATH`, `LLM_SERVER_CONFIG_PATH`, and `BEDROCK_CONFIG_PATH`.- **Search provider credentials and options**: Settings such as `DUCKDUCKGO_*`, `GOOGLE_*`, `TAVILY_API_KEY`, `FIRECRAWL_API_*`, `TRAVERSAAL_API_KEY`, `PERPLEXITY_*`, `SEARXNG_*`, `SPLOITUS_ENABLED`, and the optional `WEB_SEARCH_INTERNAL_*` browser-analytics fallback settings.- **Third-party integrations**: Langfuse, Graphiti, and similar external services remain server-side configuration.- **MCP server management**: MCP settings pages are not currently exposed as a live web-console feature.@@ -737,11 +737,12 @@ mkdir pentagi && cd pentagicurl -o .env https://raw.githubusercontent.com/vxcontrol/pentagi/master/.env.example```-3. Touch examples files (`example.custom.provider.yml`, `example.ollama.provider.yml`) or download it:+3. Touch examples files (`example.custom.provider.yml`, `example.ollama.provider.yml`, `example.bedrock.provider.yml`) or download it. `docker-compose.yml` mounts each of them into the container, and Docker creates a directory in place of a mount source that does not exist:```bashcurl -o example.custom.provider.yml https://raw.githubusercontent.com/vxcontrol/pentagi/master/examples/configs/custom-openai.provider.ymlcurl -o example.ollama.provider.yml https://raw.githubusercontent.com/vxcontrol/pentagi/master/examples/configs/ollama-llama318b.provider.yml+curl -o example.bedrock.provider.yml https://raw.githubusercontent.com/vxcontrol/pentagi/master/examples/configs/bedrock.provider.yml```4. Fill in the required API keys in `.env` file.@@ -2004,13 +2005,14 @@ By default the Bedrock provider uses a per-agent config and model catalog compilThis is useful to expose a Bedrock model newer than the compiled-in catalog — for example Z.AI's `zai.glm-4.7-flash`. Use the exact Model ID from the model's AWS Bedrock detail page; add a `us.`/`eu.`/`apac.` inference-profile prefix only when that page marks the model as requiring cross-region inference (`zai.glm-4.7-flash` is In-Region, so it is used as-is, with no prefix).-With Docker Compose, set the host-side mount source and the in-container path together:+With Docker Compose the file is mounted from the host at `/opt/pentagi/conf/bedrock.provider.yml`. The default source is `./example.bedrock.provider.yml` beside `docker-compose.yml`, a copy of the built-in config ([`examples/configs/bedrock.provider.yml`](examples/configs/bedrock.provider.yml)) that the installer extracts, so editing it and pointing the backend at the mounted path is enough:```bash-# host file mounted into the container at /opt/pentagi/conf/bedrock.provider.yml-PENTAGI_BEDROCK_CONFIG_PATH=./examples/configs/bedrock-glm-flash.provider.yml# tell the backend to read the mounted fileBEDROCK_CONFIG_PATH=/opt/pentagi/conf/bedrock.provider.yml++# optional: mount another file from the host instead of ./example.bedrock.provider.yml+PENTAGI_BEDROCK_CONFIG_PATH=/path/on/host/my-bedrock.provider.yml```#### Supported Modelsdiff --git a/backend/cmd/installer/checker/checker.go b/backend/cmd/installer/checker/checker.goindex cacc7fb0..19425712 100644--- a/backend/cmd/installer/checker/checker.go+++ b/backend/cmd/installer/checker/checker.go@@ -423,6 +423,9 @@ func (h *defaultCheckHandler) GatherPentagiInfo(ctx context.Context, c *CheckResenvDir := filepath.Dir(h.appState.GetEnvPath())dockerComposeFile := filepath.Join(envDir, DockerComposeFile)+ // The bedrock example is deliberately not asked for: a stack extracted without it+ // would count as not extracted, and extraction overwrites the examples the user+ // edited when the update is forced. Verification of an extracted stack writes it.c.PentagiExtracted = checkFileExists(dockerComposeFile) &&checkFileExists(ExampleCustomConfigLLMFile) &&checkFileExists(ExampleOllamaConfigLLMFile)diff --git a/backend/cmd/installer/files/links/example.bedrock.provider.yml b/backend/cmd/installer/files/links/example.bedrock.provider.ymlnew file mode 120000index 00000000..b5700ff5--- /dev/null+++ b/backend/cmd/installer/files/links/example.bedrock.provider.yml@@ -0,0 +1 @@+../../../../../examples/configs/bedrock.provider.yml\ No newline at end of filediff --git a/backend/cmd/installer/hardening/migrations.go b/backend/cmd/installer/hardening/migrations.goindex 254acd64..f9516fcb 100644--- a/backend/cmd/installer/hardening/migrations.go+++ b/backend/cmd/installer/hardening/migrations.go@@ -34,36 +34,23 @@ func DoMigrateSettings(s state.State) error {configsPath := controller.GetEmbeddedLLMConfigsPath(files.NewFiles())- // migration from LLM_SERVER_CONFIG_PATH to PENTAGI_LLM_SERVER_CONFIG_PATH- llmServerConfigPathVar, exists := s.GetVar("LLM_SERVER_CONFIG_PATH")- llmServerConfigPath := llmServerConfigPathVar.Value- isEmbeddedCustomConfig := slices.Contains(configsPath, llmServerConfigPath) ||- llmServerConfigPath == controller.DefaultCustomConfigsPath- if exists && !isEmbeddedCustomConfig && llmServerConfigPath != "" {- exists = checkPathInHostFS(llmServerConfigPath, file)- }- if exists && !isEmbeddedCustomConfig && llmServerConfigPath != "" {- if err := s.SetVar("PENTAGI_LLM_SERVER_CONFIG_PATH", llmServerConfigPath); err != nil {- return err- }- if err := s.SetVar("LLM_SERVER_CONFIG_PATH", controller.DefaultCustomConfigsPath); err != nil {- return err+ // A provider config variable that names a file on the host becomes the mount source,+ // and the variable itself the path that file is mounted at in the container.+ for _, config := range []struct{ variable, mountedPath string }{+ {"LLM_SERVER_CONFIG_PATH", controller.DefaultCustomConfigsPath},+ {"OLLAMA_SERVER_CONFIG_PATH", controller.DefaultOllamaConfigsPath},+ {"BEDROCK_CONFIG_PATH", controller.DefaultBedrockConfigsPath},+ } {+ configPathVar, exists := s.GetVar(config.variable)+ configPath := configPathVar.Value+ isInContainer := slices.Contains(configsPath, configPath) || configPath == config.mountedPath+ if !exists || isInContainer || configPath == "" || !checkPathInHostFS(configPath, file) {+ continue}- }-- // migration from OLLAMA_SERVER_CONFIG_PATH to PENTAGI_OLLAMA_SERVER_CONFIG_PATH- ollamaServerConfigPathVar, exists := s.GetVar("OLLAMA_SERVER_CONFIG_PATH")- ollamaServerConfigPath := ollamaServerConfigPathVar.Value- isEmbeddedOllamaConfig := slices.Contains(configsPath, ollamaServerConfigPath) ||- ollamaServerConfigPath == controller.DefaultOllamaConfigsPath- if exists && !isEmbeddedOllamaConfig && ollamaServerConfigPath != "" {- exists = checkPathInHostFS(ollamaServerConfigPath, file)- }- if exists && !isEmbeddedOllamaConfig && ollamaServerConfigPath != "" {- if err := s.SetVar("PENTAGI_OLLAMA_SERVER_CONFIG_PATH", ollamaServerConfigPath); err != nil {+ if err := s.SetVar("PENTAGI_"+config.variable, configPath); err != nil {return err}- if err := s.SetVar("OLLAMA_SERVER_CONFIG_PATH", controller.DefaultOllamaConfigsPath); err != nil {+ if err := s.SetVar(config.variable, config.mountedPath); err != nil {return err}}diff --git a/backend/cmd/installer/hardening/migrations_test.go b/backend/cmd/installer/hardening/migrations_test.goindex ac85a9bd..a63d0303 100644--- a/backend/cmd/installer/hardening/migrations_test.go+++ b/backend/cmd/installer/hardening/migrations_test.go@@ -9,11 +9,14 @@ import (func TestMigrations_DoMigrateSettings_MovesAHostPathToItsPentagiVar(t *testing.T) {dir, file := hardeningHostPaths(t)- host := map[string]string{"DOCKER_CERT_PATH": dir, "LLM_SERVER_CONFIG_PATH": file, "OLLAMA_SERVER_CONFIG_PATH": file}+ host := map[string]string{+ "DOCKER_CERT_PATH": dir, "LLM_SERVER_CONFIG_PATH": file, "OLLAMA_SERVER_CONFIG_PATH": file, "BEDROCK_CONFIG_PATH": file,+ }container := map[string]string{"DOCKER_CERT_PATH": "/opt/pentagi/docker/ssl","LLM_SERVER_CONFIG_PATH": "/opt/pentagi/conf/custom.provider.yml","OLLAMA_SERVER_CONFIG_PATH": "/opt/pentagi/conf/ollama.provider.yml",+ "BEDROCK_CONFIG_PATH": "/opt/pentagi/conf/bedrock.provider.yml",}tests := []struct {name string@@ -22,7 +25,10 @@ func TestMigrations_DoMigrateSettings_MovesAHostPathToItsPentagiVar(t *testing.T{"a docker certificates directory", []string{"DOCKER_CERT_PATH"}},{"an llm config file", []string{"LLM_SERVER_CONFIG_PATH"}},{"an ollama config file", []string{"OLLAMA_SERVER_CONFIG_PATH"}},- {"all three at once", []string{"DOCKER_CERT_PATH", "LLM_SERVER_CONFIG_PATH", "OLLAMA_SERVER_CONFIG_PATH"}},+ {"a bedrock config file", []string{"BEDROCK_CONFIG_PATH"}},+ {"all four at once", []string{+ "DOCKER_CERT_PATH", "LLM_SERVER_CONFIG_PATH", "OLLAMA_SERVER_CONFIG_PATH", "BEDROCK_CONFIG_PATH",+ }},}for _, tt := range tests {@@ -60,12 +66,15 @@ func TestMigrations_DoMigrateSettings_LeavesAPathItCannotMigrate(t *testing.T) {{"an empty docker certificates path", "DOCKER_CERT_PATH", ""},{"an empty llm config path", "LLM_SERVER_CONFIG_PATH", ""},{"an empty ollama config path", "OLLAMA_SERVER_CONFIG_PATH", ""},+ {"an empty bedrock config path", "BEDROCK_CONFIG_PATH", ""},{"a docker certificates directory that does not exist", "DOCKER_CERT_PATH", "/nonexistent/docker/certs"},{"an llm config file that does not exist", "LLM_SERVER_CONFIG_PATH", "/nonexistent/custom.provider.yml"},{"an ollama config file that does not exist", "OLLAMA_SERVER_CONFIG_PATH", "/nonexistent/ollama.provider.yml"},+ {"a bedrock config file that does not exist", "BEDROCK_CONFIG_PATH", "/opt/pentagi/conf/bedrock.yml"},{"a file where the docker certificates directory belongs", "DOCKER_CERT_PATH", file},{"a directory where the llm config file belongs", "LLM_SERVER_CONFIG_PATH", dir},{"a directory where the ollama config file belongs", "OLLAMA_SERVER_CONFIG_PATH", dir},+ {"a directory where the bedrock config file belongs", "BEDROCK_CONFIG_PATH", dir},}for _, tt := range tests {@@ -79,7 +88,9 @@ func TestMigrations_DoMigrateSettings_LeavesAPathItCannotMigrate(t *testing.T) {t.Fatalf("DoMigrateSettings: %v", err)}- for _, name := range []string{"DOCKER_CERT_PATH", "LLM_SERVER_CONFIG_PATH", "OLLAMA_SERVER_CONFIG_PATH"} {+ for _, name := range []string{+ "DOCKER_CERT_PATH", "LLM_SERVER_CONFIG_PATH", "OLLAMA_SERVER_CONFIG_PATH", "BEDROCK_CONFIG_PATH",+ } {if got, set := st.vars["PENTAGI_"+name]; set {t.Errorf("PENTAGI_%s = %q, want it unset", name, got.Value)}@@ -102,6 +113,8 @@ func TestMigrations_DoMigrateSettings_ReturnsTheStateError(t *testing.T) {{"LLM_SERVER_CONFIG_PATH", file, "LLM_SERVER_CONFIG_PATH"},{"OLLAMA_SERVER_CONFIG_PATH", file, "PENTAGI_OLLAMA_SERVER_CONFIG_PATH"},{"OLLAMA_SERVER_CONFIG_PATH", file, "OLLAMA_SERVER_CONFIG_PATH"},+ {"BEDROCK_CONFIG_PATH", file, "PENTAGI_BEDROCK_CONFIG_PATH"},+ {"BEDROCK_CONFIG_PATH", file, "BEDROCK_CONFIG_PATH"},}for _, tt := range tests {diff --git a/backend/cmd/installer/processor/fixtures_test.go b/backend/cmd/installer/processor/fixtures_test.goindex 6d40145b..61bbbfea 100644--- a/backend/cmd/installer/processor/fixtures_test.go+++ b/backend/cmd/installer/processor/fixtures_test.go@@ -99,11 +99,13 @@ func (m *mockState) GetAllVars() map[string]loader.EnvVar { return m.vars }func (m *mockState) GetEnvPath() string { return m.envPath }// mockFiles implements files.Files: `lists` are embedded directories, `content` embedded-// files, `statuses` what Check answers (OK when unset), and every Copy is recorded.+// files, `statuses` what Check answers (OK when unset), and every Copy is recorded and+// answers `copyErr`.type mockFiles struct {content map[string][]bytestatuses map[string]files.FileStatuslists map[string][]string+ copyErr errorcopies []struct {Src, Dst stringRewrite bool@@ -148,7 +150,7 @@ func (m *mockFiles) Copy(src, dst string, rewrite bool) error {Src, Dst stringRewrite bool}{Src: src, Dst: dst, Rewrite: rewrite})- return nil+ return m.copyErr}func (m *mockFiles) Check(name string, workingDir string) files.FileStatus {diff --git a/backend/cmd/installer/processor/fs.go b/backend/cmd/installer/processor/fs.goindex be8ab40c..fefe02ad 100644--- a/backend/cmd/installer/processor/fs.go+++ b/backend/cmd/installer/processor/fs.go@@ -14,18 +14,29 @@ import ()const (- observabilityDirectory = "observability"- graphitiConfigsDirectory = "graphiti"- neo4jDirectory = "neo4j"- pentagiExampleCustomConfigLLM = "example.custom.provider.yml"- pentagiExampleOllamaConfigLLM = "example.ollama.provider.yml"+ observabilityDirectory = "observability"+ graphitiConfigsDirectory = "graphiti"+ neo4jDirectory = "neo4j"+ pentagiExampleCustomConfigLLM = "example.custom.provider.yml"+ pentagiExampleOllamaConfigLLM = "example.ollama.provider.yml"+ pentagiExampleBedrockConfigLLM = "example.bedrock.provider.yml")+// pentagiExampleConfigs are the default sources of the provider config mounts in+// docker-compose.yml. Each has to be on disk as a file before the stack starts:+// Docker creates a directory in place of a bind-mount source that is missing.+var pentagiExampleConfigs = []string{+ pentagiExampleCustomConfigLLM,+ pentagiExampleOllamaConfigLLM,+ pentagiExampleBedrockConfigLLM,+}+var filesToExcludeFromVerification = []string{"observability/otel/config.yml","observability/grafana/config/grafana.ini",pentagiExampleCustomConfigLLM,pentagiExampleOllamaConfigLLM,+ pentagiExampleBedrockConfigLLM,// user-editable Neo4j/APOC static settings: created once if missing, never// overwritten afterwards, even when the user forces a files update"neo4j/conf/neo4j.conf",@@ -72,10 +83,11 @@ func (fs *fileSystemOperationsImpl) ensureStackIntegrity(ctx context.Context, stswitch stack {case ProductStackPentagi:- errCompose := fs.ensureFileFromEmbed(composeFilePentagi, state)- errCustom := fs.ensureFileFromEmbed(pentagiExampleCustomConfigLLM, state)- errOllama := fs.ensureFileFromEmbed(pentagiExampleOllamaConfigLLM, state)- return errors.Join(errCompose, errCustom, errOllama)+ errs := []error{fs.ensureFileFromEmbed(composeFilePentagi, state)}+ for _, name := range pentagiExampleConfigs {+ errs = append(errs, fs.ensureFileFromEmbed(name, state))+ }+ return errors.Join(errs...)case ProductStackGraphiti:errCompose := fs.ensureFileFromEmbed(composeFileGraphiti, state)@@ -111,7 +123,11 @@ func (fs *fileSystemOperationsImpl) verifyStackIntegrity(ctx context.Context, stswitch stack {case ProductStackPentagi:- return fs.verifyFileIntegrity(composeFilePentagi, state)+ if err := fs.verifyFileIntegrity(composeFilePentagi, state); err != nil {+ return err+ }+ fs.restoreExampleConfigs(state)+ return nilcase ProductStackGraphiti:if err := fs.verifyFileIntegrity(composeFileGraphiti, state); err != nil {@@ -204,8 +220,9 @@ func (fs *fileSystemOperationsImpl) cleanupStackFiles(ctx context.Context, stackswitch stack {case ProductStackPentagi:filesToRemove = append(filesToRemove, filepath.Join(workingDir, composeFilePentagi))- filesToRemove = append(filesToRemove, filepath.Join(workingDir, pentagiExampleCustomConfigLLM))- filesToRemove = append(filesToRemove, filepath.Join(workingDir, pentagiExampleOllamaConfigLLM))+ for _, name := range pentagiExampleConfigs {+ filesToRemove = append(filesToRemove, filepath.Join(workingDir, name))+ }case ProductStackGraphiti:filesToRemove = append(filesToRemove, filepath.Join(workingDir, composeFileGraphiti))@@ -259,6 +276,26 @@ func (fs *fileSystemOperationsImpl) ensureFileFromEmbed(filename string, state *return fs.processor.files.Copy(filename, workingDir, true)}+// restoreExampleConfigs writes a provider example that is not on disk as a file,+// which covers the directory Docker left in its place, and never touches one that+// is, whatever state.force says: on a stack already extracted the examples are the+// user's. A failure is logged and not returned: the stack starts without the file,+// over the directory Docker makes for it.+func (fs *fileSystemOperationsImpl) restoreExampleConfigs(state *operationState) {+ workingDir := filepath.Dir(fs.processor.state.GetEnvPath())++ for _, name := range pentagiExampleConfigs {+ if fs.fileExists(filepath.Join(workingDir, name)) {+ continue+ }++ fs.processor.appendLog(fmt.Sprintf(MsgCreatingMissingFile, name), ProductStackAll, state)+ if err := fs.processor.files.Copy(name, workingDir, true); err != nil {+ fs.processor.appendLog(fmt.Sprintf(MsgMissingFileNotCreated, name, err), ProductStackAll, state)+ }+ }+}+func (fs *fileSystemOperationsImpl) ensureDirectoryFromEmbed(dirname string, state *operationState) error {workingDir := filepath.Dir(fs.processor.state.GetEnvPath())targetPath := filepath.Join(workingDir, dirname)diff --git a/backend/cmd/installer/processor/fs_test.go b/backend/cmd/installer/processor/fs_test.goindex dba09344..0472e1b0 100644--- a/backend/cmd/installer/processor/fs_test.go+++ b/backend/cmd/installer/processor/fs_test.go@@ -1,10 +1,14 @@package processorimport (+ "context"+ "errors""maps""os""path/filepath"+ "regexp""slices"+ "strings""testing""pentagi/cmd/installer/checker"@@ -12,11 +16,15 @@ import ("github.com/stretchr/testify/assert""github.com/stretchr/testify/require"+ "gopkg.in/yaml.v3")// fsStackFiles are what each stack extracts into the working directory.var fsStackFiles = map[ProductStack][]string{- ProductStackPentagi: {"docker-compose.yml", "example.custom.provider.yml", "example.ollama.provider.yml"},+ ProductStackPentagi: {+ "docker-compose.yml",+ "example.custom.provider.yml", "example.ollama.provider.yml", "example.bedrock.provider.yml",+ },ProductStackGraphiti: {"docker-compose-graphiti.yml", "graphiti", "neo4j"},ProductStackLangfuse: {"docker-compose-langfuse.yml"},ProductStackObservability: {"docker-compose-observability.yml", "observability"},@@ -82,17 +90,11 @@ func TestFs_VerifyStackIntegrity_RestoresEveryMissingFileItVerifies(t *testing.Twant []stringwantErr string}{- {"pentagi verifies its compose file only", ProductStackPentagi, []string{"docker-compose.yml"}, ""},+ {"pentagi with its provider examples", ProductStackPentagi, fsStackFiles[ProductStackPentagi], ""},{"langfuse has its compose file only", ProductStackLangfuse, []string{"docker-compose-langfuse.yml"}, ""},{"observability with its directory", ProductStackObservability, fsStackFiles[ProductStackObservability], ""},- {"compose covers every stack", ProductStackCompose, []string{- "docker-compose.yml", "docker-compose-graphiti.yml", "graphiti", "neo4j",- "docker-compose-langfuse.yml", "docker-compose-observability.yml", "observability",- }, ""},- {"all covers every stack", ProductStackAll, []string{- "docker-compose.yml", "docker-compose-graphiti.yml", "graphiti", "neo4j",- "docker-compose-langfuse.yml", "docker-compose-observability.yml", "observability",- }, ""},+ {"compose covers every stack", ProductStackCompose, fsEveryStackFile, ""},+ {"all covers every stack", ProductStackAll, fsEveryStackFile, ""},{"the worker has no files", ProductStackWorker, nil, "operation verify integrity not applicable for stack worker"},} {t.Run(tc.name, func(t *testing.T) {@@ -108,6 +110,163 @@ func TestFs_VerifyStackIntegrity_RestoresEveryMissingFileItVerifies(t *testing.T}}+func TestFs_VerifyStackIntegrity_RestoresAProviderExampleThatIsNotAFile(t *testing.T) {+ bedrock := "example.bedrock.provider.yml"+ for _, tc := range []struct {+ name string+ directories []string+ missing []string+ force bool+ copyErr error+ want []string+ wantLog string+ }{+ {name: "every example on disk is kept"},+ {name: "a forced update overwrites the compose file and no example", force: true, want: []string{"docker-compose.yml"}},+ {name: "a missing example is written", missing: []string{bedrock}, want: []string{bedrock}},+ {name: "every directory in place of an example is replaced, in the order they are mounted",+ directories: []string{bedrock, "example.custom.provider.yml"},+ want: []string{"example.custom.provider.yml", bedrock}},+ {name: "an example that cannot be written is reported and does not fail the stack",+ directories: []string{bedrock}, copyErr: errors.New("disk full"), want: []string{bedrock},+ wantLog: "Missing file example.bedrock.provider.yml was not created: disk full"},+ } {+ t.Run(tc.name, func(t *testing.T) {+ ops, embedded, dir := fsOperations(t)+ embedded.copyErr = tc.copyErr+ for _, name := range fsStackFiles[ProductStackPentagi] {+ switch {+ case slices.Contains(tc.missing, name):+ case slices.Contains(tc.directories, name):+ require.NoError(t, os.Mkdir(filepath.Join(dir, name), 0o755))+ default:+ require.NoError(t, os.WriteFile(filepath.Join(dir, name), []byte("edited: true\n"), 0o644))+ }+ }+ state := testOperationState(t)+ state.force = tc.force++ require.NoError(t, ops.verifyStackIntegrity(t.Context(), ProductStackPentagi, state))+ assert.Equal(t, tc.want, fsCopied(t, embedded, dir))+ if tc.wantLog != "" {+ assert.Contains(t, state.output.String(), tc.wantLog)+ }+ })+ }+}++// Over the embedded files and the compose files beside them: Docker creates a directory in+// place of a file a compose file mounts and the stack does not extract.+func TestFs_EnsureStackIntegrity_ExtractsEveryFileItsComposeFileMounts(t *testing.T) {+ withDefault := regexp.MustCompile(`\$\{[A-Za-z0-9_]+:?-([^}]*)\}`)+ for _, tc := range []struct {+ stack ProductStack+ composeFile string+ want []string // every source beside the compose file, files and directories alike+ }{+ {ProductStackPentagi, "docker-compose.yml", []string{+ "./docker-ssl",+ "./example.bedrock.provider.yml", "./example.custom.provider.yml", "./example.ollama.provider.yml",+ }},+ {ProductStackGraphiti, "docker-compose-graphiti.yml", []string{+ "./graphiti", "./neo4j/backups", "./neo4j/conf", "./neo4j/import", "./neo4j/logs",+ "./neo4j/metrics", "./neo4j/plugins", "./neo4j/ssl",+ }},+ {ProductStackLangfuse, "docker-compose-langfuse.yml", nil},+ {ProductStackObservability, "docker-compose-observability.yml", []string{+ "./observability/clickhouse/prometheus.xml",+ "./observability/grafana/config", "./observability/grafana/dashboards",+ "./observability/jaeger", "./observability/loki/config.yml", "./observability/otel",+ }},+ } {+ t.Run(string(tc.stack), func(t *testing.T) {+ content, err := os.ReadFile(filepath.Join(repositoryRoot(t), tc.composeFile))+ require.NoError(t, err)+ var compose struct {+ Services map[string]struct {+ Volumes []any `yaml:"volumes"`+ } `yaml:"services"`+ }+ require.NoError(t, yaml.Unmarshal(content, &compose))++ var sources []string+ for name, service := range compose.Services {+ for _, volume := range service.Volumes {+ spec, isShort := volume.(string)+ require.True(t, isShort, "%s mounts %v in the long syntax, which this test does not read", name, volume)+ source, _, _ := strings.Cut(withDefault.ReplaceAllString(spec, "$1"), ":")+ if strings.HasPrefix(source, ".") && !slices.Contains(sources, source) {+ sources = append(sources, source)+ }+ }+ }+ slices.Sort(sources)+ require.Equal(t, tc.want, sources, "what %s mounts from beside it", tc.composeFile)++ state := newMockState(t)+ ops := newFileSystemOperations(&processor{state: state, files: files.NewFiles()})+ require.NoError(t, ops.ensureStackIntegrity(t.Context(), tc.stack, testOperationState(t)),+ "the embedded files may be stale: go generate ./cmd/installer/files/")++ for _, source := range sources {+ // a source without an extension is a directory, which Docker creates as one+ if filepath.Ext(source) == "" {+ continue+ }+ info, err := os.Stat(filepath.Join(filepath.Dir(state.envPath), source))+ require.NoError(t, err, "%s mounts %s, which the stack does not extract", tc.composeFile, source)+ assert.True(t, info.Mode().IsRegular(), "%s is extracted as %s", source, info.Mode())+ }+ })+ }+}++// Over the embedded files themselves. Subtests are keyed by unit: both replace the directory+// with the example, and only the verification of an extracted stack spares an edited example+// from a forced update.+func TestFs_ADirectoryInPlaceOfAProviderExampleBecomesTheExample(t *testing.T) {+ for _, tc := range []struct {+ name string+ run func(fileSystemOperations, context.Context, ProductStack, *operationState) error+ wantCustom string+ }{+ {"ensureStackIntegrity", fileSystemOperations.ensureStackIntegrity, "the example"},+ {"verifyStackIntegrity", fileSystemOperations.verifyStackIntegrity, "edited: true\n"},+ } {+ t.Run(tc.name, func(t *testing.T) {+ embedded := files.NewFiles()+ example := func(name string) string {+ content, err := embedded.GetContent(name)+ require.NoError(t, err, "the embedded files may be stale: go generate ./cmd/installer/files/")+ require.NotEmpty(t, content)+ return string(content)+ }+ state := newMockState(t)+ dir := filepath.Dir(state.envPath)+ ops := newFileSystemOperations(&processor{state: state, files: embedded})+ require.NoError(t, os.WriteFile(filepath.Join(dir, "docker-compose.yml"), []byte("services: {}\n"), 0o644))+ require.NoError(t, os.WriteFile(filepath.Join(dir, "example.custom.provider.yml"), []byte("edited: true\n"), 0o644))+ require.NoError(t, os.Mkdir(filepath.Join(dir, "example.bedrock.provider.yml"), 0o755))+ forced := testOperationState(t)+ forced.force = true++ require.NoError(t, tc.run(ops, t.Context(), ProductStackPentagi, forced))++ for _, name := range []string{"example.bedrock.provider.yml", "example.ollama.provider.yml"} {+ written, err := os.ReadFile(filepath.Join(dir, name))+ require.NoError(t, err)+ assert.Equal(t, example(name), string(written), name)+ }+ custom, err := os.ReadFile(filepath.Join(dir, "example.custom.provider.yml"))+ require.NoError(t, err)+ if tc.wantCustom == "the example" {+ tc.wantCustom = example("example.custom.provider.yml")+ }+ assert.Equal(t, tc.wantCustom, string(custom))+ })+ }+}+func TestFs_CleanupStackFiles_RemovesEveryFileOfTheStackAndNothingElse(t *testing.T) {for _, tc := range []struct {name string@@ -160,12 +319,15 @@ func TestFs_EnsureFileFromEmbed_CopiesOnlyWhatIsMissingUnlessForced(t *testing.T{"a missing file is extracted", false, false, []string{"test.yml"}},{"a file on disk is kept", true, false, nil},{"a file on disk is overwritten when forced", true, true, []string{"test.yml"}},+ {"a directory in its place is replaced", false, false, []string{"test.yml"}},} {t.Run(tc.name, func(t *testing.T) {ops, embedded, dir := fsOperations(t)embedded.AddFile("test.yml", []byte("test content"))if tc.onDisk {require.NoError(t, os.WriteFile(filepath.Join(dir, "test.yml"), []byte("existing"), 0o644))+ } else if strings.HasPrefix(tc.name, "a directory") {+ require.NoError(t, os.Mkdir(filepath.Join(dir, "test.yml"), 0o755))}state := testOperationState(t)state.force = tc.forcediff --git a/backend/cmd/installer/processor/locale.go b/backend/cmd/installer/processor/locale.goindex 88cedd10..e6734643 100644--- a/backend/cmd/installer/processor/locale.go+++ b/backend/cmd/installer/processor/locale.go@@ -43,6 +43,7 @@ const (MsgStackIntegrityVerified = "Stack %s integrity verified"MsgUpdatingExistingFile = "Updating existing file: %s"MsgCreatingMissingFile = "Creating missing file: %s"+ MsgMissingFileNotCreated = "Missing file %s was not created: %s"MsgFileIntegrityValid = "File integrity valid: %s"MsgSkippingModifiedFile = "Skipping modified files: %s"MsgDirectoryCheckedWithModified = "Directory checked with modified files present: %s"diff --git a/backend/cmd/installer/processor/logic_test.go b/backend/cmd/installer/processor/logic_test.goindex 61453353..2659eac1 100644--- a/backend/cmd/installer/processor/logic_test.go+++ b/backend/cmd/installer/processor/logic_test.go@@ -283,6 +283,12 @@ func TestLogic_ApplyChanges_BringsEachStackToItsConfiguredMode(t *testing.T) {fs: []string{"verifyStackIntegrity graphiti", "ensureStackIntegrity pentagi"},compose: []string{"updateStack graphiti", "updateStack pentagi"},docker: networks},+ {name: "a pentagi already extracted is verified instead",+ configure: func(c *mockCheckConfig) { c.PentagiExtracted = true },+ vars: map[string]string{"PENTAGI_VERSION": "1.0.1"},+ fs: []string{"verifyStackIntegrity pentagi"},+ compose: []string{"updateStack pentagi"},+ docker: networks},{name: "an observability failure names its phase",vars: map[string]string{"OTEL_HOST": checker.DefaultObservabilityEndpoint},fail: map[string]error{"ensureStackIntegrity": errors.New("fs error")},diff --git a/backend/cmd/installer/wizard/controller/controller.go b/backend/cmd/installer/wizard/controller/controller.goindex 9019db85..ab21a5f7 100644--- a/backend/cmd/installer/wizard/controller/controller.go+++ b/backend/cmd/installer/wizard/controller/controller.go@@ -3,6 +3,7 @@ package controllerimport ("cmp""fmt"+ "maps""net/url""slices""sort"@@ -16,14 +17,15 @@ import ()const (- EmbeddedLLMConfigsPath = "providers-configs"- DefaultDockerCertPath = "/opt/pentagi/docker/ssl"- DefaultCustomConfigsPath = "/opt/pentagi/conf/custom.provider.yml"- DefaultOllamaConfigsPath = "/opt/pentagi/conf/ollama.provider.yml"- DefaultLLMConfigsPath = "/opt/pentagi/conf/"- DefaultScraperBaseURL = "https://scraper/"- DefaultScraperDomain = "scraper"- DefaultScraperSchema = "https"+ EmbeddedLLMConfigsPath = "providers-configs"+ DefaultDockerCertPath = "/opt/pentagi/docker/ssl"+ DefaultCustomConfigsPath = "/opt/pentagi/conf/custom.provider.yml"+ DefaultOllamaConfigsPath = "/opt/pentagi/conf/ollama.provider.yml"+ DefaultBedrockConfigsPath = "/opt/pentagi/conf/bedrock.provider.yml"+ DefaultLLMConfigsPath = "/opt/pentagi/conf/"+ DefaultScraperBaseURL = "https://scraper/"+ DefaultScraperDomain = "scraper"+ DefaultScraperSchema = "https")type Controller interface {@@ -153,13 +155,12 @@ type LLMProviderConfig struct {APIKey loader.EnvVar // OPEN_AI_KEY | ANTHROPIC_API_KEY | GEMINI_API_KEY | LLM_SERVER_KEY | OLLAMA_SERVER_API_KEY | <prefix>_API_KEY of openAICompatDoorsModel loader.EnvVar // LLM_SERVER_MODEL// AWS Bedrock specific fields- DefaultAuth loader.EnvVar // BEDROCK_DEFAULT_AUTH- BearerToken loader.EnvVar // BEDROCK_BEARER_TOKEN- AccessKey loader.EnvVar // BEDROCK_ACCESS_KEY_ID- SecretKey loader.EnvVar // BEDROCK_SECRET_ACCESS_KEY- SessionToken loader.EnvVar // BEDROCK_SESSION_TOKEN- Region loader.EnvVar // BEDROCK_REGION- BedrockConfig loader.EnvVar // BEDROCK_CONFIG_PATH+ DefaultAuth loader.EnvVar // BEDROCK_DEFAULT_AUTH+ BearerToken loader.EnvVar // BEDROCK_BEARER_TOKEN+ AccessKey loader.EnvVar // BEDROCK_ACCESS_KEY_ID+ SecretKey loader.EnvVar // BEDROCK_SECRET_ACCESS_KEY+ SessionToken loader.EnvVar // BEDROCK_SESSION_TOKEN+ Region loader.EnvVar // BEDROCK_REGION// Anthropic federated (enterprise) auth fieldsAnthropicOrganizationID loader.EnvVar // ANTHROPIC_ORGANIZATION_IDAnthropicWorkspaceID loader.EnvVar // ANTHROPIC_WORKSPACE_ID@@ -167,9 +168,9 @@ type LLMProviderConfig struct {AnthropicIdentityToken loader.EnvVar // ANTHROPIC_IDENTITY_TOKENAnthropicIdentityTokenFile loader.EnvVar // ANTHROPIC_IDENTITY_TOKEN_FILEAnthropicFederationRuleID loader.EnvVar // ANTHROPIC_FEDERATION_RULE_ID- // Ollama and Custom specific fields- ConfigPath loader.EnvVar // OLLAMA_SERVER_CONFIG_PATH | LLM_SERVER_CONFIG_PATH- HostConfigPath loader.EnvVar // PENTAGI_OLLAMA_SERVER_CONFIG_PATH | PENTAGI_LLM_SERVER_CONFIG_PATH+ // Bedrock, Ollama and Custom specific fields+ ConfigPath loader.EnvVar // BEDROCK_CONFIG_PATH | OLLAMA_SERVER_CONFIG_PATH | LLM_SERVER_CONFIG_PATH+ HostConfigPath loader.EnvVar // PENTAGI_BEDROCK_CONFIG_PATH | PENTAGI_OLLAMA_SERVER_CONFIG_PATH | PENTAGI_LLM_SERVER_CONFIG_PATHPreserveReasoning loader.EnvVar // LLM_SERVER_PRESERVE_REASONINGAPIType loader.EnvVar // LLM_SERVER_API_TYPEAPIVersion loader.EnvVar // LLM_SERVER_API_VERSION@@ -187,11 +188,32 @@ type LLMProviderConfig struct {EmbeddedLLMConfigsPath []string}+// llmConfigMountPaths are where docker-compose.yml mounts a provider config from the host:+// the file PENTAGI_<X>_CONFIG_PATH names, or ./example.<provider>.provider.yml beside the+// compose file when that variable is empty. What stands there is the host's file and not+// one the image ships, so none of them is offered as embedded, whatever examples/configs+// holds under the same name.+var llmConfigMountPaths = map[string]string{+ "custom": DefaultCustomConfigsPath,+ "ollama": DefaultOllamaConfigsPath,+ "bedrock": DefaultBedrockConfigsPath,+}++// LLMConfigMountPath is where the provider's config is mounted in the container, or empty+// for a provider that takes none.+func LLMConfigMountPath(providerID string) string {+ return llmConfigMountPaths[providerID]+}+func GetEmbeddedLLMConfigsPath(files files.Files) []string {providersConfigsPath := make([]string, 0)+ mountPaths := slices.Collect(maps.Values(llmConfigMountPaths))if confFiles, err := files.List(EmbeddedLLMConfigsPath); err == nil {for _, confFile := range confFiles {confPath := DefaultLLMConfigsPath + strings.TrimPrefix(confFile, EmbeddedLLMConfigsPath+"/")+ if slices.Contains(mountPaths, confPath) {+ continue+ }providersConfigsPath = append(providersConfigsPath, confPath)}sort.Strings(providersConfigsPath)@@ -293,7 +315,9 @@ func (c *controller) GetLLMProviderConfig(providerID string) *LLMProviderConfigproviderConfig.SecretKey, _ = c.GetVar("BEDROCK_SECRET_ACCESS_KEY")providerConfig.SessionToken, _ = c.GetVar("BEDROCK_SESSION_TOKEN")providerConfig.BaseURL, _ = c.GetVar("BEDROCK_SERVER_URL")- providerConfig.BedrockConfig, _ = c.GetVar("BEDROCK_CONFIG_PATH")+ providerConfig.ConfigPath, _ = c.GetVar("BEDROCK_CONFIG_PATH")+ providerConfig.HostConfigPath, _ = c.GetVar("PENTAGI_BEDROCK_CONFIG_PATH")+ providerConfig.showConfigPath(LLMConfigMountPath("bedrock"))// Configured if any of three auth methods is set: DefaultAuth, BearerToken, or AccessKey+SecretKeyproviderConfig.Configured = providerConfig.DefaultAuth.Value == "true" ||providerConfig.BearerToken.Value != "" ||@@ -305,9 +329,7 @@ func (c *controller) GetLLMProviderConfig(providerID string) *LLMProviderConfigproviderConfig.APIKey, _ = c.GetVar("OLLAMA_SERVER_API_KEY")providerConfig.ConfigPath, _ = c.GetVar("OLLAMA_SERVER_CONFIG_PATH")providerConfig.HostConfigPath, _ = c.GetVar("PENTAGI_OLLAMA_SERVER_CONFIG_PATH")- if slices.Contains(providersConfigsPath, providerConfig.ConfigPath.Value) {- providerConfig.HostConfigPath.Value = providerConfig.ConfigPath.Value- }+ providerConfig.showConfigPath(LLMConfigMountPath("ollama"))providerConfig.Model, _ = c.GetVar("OLLAMA_SERVER_MODEL")providerConfig.PullTimeout, _ = c.GetVar("OLLAMA_SERVER_PULL_MODELS_TIMEOUT")providerConfig.PullEnabled, _ = c.GetVar("OLLAMA_SERVER_PULL_MODELS_ENABLED")@@ -321,9 +343,7 @@ func (c *controller) GetLLMProviderConfig(providerID string) *LLMProviderConfigproviderConfig.Model, _ = c.GetVar("LLM_SERVER_MODEL")providerConfig.ConfigPath, _ = c.GetVar("LLM_SERVER_CONFIG_PATH")providerConfig.HostConfigPath, _ = c.GetVar("PENTAGI_LLM_SERVER_CONFIG_PATH")- if slices.Contains(providersConfigsPath, providerConfig.ConfigPath.Value) {- providerConfig.HostConfigPath.Value = providerConfig.ConfigPath.Value- }+ providerConfig.showConfigPath(LLMConfigMountPath("custom"))providerConfig.PreserveReasoning, _ = c.GetVar("LLM_SERVER_PRESERVE_REASONING")providerConfig.APIType, _ = c.GetVar("LLM_SERVER_API_TYPE")providerConfig.APIVersion, _ = c.GetVar("LLM_SERVER_API_VERSION")@@ -412,8 +432,8 @@ func (c *controller) UpdateLLMProviderConfig(providerID string, config *LLMProviif err := c.SetVar(config.BaseURL.Name, config.BaseURL.Value); err != nil {return fmt.Errorf("failed to set %s: %w", config.BaseURL.Name, err)}- if err := c.SetVar(config.BedrockConfig.Name, config.BedrockConfig.Value); err != nil {- return fmt.Errorf("failed to set %s: %w", config.BedrockConfig.Name, err)+ if err := c.setLLMConfigPaths(config, LLMConfigMountPath("bedrock")); err != nil {+ return err}case "ollama":@@ -436,22 +456,8 @@ func (c *controller) UpdateLLMProviderConfig(providerID string, config *LLMProvireturn fmt.Errorf("failed to set %s: %w", config.LoadModelsEnabled.Name, err)}- var containerPath, hostPath string- if config.HostConfigPath.Value != "" {- if slices.Contains(config.EmbeddedLLMConfigsPath, config.HostConfigPath.Value) {- containerPath = config.HostConfigPath.Value- hostPath = ""- } else {- containerPath = DefaultOllamaConfigsPath- hostPath = config.HostConfigPath.Value- }- }-- if err := c.SetVar(config.ConfigPath.Name, containerPath); err != nil {- return fmt.Errorf("failed to set %s: %w", config.ConfigPath.Name, err)- }- if err := c.SetVar(config.HostConfigPath.Name, hostPath); err != nil {- return fmt.Errorf("failed to set %s: %w", config.HostConfigPath.Name, err)+ if err := c.setLLMConfigPaths(config, LLMConfigMountPath("ollama")); err != nil {+ return err}case "custom":@@ -477,23 +483,45 @@ func (c *controller) UpdateLLMProviderConfig(providerID string, config *LLMProvireturn fmt.Errorf("failed to set %s: %w", config.ProviderName.Name, err)}- var containerPath, hostPath string- if config.HostConfigPath.Value != "" {- if slices.Contains(config.EmbeddedLLMConfigsPath, config.HostConfigPath.Value) {- containerPath = config.HostConfigPath.Value- hostPath = ""- } else {- containerPath = DefaultCustomConfigsPath- hostPath = config.HostConfigPath.Value- }+ if err := c.setLLMConfigPaths(config, LLMConfigMountPath("custom")); err != nil {+ return err}+ }- if err := c.SetVar(config.ConfigPath.Name, containerPath); err != nil {- return fmt.Errorf("failed to set %s: %w", config.ConfigPath.Name, err)- }- if err := c.SetVar(config.HostConfigPath.Name, hostPath); err != nil {- return fmt.Errorf("failed to set %s: %w", config.HostConfigPath.Name, err)- }+ return nil+}++// showConfigPath puts into HostConfigPath the one path the form shows for the two+// variables: a path in the container when the backend reads a config the image ships or+// the file compose mounts at mountPath by default, the file on the host otherwise.+func (config *LLMProviderConfig) showConfigPath(mountPath string) {+ inContainer := config.ConfigPath.Value+ switch {+ case slices.Contains(config.EmbeddedLLMConfigsPath, inContainer):+ config.HostConfigPath.Value = inContainer+ case inContainer == mountPath && config.HostConfigPath.Value == "":+ config.HostConfigPath.Value = mountPath+ }+}++// setLLMConfigPaths is showConfigPath read backwards: a path in the container is named to+// the backend as it is with the host variable cleared, any other path is a file on the+// host, mounted at mountPath.+func (c *controller) setLLMConfigPaths(config *LLMProviderConfig, mountPath string) error {+ var containerPath, hostPath string+ switch typed := config.HostConfigPath.Value; {+ case typed == "":+ case typed == mountPath || slices.Contains(config.EmbeddedLLMConfigsPath, typed):+ containerPath = typed+ default:+ containerPath, hostPath = mountPath, typed+ }++ if err := c.SetVar(config.ConfigPath.Name, containerPath); err != nil {+ return fmt.Errorf("failed to set %s: %w", config.ConfigPath.Name, err)+ }+ if err := c.SetVar(config.HostConfigPath.Name, hostPath); err != nil {+ return fmt.Errorf("failed to set %s: %w", config.HostConfigPath.Name, err)}return nil@@ -523,6 +551,7 @@ func (c *controller) ResetLLMProviderConfig(providerID string) map[string]*LLMPr"BEDROCK_DEFAULT_AUTH", "BEDROCK_BEARER_TOKEN","BEDROCK_ACCESS_KEY_ID", "BEDROCK_SECRET_ACCESS_KEY", "BEDROCK_SESSION_TOKEN","BEDROCK_REGION", "BEDROCK_SERVER_URL", "BEDROCK_CONFIG_PATH",+ "PENTAGI_BEDROCK_CONFIG_PATH",}case "ollama":vars = []string{@@ -2562,6 +2591,7 @@ func (c *controller) getVariableDescription(varName string) string {"PENTAGI_DATA_DIR": locale.EnvDesc_PENTAGI_DATA_DIR,"PENTAGI_DOCKER_SOCKET": locale.EnvDesc_PENTAGI_DOCKER_SOCKET,"PENTAGI_DOCKER_CERT_PATH": locale.EnvDesc_PENTAGI_DOCKER_CERT_PATH,+ "PENTAGI_BEDROCK_CONFIG_PATH": locale.EnvDesc_PENTAGI_BEDROCK_CONFIG_PATH,"PENTAGI_LLM_SERVER_CONFIG_PATH": locale.EnvDesc_PENTAGI_LLM_SERVER_CONFIG_PATH,"PENTAGI_OLLAMA_SERVER_CONFIG_PATH": locale.EnvDesc_PENTAGI_OLLAMA_SERVER_CONFIG_PATH,"DATABASE_EXTENSIONS_SCHEMA": locale.EnvDesc_DATABASE_EXTENSIONS_SCHEMA,@@ -2770,6 +2800,7 @@ var criticalVariables = map[string]bool{"SEARXNG_TIMEOUT": true,// mounting custom LLM server config into pentagi container changes volume mapping+ "PENTAGI_BEDROCK_CONFIG_PATH": true,"PENTAGI_LLM_SERVER_CONFIG_PATH": true,"PENTAGI_OLLAMA_SERVER_CONFIG_PATH": true,diff --git a/backend/cmd/installer/wizard/controller/controller_test.go b/backend/cmd/installer/wizard/controller/controller_test.goindex 89e7e622..988f4e3a 100644--- a/backend/cmd/installer/wizard/controller/controller_test.go+++ b/backend/cmd/installer/wizard/controller/controller_test.go@@ -3,6 +3,7 @@ package controllerimport ("os""path/filepath"+ "regexp""testing""pentagi/cmd/installer/checker"@@ -209,3 +210,116 @@ func TestController_CompatDoorVariablesAreDescribedMaskedAndCritical(t *testing.assert.True(t, c.isVariableMasked(door.prefix+"_API_KEY"), "%s_API_KEY is shown in clear", door.prefix)}}++// The form holds one path; compose needs the file on the host and the path it is mounted at.+func TestController_UpdateLLMProviderConfig_SplitsAConfigPathIntoItsHostAndContainerVariables(t *testing.T) {+ onHost := filepath.Join(t.TempDir(), "my.provider.yml")+ shipped, typed := "/opt/pentagi/conf/bedrock-glm-flash.provider.yml", func(path string) *string { return &path }+ for _, provider := range []struct {+ id, containerVar, hostVar, mountedAt string+ }{+ {"bedrock", "BEDROCK_CONFIG_PATH", "PENTAGI_BEDROCK_CONFIG_PATH", "/opt/pentagi/conf/bedrock.provider.yml"},+ {"ollama", "OLLAMA_SERVER_CONFIG_PATH", "PENTAGI_OLLAMA_SERVER_CONFIG_PATH", "/opt/pentagi/conf/ollama.provider.yml"},+ {"custom", "LLM_SERVER_CONFIG_PATH", "PENTAGI_LLM_SERVER_CONFIG_PATH", "/opt/pentagi/conf/custom.provider.yml"},+ } {+ for _, tc := range []struct {+ name string+ container, host string // what the env file holds first+ typed *string // nil: the form is saved as it was shown+ wantContainer, wantHost string+ wantShown string+ }{+ {name: "a file on the host is mounted",+ container: provider.mountedAt, host: "/elsewhere/old.provider.yml", typed: typed(onHost),+ wantContainer: provider.mountedAt, wantHost: onHost, wantShown: onHost},+ {name: "a config the image ships is named as it is and the host variable is cleared",+ container: provider.mountedAt, host: "/elsewhere/old.provider.yml", typed: typed(shipped),+ wantContainer: shipped, wantShown: shipped},+ {name: "the path the default example is mounted at is named as it is and the host variable is cleared",+ container: shipped, host: "/elsewhere/old.provider.yml", typed: typed(provider.mountedAt),+ wantContainer: provider.mountedAt, wantShown: provider.mountedAt},+ {name: "an empty path clears both",+ container: provider.mountedAt, host: "/elsewhere/old.provider.yml", typed: typed("")},+ {name: "a mounted host file is kept by a save that does not touch the path",+ container: provider.mountedAt, host: "/elsewhere/old.provider.yml",+ wantContainer: provider.mountedAt, wantHost: "/elsewhere/old.provider.yml", wantShown: "/elsewhere/old.provider.yml"},+ {name: "the default example is kept by a save that does not touch the path",+ container: provider.mountedAt,+ wantContainer: provider.mountedAt, wantShown: provider.mountedAt},+ {name: "a config the image ships is kept by a save that does not touch the path",+ container: shipped, wantContainer: shipped, wantShown: shipped},+ } {+ t.Run(provider.id+": "+tc.name, func(t *testing.T) {+ c, envPath := controllerOverExampleEnv(t)+ require.NoError(t, c.SetVar(provider.containerVar, tc.container))+ require.NoError(t, c.SetVar(provider.hostVar, tc.host))++ cfg := c.GetLLMProviderConfig(provider.id)+ if tc.typed != nil {+ cfg.HostConfigPath.Value = *tc.typed+ }+ require.NoError(t, c.UpdateLLMProviderConfig(provider.id, cfg))+ require.NoError(t, c.Commit())++ saved := openController(t, envPath)+ container, _ := saved.GetVar(provider.containerVar)+ host, _ := saved.GetVar(provider.hostVar)+ assert.Equal(t, tc.wantContainer, container.Value, provider.containerVar)+ assert.Equal(t, tc.wantHost, host.Value, provider.hostVar)+ assert.Equal(t, tc.wantShown, saved.GetLLMProviderConfig(provider.id).HostConfigPath.Value, "the path the form shows")++ pending := saved.GetLLMProviderConfig(provider.id)+ pending.HostConfigPath.Value = "/elsewhere/unsaved.provider.yml"+ require.NoError(t, saved.UpdateLLMProviderConfig(provider.id, pending))+ saved.ResetLLMProviderConfig(provider.id)+ assert.Equal(t, tc.wantShown, saved.GetLLMProviderConfig(provider.id).HostConfigPath.Value,+ "a reset left the unsaved path in place")+ })+ }+ }+}++// A file baked at a path the compose file mounts over stops a host that mounts a directory there.+func TestController_GetEmbeddedLLMConfigsPath_OffersExactlyTheConfigsTheImageShips(t *testing.T) {+ dockerfile, err := os.ReadFile(filepath.Join("..", "..", "..", "..", "..", "Dockerfile"))+ require.NoError(t, err)++ var shipped []string+ for _, match := range regexp.MustCompile(`(?m)^COPY examples/configs/(\S+\.provider\.yml) /opt/pentagi/conf/$`).+ FindAllStringSubmatch(string(dockerfile), -1) {+ shipped = append(shipped, "/opt/pentagi/conf/"+match[1])+ }+ require.Greater(t, len(shipped), 20, "the COPY lines of the Dockerfile stopped matching")++ offered := GetEmbeddedLLMConfigsPath(files.NewFiles())+ assert.ElementsMatch(t, shipped, offered, "every examples/configs file needs its COPY line in the Dockerfile, "++ "and the embedded files may be stale: go generate ./cmd/installer/files/")+ for _, mounted := range []string{+ "/opt/pentagi/conf/custom.provider.yml",+ "/opt/pentagi/conf/ollama.provider.yml",+ "/opt/pentagi/conf/bedrock.provider.yml",+ } {+ assert.NotContains(t, offered, mounted)+ }+}++func TestController_GetApplyChangesConfig_DescribesAConfigPathChangeAndCallsItCritical(t *testing.T) {+ for _, name := range []string{+ "BEDROCK_CONFIG_PATH", "PENTAGI_BEDROCK_CONFIG_PATH",+ "OLLAMA_SERVER_CONFIG_PATH", "PENTAGI_OLLAMA_SERVER_CONFIG_PATH",+ "LLM_SERVER_CONFIG_PATH", "PENTAGI_LLM_SERVER_CONFIG_PATH",+ } {+ t.Run(name, func(t *testing.T) {+ c, _ := controllerOverExampleEnv(t)+ require.NoError(t, c.Commit())+ require.False(t, c.GetApplyChangesConfig().HasCritical, "the example env is critical before anything changed")+ require.NoError(t, c.SetVar(name, "/opt/pentagi/conf/bedrock-glm-flash.provider.yml"))++ changes := c.GetApplyChangesConfig()+ require.Len(t, changes.Changes, 1)+ assert.Equal(t, name, changes.Changes[0].Variable)+ assert.NotEqual(t, name, changes.Changes[0].Description, "the change is listed under the bare variable name")+ assert.True(t, changes.HasCritical, "the change is not announced as one that restarts the service")+ })+ }+}diff --git a/backend/cmd/installer/wizard/locale/locale.go b/backend/cmd/installer/wizard/locale/locale.goindex e78fab15..dd241add 100644--- a/backend/cmd/installer/wizard/locale/locale.go+++ b/backend/cmd/installer/wizard/locale/locale.go@@ -816,7 +816,7 @@ const (LLMFormSessionTokenDesc = "AWS Session Token for temporary credentials (optional, used with static credentials)"LLMFormRegionDesc = "AWS region for Bedrock service"LLMFormModelDesc = "Default model to use for this provider"- LLMFormConfigPathDesc = "Path to configuration file (optional)"+ LLMFormConfigPathDesc = "Config file on this host, or a config inside the container from the suggestions (optional)"LLMFormAPITypeDesc = "Address convention: azure or azure_ad for an Azure OpenAI deployment, empty for a plain OpenAI-compatible endpoint"LLMFormAPIVersionDesc = "api-version an Azure deployment requires; ignored by a plain endpoint"LLMFormPreserveReasoningDesc = "Preserve reasoning content in multi-turn conversations (required by some providers)"@@ -826,10 +826,6 @@ const (LLMFormLoadModelsEnabledDesc = "Load available models list from Ollama server"LLMFormOllamaAPIKeyDesc = "Ollama Cloud API key (optional, leave empty for local Ollama server)"- // Bedrock config file- LLMFormFieldBedrockConfig = "Config Path"- LLMFormBedrockConfigDesc = "Path to an AWS Bedrock config file on the host (optional)"-// Anthropic authentication mode (API key vs federated / enterprise)LLMAnthropicAuthModeTitle = "Authentication"LLMAnthropicAuthModeDesc = "Choose how PentAGI authenticates to Anthropic"@@ -2533,7 +2529,7 @@ const (EnvDesc_BEDROCK_SESSION_TOKEN = "AWS Bedrock Session Token"EnvDesc_BEDROCK_REGION = "AWS Bedrock Region"EnvDesc_BEDROCK_SERVER_URL = "AWS Bedrock Custom Endpoint URL"- EnvDesc_BEDROCK_CONFIG_PATH = "AWS Bedrock Config Path"+ EnvDesc_BEDROCK_CONFIG_PATH = "AWS Bedrock Container Config Path"EnvDesc_OLLAMA_SERVER_URL = "Ollama Server URL"EnvDesc_OLLAMA_SERVER_API_KEY = "Ollama Server API Key (Cloud)"EnvDesc_OLLAMA_SERVER_MODEL = "Ollama Default Model"@@ -2691,6 +2687,7 @@ const (EnvDesc_PENTAGI_DATA_DIR = "PentAGI Data Directory"EnvDesc_PENTAGI_DOCKER_SOCKET = "Mount Docker Socket Path"EnvDesc_PENTAGI_DOCKER_CERT_PATH = "Mount Docker Certificate Path"+ EnvDesc_PENTAGI_BEDROCK_CONFIG_PATH = "AWS Bedrock Host Config Path"EnvDesc_PENTAGI_LLM_SERVER_CONFIG_PATH = "Custom LLM Host Config Path"EnvDesc_PENTAGI_OLLAMA_SERVER_CONFIG_PATH = "Ollama Host Config Path"diff --git a/backend/cmd/installer/wizard/models/llm_provider_form.go b/backend/cmd/installer/wizard/models/llm_provider_form.goindex f4cdb3a1..da54a17d 100644--- a/backend/cmd/installer/wizard/models/llm_provider_form.go+++ b/backend/cmd/installer/wizard/models/llm_provider_form.go@@ -136,7 +136,7 @@ func (m *LLMProviderFormModel) BuildForm() tea.Cmd {fields = append(fields, m.createSecretKeyField(config))fields = append(fields, m.createSessionTokenField(config))fields = append(fields, m.createBaseURLField(config))- fields = append(fields, m.createBedrockConfigField(config))+ fields = append(fields, m.createConfigPathField(config))case LLMProviderOllama:fields = append(fields, m.createBaseURLField(config))@@ -212,21 +212,6 @@ func (m *LLMProviderFormModel) createAnthropicField(}}-func (m *LLMProviderFormModel) createBedrockConfigField(config *controller.LLMProviderConfig) FormField {- input := NewTextInput(m.GetStyles(), m.GetWindow(), config.BedrockConfig)- input.Placeholder = "/opt/pentagi/conf/bedrock.yml"-- return FormField{- Key: "bedrock_config",- Title: locale.LLMFormFieldBedrockConfig,- Description: locale.LLMFormBedrockConfigDesc,- Required: false,- Masked: false,- Input: input,- Value: input.Value(),- }-}-func (m *LLMProviderFormModel) createDefaultAuthField(config *controller.LLMProviderConfig) FormField {input := NewBooleanInput(m.GetStyles(), m.GetWindow(), config.DefaultAuth)@@ -330,8 +315,11 @@ func (m *LLMProviderFormModel) createModelField(config *controller.LLMProviderCofunc (m *LLMProviderFormModel) createConfigPathField(config *controller.LLMProviderConfig) FormField {input := NewTextInput(m.GetStyles(), m.GetWindow(), config.HostConfigPath)if config.HostConfigPath.Default == "" {- input.Placeholder = "/opt/pentagi/conf/config.yml"+ input.Placeholder = controller.LLMConfigMountPath(string(m.providerID))}+ // the path shown may come from the container variable while the host one is not in+ // the env file at all, and an input takes its value only from a variable that is+ input.SetValue(config.HostConfigPath.Value)return FormField{Key: "config_path",@@ -642,9 +630,9 @@ func (m *LLMProviderFormModel) GetCurrentConfiguration() string {sections = append(sections, fmt.Sprintf("• %s: %s",locale.LLMFormFieldBaseURL, m.GetStyles().Info.Render(locale.StatusConfigured)))}- if config.BedrockConfig.Value != "" {+ if config.HostConfigPath.Value != "" {sections = append(sections, fmt.Sprintf("• %s: %s",- locale.LLMFormFieldBedrockConfig, m.GetStyles().Info.Render(config.BedrockConfig.Value)))+ locale.LLMFormFieldConfigPath, m.GetStyles().Info.Render(config.HostConfigPath.Value)))}case LLMProviderOllama:@@ -784,7 +772,6 @@ func (m *LLMProviderFormModel) HandleSave() error {SecretKey: config.SecretKey,SessionToken: config.SessionToken,Region: config.Region,- BedrockConfig: config.BedrockConfig,AnthropicOrganizationID: config.AnthropicOrganizationID,AnthropicWorkspaceID: config.AnthropicWorkspaceID,AnthropicServiceAccountID: config.AnthropicServiceAccountID,@@ -824,8 +811,6 @@ func (m *LLMProviderFormModel) HandleSave() error {newConfig.AnthropicIdentityTokenFile.Value = valuecase "anthropic_federation_rule_id":newConfig.AnthropicFederationRuleID.Value = value- case "bedrock_config":- newConfig.BedrockConfig.Value = valuecase "model":newConfig.Model.Value = valuecase "default_auth":@@ -850,8 +835,10 @@ func (m *LLMProviderFormModel) HandleSave() error {// User edits HostConfigPath, ConfigPath is auto-generated on save// validate config path if provided (skip validation for embedded configs)if value != "" {- // embedded configs don't need validation (they're inside the docker image)- isEmbedded := slices.Contains(newConfig.EmbeddedLLMConfigsPath, value)+ // embedded configs don't need validation (they're inside the docker image),+ // and neither does the path the default example is mounted at+ isEmbedded := slices.Contains(newConfig.EmbeddedLLMConfigsPath, value) ||+ value == controller.LLMConfigMountPath(string(m.providerID))// only validate custom (non-embedded) configs on host filesystemif !isEmbedded {diff --git a/backend/cmd/installer/wizard/models/llm_provider_form_test.go b/backend/cmd/installer/wizard/models/llm_provider_form_test.goindex d486c9d7..519744d8 100644--- a/backend/cmd/installer/wizard/models/llm_provider_form_test.go+++ b/backend/cmd/installer/wizard/models/llm_provider_form_test.go@@ -3,12 +3,20 @@ package modelsimport ("fmt""os"+ "path/filepath""regexp"+ "slices""sort""strings""testing"+ "pentagi/cmd/installer/checker"+ "pentagi/cmd/installer/files"+ "pentagi/cmd/installer/state"+ "pentagi/cmd/installer/wizard/controller""pentagi/cmd/installer/wizard/locale"+ "pentagi/cmd/installer/wizard/styles"+ "pentagi/cmd/installer/wizard/window")// A field the save switch does not name still renders, and is dropped on save without an error.@@ -69,3 +77,83 @@ func TestLLMProviderForm_GivesEveryOfferedDoorItsOwnNameDescriptionAndURL(t *tes}}}++// BEDROCK_CONFIG_PATH is read inside the container, where a path on the host does not exist.+// The env file has no PENTAGI_BEDROCK_CONFIG_PATH line, as every host installed from a release.+func TestLLMProviderForm_HandleSave_MountsABedrockConfigTypedAsAFileOnTheHost(t *testing.T) {+ onHost := filepath.Join(t.TempDir(), "my-bedrock.provider.yml")+ if err := os.WriteFile(onHost, []byte("simple:\n model: zai.glm-4.7-flash\n"), 0o600); err != nil {+ t.Fatal(err)+ }+ mountedAt, shipped := "/opt/pentagi/conf/bedrock.provider.yml", "/opt/pentagi/conf/bedrock-glm-flash.provider.yml"+ typed := func(path string) *string { return &path }+ for _, tc := range []struct {+ name string+ container string // BEDROCK_CONFIG_PATH in the env file+ typed *string // nil: the form is saved as it was shown+ wantShown string+ wantContainer, wantHost string+ wantErr string+ }{+ {name: "a file on the host", typed: typed(onHost), wantContainer: mountedAt, wantHost: onHost},+ {name: "a config the image ships", typed: typed(shipped), wantContainer: shipped},+ {name: "the path the default example is mounted at", typed: typed(mountedAt), wantContainer: mountedAt},+ {name: "a path that is on neither", typed: typed("/opt/pentagi/conf/bedrock.yml"),+ wantErr: "config file does not exist: /opt/pentagi/conf/bedrock.yml"},+ {name: "the default example in use is shown and kept by an untouched save",+ container: mountedAt, wantShown: mountedAt, wantContainer: mountedAt},+ {name: "a config the image ships in use is shown and kept by an untouched save",+ container: shipped, wantShown: shipped, wantContainer: shipped},+ } {+ t.Run(tc.name, func(t *testing.T) {+ example, err := os.ReadFile(filepath.Join("..", "..", "..", "..", "..", ".env.example"))+ if err != nil {+ t.Fatal(err)+ }+ env := strings.Replace(string(example), "\nPENTAGI_BEDROCK_CONFIG_PATH=\n", "\n", 1)+ env = strings.Replace(env, "\nBEDROCK_CONFIG_PATH=\n", "\nBEDROCK_CONFIG_PATH="+tc.container+"\n", 1)+ if env == string(example) || strings.Contains(env, "PENTAGI_BEDROCK_CONFIG_PATH") {+ t.Fatal("the example env no longer holds the two bedrock config lines as empty assignments")+ }+ envPath := filepath.Join(t.TempDir(), ".env")+ if err := os.WriteFile(envPath, []byte(env), 0o600); err != nil {+ t.Fatal(err)+ }+ st, err := state.NewState(envPath)+ if err != nil {+ t.Fatal(err)+ }+ c := controller.NewController(st, files.NewFiles(), checker.CheckResult{})+ form := NewLLMProviderFormModel(c, styles.New(), window.New(), LLMProviderBedrock)+ form.BuildForm()++ i := slices.IndexFunc(form.GetFormFields(), func(f FormField) bool { return f.Key == "config_path" })+ if i < 0 {+ t.Fatal("the bedrock form has no config path field")+ }+ if got := form.fields[i].Input.Value(); got != tc.wantShown {+ t.Errorf("the field shows %q, want %q", got, tc.wantShown)+ }+ if tc.typed != nil {+ form.fields[i].Input.SetValue(*tc.typed)+ }++ err = form.HandleSave()+ if tc.wantErr != "" {+ if err == nil || err.Error() != tc.wantErr {+ t.Fatalf("HandleSave() = %v, want %q", err, tc.wantErr)+ }+ return+ }+ if err != nil {+ t.Fatal(err)+ }+ if got, _ := c.GetVar("BEDROCK_CONFIG_PATH"); got.Value != tc.wantContainer {+ t.Errorf("BEDROCK_CONFIG_PATH = %q, want %q", got.Value, tc.wantContainer)+ }+ if got, _ := c.GetVar("PENTAGI_BEDROCK_CONFIG_PATH"); got.Value != tc.wantHost {+ t.Errorf("PENTAGI_BEDROCK_CONFIG_PATH = %q, want %q", got.Value, tc.wantHost)+ }+ })+ }+}diff --git a/backend/docs/installer.md b/backend/docs/installer.mdindex 5dad22c8..6ef59a49 100644--- a/backend/docs/installer.md+++ b/backend/docs/installer.md@@ -941,7 +941,7 @@ func (m *Model) ensureFocusVisible() {**Provider Field Mapping**:- **OpenAI/Anthropic/Gemini**: Base URL + API Key-- **AWS Bedrock**: Region + Authentication (Default Auth OR Bearer Token OR Access Key + Secret Key) + Session Token (optional) + Base URL (optional)+- **AWS Bedrock**: Region + Authentication (Default Auth OR Bearer Token OR Access Key + Secret Key) + Session Token (optional) + Base URL (optional) + Config Path (optional)- **DeepSeek/GLM/Kimi/Qwen**: Base URL + API Key + Provider Name (optional, for LiteLLM)- **Ollama**: Base URL + API Key (optional, for cloud) + Model + Config Path + Pull/Load options- **Custom**: Base URL + API Key + Model + Config Path + Preserve Reasoning (boolean) + Provider Name@@ -1279,7 +1279,7 @@ provider := ProviderInfo{#### **Provider-Specific Field Sets**- **OpenAI/Anthropic/Gemini**: Base URL + API Key-- **AWS Bedrock**: Region + Authentication (Default Auth OR Bearer Token OR Access Key + Secret Key) + Session Token (optional) + Base URL (optional)+- **AWS Bedrock**: Region + Authentication (Default Auth OR Bearer Token OR Access Key + Secret Key) + Session Token (optional) + Base URL (optional) + Config Path (optional)- **Default Auth**: Use AWS SDK credential chain (environment, EC2 role, ~/.aws/credentials) - highest priority- **Bearer Token**: Token-based authentication - priority over static credentials- **Static Credentials**: Access Key + Secret Key + Session Token (optional) - traditional IAM authenticationdiff --git a/backend/docs/installer/installer-troubleshooting.md b/backend/docs/installer/installer-troubleshooting.mdindex 18eb4606..145c633b 100644--- a/backend/docs/installer/installer-troubleshooting.md+++ b/backend/docs/installer/installer-troubleshooting.md@@ -121,7 +121,7 @@ func (m *FormModel) ensureFocusVisible() {**Provider-Specific Field Sets:**- **OpenAI/Anthropic/Gemini**: Base URL + API Key-- **AWS Bedrock**: Region + Default Auth OR Bearer Token OR (Access Key + Secret Key + Session Token) + Base URL+- **AWS Bedrock**: Region + Default Auth OR Bearer Token OR (Access Key + Secret Key + Session Token) + Base URL + Config Path- **DeepSeek**: Base URL + API Key + Provider Name (for LiteLLM prefix, e.g., 'deepseek')- **GLM**: Base URL + API Key + Provider Name (for LiteLLM prefix, e.g., 'zai')- **Kimi**: Base URL + API Key + Provider Name (for LiteLLM prefix, e.g., 'moonshot')diff --git a/backend/docs/installer/processor-implementation.md b/backend/docs/installer/processor-implementation.mdindex 8030b936..ada6dc75 100644--- a/backend/docs/installer/processor-implementation.md+++ b/backend/docs/installer/processor-implementation.md@@ -19,7 +19,7 @@ Processor package implements the operational engine for PentAGI installer operat- Handle embedded directory trees (observability) and compose files- YAML validation and automatic file recovery- Support deployment modes (embedded/external/disabled) for applicable stacks- - Excluded files policy for integrity verification (`filesToExcludeFromVerification`): presence ensured, content changes tolerated — service configs (`observability/otel/config.yml`, `observability/grafana/config/grafana.ini`), user-editable presets (`example.custom.provider.yml`, `example.ollama.provider.yml`, `neo4j/conf/neo4j.conf`, `neo4j/conf/apoc.conf`, `graphiti/{custom,gemini,litellm,openai}.yaml`) and both Jaeger storage plugin binaries+ - Excluded files policy for integrity verification (`filesToExcludeFromVerification`): presence ensured, content changes tolerated — service configs (`observability/otel/config.yml`, `observability/grafana/config/grafana.ini`), user-editable presets (`example.custom.provider.yml`, `example.ollama.provider.yml`, `example.bedrock.provider.yml`, `neo4j/conf/neo4j.conf`, `neo4j/conf/apoc.conf`, `graphiti/{custom,gemini,litellm,openai}.yaml`) and both Jaeger storage plugin binaries2. **Docker Operations** (`docker.go`):- Worker and default image management with progress reportingdiff --git a/backend/docs/installer/processor-logic-implementation.md b/backend/docs/installer/processor-logic-implementation.mdindex add11991..800408a8 100644--- a/backend/docs/installer/processor-logic-implementation.md+++ b/backend/docs/installer/processor-logic-implementation.md@@ -104,7 +104,7 @@ p.checker.GatherPentagiInfo(ctx)- **verifyStackIntegrity**: checks existence, updates with force=true- **Embedded Provider**: uses `files.Files` for embedded content access- correctness of directory checks: when modified files are detected and force=false, we log skip explicitly and keep files intact; the final directory log reflects whether modified files were present-- excluded files policy: `observability/otel/config.yml`, `observability/grafana/config/grafana.ini`, `example.custom.provider.yml`, `example.ollama.provider.yml` are ensured to exist but not overwritten if modified+- excluded files policy: `observability/otel/config.yml`, `observability/grafana/config/grafana.ini`, `example.custom.provider.yml`, `example.ollama.provider.yml`, `example.bedrock.provider.yml` are ensured to exist but not overwritten if modified#### Container State Management- `updateStack`: executes `docker compose up -d` for rolling updatediff --git a/backend/docs/installer/processor.md b/backend/docs/installer/processor.mdindex 38652dbf..e49b52de 100644--- a/backend/docs/installer/processor.md+++ b/backend/docs/installer/processor.md@@ -272,12 +272,12 @@ Each specialized file should contain business-logic level methods that directly### Key Environment Variables- **LLM providers**: OPEN_AI_KEY, ANTHROPIC_API_KEY, GEMINI_API_KEY, BEDROCK_*, DEEPSEEK_*, GLM_*, KIMI_*, QWEN_*, OLLAMA_SERVER_URL-- **Provider configs**: PENTAGI_LLM_SERVER_CONFIG_PATH (host path), PENTAGI_OLLAMA_SERVER_CONFIG_PATH (host path)+- **Provider configs**: PENTAGI_LLM_SERVER_CONFIG_PATH (host path), PENTAGI_OLLAMA_SERVER_CONFIG_PATH (host path), PENTAGI_BEDROCK_CONFIG_PATH (host path)- **Monitoring**: LANGFUSE_BASE_URL, LANGFUSE_PROJECT_ID, OTEL_HOST- **Docker config**: DOCKER_HOST, PENTAGI_DOCKER_CERT_PATH (host path), DOCKER_TLS_VERIFY, DOCKER_CERT_PATH (container path, managed)- **Deployment modes**: envs determine embedded vs external vs disabled- **Worker images**: DOCKER_DEFAULT_IMAGE (debian:latest), DOCKER_DEFAULT_IMAGE_FOR_PENTEST (vxcontrol/kali-linux)-- **Path migration**: DoMigrateSettings() migrates old DOCKER_CERT_PATH/LLM_SERVER_CONFIG_PATH/OLLAMA_SERVER_CONFIG_PATH to PENTAGI_* variants on startup+- **Path migration**: DoMigrateSettings() migrates old DOCKER_CERT_PATH/LLM_SERVER_CONFIG_PATH/OLLAMA_SERVER_CONFIG_PATH/BEDROCK_CONFIG_PATH to PENTAGI_* variants on startup### Error Handling Strategy- **Validation errors**: validate stack applicability before operationdiff --git a/backend/pkg/providers/bedrock/bedrock_test.go b/backend/pkg/providers/bedrock/bedrock_test.goindex 4494e961..8e3019c0 100644--- a/backend/pkg/providers/bedrock/bedrock_test.go+++ b/backend/pkg/providers/bedrock/bedrock_test.go@@ -69,6 +69,20 @@ func TestBedrock_DefaultProviderConfig_ReadsAnExternalFileInsteadOfTheEmbeddedOnassert.Equal(t, "zai.glm-4.7-flash", prov.Model(pconfig.OptionsTypeSimple))}+// The installer extracts the example as the file BEDROCK_CONFIG_PATH is mounted from, so+// what a host starts editing is the assignment the binary runs without it.+func TestBedrock_DefaultProviderConfig_IsWhatTheShippedExampleHolds(t *testing.T) {+ t.Parallel()++ example, err := os.ReadFile(filepath.Join("..", "..", "..", "..", "examples", "configs", "bedrock.provider.yml"))+ require.NoError(t, err)+ builtIn, err := configFS.ReadFile("config.yml")+ require.NoError(t, err)++ assert.Equal(t, string(builtIn), string(example),+ "copy pkg/providers/bedrock/config.yml over examples/configs/bedrock.provider.yml")+}+func TestBedrock_DefaultModels_PricesEveryModelAndDatesItToItsBedrockLaunch(t *testing.T) {t.Parallel()diff --git a/docker-compose.e2e.yml b/docker-compose.e2e.ymlindex 62730d46..909cfb0a 100644--- a/docker-compose.e2e.yml+++ b/docker-compose.e2e.yml@@ -64,6 +64,13 @@ services:- COOKIE_SIGNING_SALT=e2e-throwaway-salt# Sandbox ports come from this base, and every instance owns [base, base+2000).- DOCKER_PORTS_BASE=30000+ # The base file mounts ./example.*.provider.yml, which an installed stack has+ # beside its compose file and a checkout does not: Docker would create each of+ # them as a directory in the repository root.+ volumes:+ - ./examples/configs/custom-openai.provider.yml:/opt/pentagi/conf/custom.provider.yml+ - ./examples/configs/ollama-llama318b-instruct.provider.yml:/opt/pentagi/conf/ollama.provider.yml+ - ./examples/configs/bedrock.provider.yml:/opt/pentagi/conf/bedrock.provider.yml# The base service has no healthcheck, so `up --wait` would return before# goose migrations finish and the API serves. The runtime image is alpine —# probe with busybox wget, not curl.diff --git a/examples/configs/bedrock.provider.yml b/examples/configs/bedrock.provider.ymlnew file mode 100644index 00000000..3ecfdf63--- /dev/null+++ b/examples/configs/bedrock.provider.yml@@ -0,0 +1,176 @@+# Simple tasks - reasoning model for better quality+simple:+ model: openai.gpt-oss-120b-1:0+ temperature: 0.5+ top_p: 0.5+ n: 1+ max_tokens: 6000+ price:+ input: 0.15+ output: 0.6++simple_json:+ model: openai.gpt-oss-120b-1:0+ temperature: 0.5+ top_p: 0.5+ n: 1+ max_tokens: 4000+ json: true+ price:+ input: 0.15+ output: 0.6++# Primary agent - multimodal with thinking capabilities+primary_agent:+ model: us.anthropic.claude-sonnet-4-5-20250929-v1:0+ temperature: 1.0+ n: 1+ max_tokens: 16384+ reasoning:+ max_tokens: 2048+ price:+ input: 3.3+ output: 16.5+ cache_read: 0.33+ cache_write: 4.125++# Assistant - main working agent with multimodal capabilities+assistant:+ model: us.anthropic.claude-sonnet-4-5-20250929-v1:0+ temperature: 1.0+ n: 1+ max_tokens: 16384+ reasoning:+ max_tokens: 1024+ price:+ input: 3.3+ output: 16.5+ cache_read: 0.33+ cache_write: 4.125++# Generator - maximum quality for creative tasks+generator:+ model: us.anthropic.claude-sonnet-4-5-20250929-v1:0+ temperature: 1.0+ n: 1+ max_tokens: 16384+ reasoning:+ max_tokens: 4096+ price:+ input: 3.3+ output: 16.5+ cache_read: 0.33+ cache_write: 4.125++# Refiner - refinement and improvement with reasoning+refiner:+ model: us.anthropic.claude-sonnet-4-5-20250929-v1:0+ temperature: 1.0+ n: 1+ max_tokens: 12000+ reasoning:+ max_tokens: 2048+ price:+ input: 3.3+ output: 16.5+ cache_read: 0.33+ cache_write: 4.125++# Adviser - strategic planning with world-class intelligence+adviser:+ model: us.anthropic.claude-opus-4-6-v1+ temperature: 1.0+ n: 1+ max_tokens: 16384+ reasoning:+ mode: adaptive+ effort: high+ price:+ input: 5.5+ output: 27.5+ cache_read: 0.55+ cache_write: 6.875++# Reflector - result analysis with efficiency+reflector:+ model: us.anthropic.claude-haiku-4-5-20251001-v1:0+ temperature: 1.0+ n: 1+ max_tokens: 4096+ reasoning:+ max_tokens: 1024+ price:+ input: 1.1+ output: 5.5+ cache_read: 0.11+ cache_write: 1.375++# Searcher - information retrieval, high-frequency calls+searcher:+ model: us.anthropic.claude-haiku-4-5-20251001-v1:0+ temperature: 1.0+ n: 1+ max_tokens: 8192+ reasoning:+ max_tokens: 1024+ price:+ input: 1.1+ output: 5.5+ cache_read: 0.11+ cache_write: 1.375++# Enricher - data enrichment with long-context efficiency+enricher:+ model: us.anthropic.claude-haiku-4-5-20251001-v1:0+ temperature: 1.0+ n: 1+ max_tokens: 8192+ reasoning:+ max_tokens: 1024+ price:+ input: 1.1+ output: 5.5+ cache_read: 0.11+ cache_write: 1.375++# Coder - code generation with industry-leading coding capabilities+coder:+ model: us.anthropic.claude-sonnet-4-5-20250929-v1:0+ temperature: 1.0+ n: 1+ max_tokens: 16384+ reasoning:+ max_tokens: 2048+ price:+ input: 3.3+ output: 16.5+ cache_read: 0.33+ cache_write: 4.125++# Installer - installation and configuration with extensive software knowledge+installer:+ model: us.anthropic.claude-sonnet-4-5-20250929-v1:0+ temperature: 1.0+ n: 1+ max_tokens: 8192+ reasoning:+ max_tokens: 1024+ price:+ input: 3.3+ output: 16.5+ cache_read: 0.33+ cache_write: 4.125++# Pentester - security testing with multimodal and thinking capabilities+pentester:+ model: us.anthropic.claude-sonnet-4-5-20250929-v1:0+ temperature: 1.0+ n: 1+ max_tokens: 16384+ reasoning:+ max_tokens: 1024+ price:+ input: 3.3+ output: 16.5+ cache_read: 0.33+ cache_write: 4.125