Skip to content

Commit 33e8ef3

Browse files
committed
Fix MCP env var check skipped when any gateway preflight errors
When GatherEnvVarsForTools returned a preflight error for any MCP toolset, the successfully-gathered env var names from other toolsets were silently discarded because they were only processed in the else branch. This meant configs with multiple MCP refs (where at least one gateway call failed) would bypass all tool env var validation. Assisted-By: docker-agent
1 parent 9dff713 commit 33e8ef3

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

pkg/config/gather.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,12 @@ func gatherMissingEnvVars(ctx context.Context, cfg *latest.Config, modelsGateway
3333
if err != nil {
3434
// Store tool preflight error but continue checking models
3535
toolErr = err
36-
} else {
37-
for _, e := range names {
38-
requiredEnv[e] = true
39-
}
36+
}
37+
// Always add tool env vars, even when some toolsets had preflight errors.
38+
// Previously, a preflight error from one toolset would cause all tool
39+
// env vars to be silently skipped.
40+
for _, e := range names {
41+
requiredEnv[e] = true
4042
}
4143

4244
for _, e := range sortedKeys(requiredEnv) {

0 commit comments

Comments
 (0)