Skip to content

Conversation

@dphuang2
Copy link
Collaborator

@dphuang2 dphuang2 commented Jan 14, 2026

  • improving environment variable management and preventing conflicts with other .env files.

Note

Standardizes environment loading to avoid accidental parent .env usage.

  • CLI: In eval_protocol/cli.py, replace implicit load_dotenv() with explicit paths to .env.dev and .env using dotenv_path, preserving override=True.
  • Vercel API: In quickstart/svg_agent/vercel_svg_server/api/init.py, switch to load_dotenv(dotenv_path=Path('.') / '.env').
  • MCP client: Remove .env auto-loading from eval_protocol/mcp/mcp_multi_client.py.
  • Tests: Add tests/test_no_implicit_dotenv.py to AST-scan repo code and fail CI if any load_dotenv() call lacks an explicit dotenv_path.

Written by Cursor Bugbot for commit 432a649. This will update automatically on new commits. Configure here.

- improving environment variable management and preventing conflicts with other .env files.
@dphuang2 dphuang2 requested a review from xzrderek January 14, 2026 20:20
parameters: Any = None


from dotenv import load_dotenv
Copy link

Choose a reason for hiding this comment

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

Environment loading removed instead of using explicit path

Medium Severity

The load_dotenv() call was removed entirely from mcp_multi_client.py instead of being replaced with an explicit path like in other files (cli.py, init.py). When MCPMultiClient is used directly (not through the CLI), environment variables from .env files will no longer be loaded. The class still validates that required environment variables exist in _validate_environment_variables(), so this change breaks standalone usage of the module and is inconsistent with the pattern used in other files in this PR.

Fix in Cursor Fix in Web

@dphuang2 dphuang2 merged commit fd632b7 into main Jan 14, 2026
17 checks passed
@dphuang2 dphuang2 deleted the ensure-explicit-dotenv branch January 14, 2026 21:06
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.

3 participants