Skip to content

Report failed MCP config writes - #286

Merged
Eli Pinkerton (wallstop) merged 2 commits into
migrate/codex-mcp-writerfrom
fix/mcp-sync-exit-status
Oct 18, 2026
Merged

Eli Pinkerton (wallstop) merged 2 commits into
migrate/codex-mcp-writerfrom
fix/mcp-sync-exit-status

Conversation

@wallstop

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

Copy link
Copy Markdown
Collaborator

DISCLOSURE: LLM-GENERATED TEXT

Why: Sync reports success when frontend config writes fail.

What:

  • Return nonzero after a required frontend write fails.
  • Continue configuring other frontends and report each failure.
  • Cover blocked outputs, dry runs, and unchanged syncs.

Fixes #285.


Note

Medium Risk
Changes devcontainer credential loading and Codex/MCP config write paths; behavior is contract-tested but affects agent startup and sync exit codes.

Overview
MCP sync now fails honestly when a frontend write errors: configure.mjs catches per-frontend failures, prints labeled ❌ lines, still runs the rest of the plan, and sets exit code 1 if anything failed (fixes #285).

Codex persistence moves out of Node into scripts/mcp_codex_config.py, which configure.mjs invokes via uv or a Python 3.9+ fallback for managed $CODEX_HOME/config.toml writes and workspace .codex pruning.

.env.local in Bash no longer parses the file inline: load_env_local in env-local.sh runs env_local.py (NUL-delimited records), applies exports atomically on success, keeps literal values (no command substitution), and preserves unexported shell variables and existing precedence rules.

Harness scope and contract tests cover Codex config, sync exit behavior, and the shell adapter.

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

Automation cannot detect incomplete configuration because the configurator prints write errors and exits zero. Record any failed frontend write and set a nonzero exit status after attempting the other frontends.

The blocked-output regression first reproduced the zero exit on main. Ten data-driven paths now prove failed-status forwarding, frontend diagnostics, continued independent writes, directory retention, and read-only dry runs. Successful and unchanged syncs still return zero.

Validation: all 42 harness test files, strict pyright, check:fast, check:gate, and npm payload preview pass. Unity 6000.5.2f1 Windows passes 393 EditMode and 15 PlayMode tests. Fixes #285.
The stacked Codex Python writer invokes uv during check-only sync. Disable uv caching inside the isolated sync sandbox so its filesystem assertion measures configuration writes instead of interpreter discovery caches. All sync contracts pass on the combined lower layers. Refs #285 and #171.
@wallstop
Eli Pinkerton (wallstop) changed the base branch from main to migrate/codex-mcp-writer October 18, 2026 05:59
@wallstop
Eli Pinkerton (wallstop) added this pull request to stack #291 October 18, 2026 05:59
@wallstop
Eli Pinkerton (wallstop) merged commit e0ce4e3 into main Oct 18, 2026
3 checks passed
@wallstop
Eli Pinkerton (wallstop) deleted the fix/mcp-sync-exit-status branch October 18, 2026 06:09
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.

Return failure when MCP config writes fail

1 participant