Skip to content

Fix #1282: Prevent local .env from overriding global config in global mode#1283

Open
sivaangayarkanni wants to merge 1 commit into
CodeGraphContext:mainfrom
sivaangayarkanni:main
Open

Fix #1282: Prevent local .env from overriding global config in global mode#1283
sivaangayarkanni wants to merge 1 commit into
CodeGraphContext:mainfrom
sivaangayarkanni:main

Conversation

@sivaangayarkanni

@sivaangayarkanni sivaangayarkanni commented Jun 18, 2026

Copy link
Copy Markdown

Changes

This PR fixes issue #1282 where local .codegraphcontext/.env files incorrectly override global configuration in global/named context modes.

What Changed

  • Modified load_config() in config_manager.py to respect context mode
  • Added protection for DB_PATH_ENV_KEYS to prevent database path corruption
  • Local .env files now only load in per-repo mode (or with CGC_LOAD_PROJECT_ENV=1)
  • Added comprehensive unit tests in test_bug001_config_override.py
  • Fixed VS Code extension warnings (removed deprecated activationEvents, added view icons)

Testing

  • ✅ Global mode ignores local .env
  • ✅ Per-repo mode uses local .env
  • ✅ Environment variables override everything
  • ✅ DB path keys are protected from override
  • ✅ All existing tests pass

Impact

  • Users in global/named mode are now protected from config hijacking
  • Per-repo mode continues to work as intended
  • Database integrity is protected
  • E2E tests will now pass

Closes #1282

@vercel

vercel Bot commented Jun 18, 2026

Copy link
Copy Markdown

@sivaangayarkanni is attempting to deploy a commit to the shashankss1205's projects Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog tasks

Development

Successfully merging this pull request may close these issues.

BUG: Local .env overrides global config in global mode (BUG-001)

1 participant