Skip to content

🤖 fix: tighten plugin env key checks and the loader variable list - #6804

Merged
ThomasK33 merged 2 commits into
mainfrom
fix/plugin-env-key-checks
Oct 15, 2026
Merged

ThomasK33 merged 2 commits into
mainfrom
fix/plugin-env-key-checks

Conversation

@ThomasK33

@ThomasK33 ThomasK33 commented Oct 15, 2026 •

Copy link
Copy Markdown
Member

Closes #6713

This PR does the three follow-ups from the #6690 readiness review (plugin env checks).

  1. A. = in env keys: normalizeStdioEntry (mcpConfig.ts) now refuses an env key that is empty or contains =, as env_vars names already do. A key such as PLUGIN_DATA=/x would set PLUGIN_DATA in the joined env block. On Windows libuv sorts that block, so Xum writing the reserved values last does not protect them. The env checks moved, unchanged otherwise, into stdioEnvError, so that normalizeStdioEntry does not grow (CRAP gate).
  2. B. Case on Windows: withForwardedHostEnv (mcpServerManager.ts) drops a forwarded env_vars name whose envNameKey matches an env key. On Windows, TOKEN and token are one variable, so before this change both keys reached the env block. Now the env value wins, as the docs say. Elsewhere names stay case-sensitive.
  3. C. Loader list: LOADER_ENV_NAME (openaiMcpAuth.ts) adds BASH_ENV (stdio servers start through bash -c, which runs the file it names), plus LD_AUDIT, NODE_PATH and PYTHONPATH. ENV is not added: only interactive shells read it, and bash -c is not interactive. The "Plugin server environment" section of docs/config/mcp-servers.mdx now says that the review warns about these names and that Windows compares them without case.

Validation

  • Tests first. Both new tests failed before the fix: an = key loaded and the new loader names had no warning (mcpConfig.test.ts), and on win32 both case variants reached the env (mcpServerManager.test.ts).
  • mcpConfig, openaiMcpAuth and mcpServerManager suites: 443 pass. make typecheck, make static-check, MUX_ESLINT_CONCURRENCY=1 make lint-eslint and make crap-check pass.

Risks

Low. A plugin whose env has a key with = no longer loads that server. Such a key could not set a usable variable anyway.


Generated with xum • Model: anthropic:claude-opus-5-5 • Thinking: high

…iden the loader list

- normalizeStdioEntry refuses an env key with '=', as env_vars names do.
- On Windows, a forwarded env_vars name that matches an env key without
  case is dropped, so the configured value wins.
- The loader warning also names BASH_ENV, ENV, LD_AUDIT, NODE_PATH and
  PYTHONPATH. The docs say so.
@ThomasK33

Copy link
Copy Markdown
Member Author

@codex review

@mintlify

mintlify Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated
Mux 🟢 Ready View Preview Oct 15, 2026, 4:32 PM

💡 Tip: Enable Automations to automatically generate PRs for you.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-15T17:10:18.598194Z 1b6e065 Manual request
🔒 Security Review ✅ Completed 2026-10-15T17:11:20.431562Z 1b6e065 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review · Automatically triggered

Security review completed. No security issues were found in this pull request.

Reviewed commit: 664fac0d6b

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 664fac0d6b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/node/services/mcpServerManager.ts
Comment thread src/node/services/agentPlugins/mcpConfig.ts Outdated
Comment thread src/node/services/agentPlugins/openaiMcpAuth.ts Outdated
An empty env key would be an unnamed =value entry. Only interactive
shells read ENV, so it is dropped from the loader warning.
@ThomasK33

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. More of your lovely PRs please.

Reviewed commit: 1b6e065592

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review · Automatically triggered

Security review completed. No security issues were found in this pull request.

Reviewed commit: 1b6e065592

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@ThomasK33
ThomasK33 added this pull request to the merge queue Oct 15, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 15, 2026
@ThomasK33
ThomasK33 added this pull request to the merge queue Oct 15, 2026
Merged via the queue into main with commit e884522 Oct 15, 2026
34 checks passed
@ThomasK33
ThomasK33 deleted the fix/plugin-env-key-checks branch October 15, 2026 18:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🤖 fix: tighten plugin env key checks and the loader variable list

1 participant