Repository navigation
Load shell credentials through Python - #283
Merged
Merged
Conversation
Interactive shells still duplicate the environment parser in Bash. Use the shared typed Python parser through uv and keep a small adapter for parent-shell exports. Preserve literal values, file selection, duplicate keys, credential precedence, and unexported shell values. Buffer exports until parsing completes. Make loader failure assertions explicit. Validation: strict pyright passes for both Python files. All 42 harness suites and check:gate pass; npm pack dry run passes. Unity 6000.5.2f1 on Windows passes 393 EditMode and 15 PlayMode tests. The config generator and HTTP bridge remain in Node. Refs #171.
This was referenced Oct 18, 2026
Eli Pinkerton (wallstop)
added this pull request to stack #291
October 18, 2026 05:59
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
DISCLOSURE: LLM-GENERATED TEXT
Why: Interactive shells duplicate the environment parser in Bash.
What:
Refs #171.
Note
Medium Risk
Changes how MCP credentials and other env vars are loaded in every interactive shell; mistakes could break agent CLIs or credential rotation without a rebuild, though behavior is heavily contract-tested.
Overview
Replaces inline Bash parsing of
.env.localwith the shared Python loader invoked viauv run, so interactive shells use the same precedence and literal-value rules asload_environmentin Python startup paths (issue #171).load_env_localinenv-local.shnow streams NUL-delimited key/value/overwrite records fromenv_local.py, skips exports when a non-empty shell value should win (including unexported locals the child cannot see), and applies all exports only after a successful parse—failures return 1 with no partial updates.env_local.pygainsloaded_assignmentsand a small CLImain()that builds the full payload before writing (no shell injection from command substitutions in values).Tests pin
DATAVIZ_ENV_UV, treat loader failures explicitly, and add shell-adapter cases for literals, atomic failure on bad input/missinguv, file path selection, and MCP credential rotation underDATAVIZ_ENV_LOCAL_PRECEDENCE=file.Reviewed by Cursor Bugbot for commit 4c13bc8. Bugbot is set up for automated code reviews on this repo. Configure here.