Skip to content

Load startup credentials without Bash - #280

Merged
Eli Pinkerton (wallstop) merged 1 commit into
refactor/python-mcp-doctorfrom
refactor/python-env-loading
Oct 18, 2026
Merged

Eli Pinkerton (wallstop) merged 1 commit into
refactor/python-mcp-doctorfrom
refactor/python-env-loading

Conversation

@wallstop

@wallstop Eli Pinkerton (wallstop) commented Oct 18, 2026 •

Copy link
Copy Markdown
Collaborator

DISCLOSURE: LLM-GENERATED TEXT

Why: Python startup tools spawn Bash to read credentials, while launchers duplicate parsing.

What:

  • Share one typed loader across startup, launchers, and service checks.
  • Preserve literal values and file precedence for managed credentials.
  • Keep the sourced loader for parent-shell exports.

Refs #171.


Note

Medium Risk
Changes how devcontainer startup and OpenCode recycling load secrets and replaces the MCP connectivity doctor; mistakes could leave stale credentials or mis-report MCP health, though contract tests cover precedence and repair behavior.

Overview
Introduces .devcontainer/env_local.py as the single typed .env.local parser for Python tooling, replacing duplicated inline parsing and Bash subprocess loaders in ai_backends.py, post_start.py, and recycle_stale_opencode_service.py. Startup and service recycling now merge credentials in-process while preserving literal values, BOM/CRLF handling, and file precedence for managed MCP credential names; interactive shells still source env-local.sh, with parity enforced in test_env_local_precedence.py.

scripts/mcp_doctor.py replaces the large Node implementation; npm run mcp:doctor / mcp:repair call it directly and .llm/mcp/mcp-doctor.mjs remains a thin uv wrapper for legacy entry points. Shared HTTP helpers stop forwarding Authorization on redirects.

Alongside issue #171, the diff repoints install, docs, and package metadata from wallstop/DataVisualizer to Ambiguous-Interactive/DxVisualizer (including npm trusted-publisher notes and release identity tests).

Reviewed by Cursor Bugbot for commit 9f2229d. Bugbot is set up for automated code reviews on this repo. Configure here.

Python startup and service checks still spawned Bash to parse environment files, while backend launchers duplicated the parser. Share one typed loader across those callers. Keep the sourced shell loader for parent-shell exports and retain process signalling behavior.

Preserve literal values, BOM/CRLF, export prefixes, quotes, duplicate-key ordering, and credential-only file precedence. Shell-equivalence and direct cases pass, including loading with Bash absent and unreadable file evidence that cannot recycle a service. Strict pyright, nine selected fast-check suites, and the scoped 11-step gate pass. The packaged payload and Unity source are unchanged from main, validated earlier in this goal session.

Nine interleaved local environment-loading samples measured median 7.509 ms through Bash and 0.201 ms through Python. This is a focused loading-step measurement, not an end-to-end startup or CI claim. Refs #171.
@wallstop
Eli Pinkerton (wallstop) changed the base branch from main to refactor/python-mcp-doctor October 18, 2026 03:15
@wallstop
Eli Pinkerton (wallstop) added this pull request to stack #282 October 18, 2026 03:15
@wallstop
Eli Pinkerton (wallstop) merged commit b875fab into main Oct 18, 2026
5 checks passed
@wallstop
Eli Pinkerton (wallstop) deleted the refactor/python-env-loading branch October 18, 2026 03:22
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.

1 participant