Skip to content

Fix/6499 config overwrite on mcp install - #6527

Closed
myipanta wants to merge 1 commit into
esengine:main-v2from
myipanta:fix/6499-config-overwrite-on-mcp-install
Closed

Fix/6499 config overwrite on mcp install#6527
myipanta wants to merge 1 commit into
esengine:main-v2from
myipanta:fix/6499-config-overwrite-on-mcp-install

Conversation

@myipanta

@myipanta myipanta commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Summary

Verification

Cache impact

Cache-impact: none — config load path only, no prompt/tool/system-prefix changes
Cache-guard: go test ./internal/installsource/ -count=1 covers MCP install apply path
System-prompt-review: N/A

For cache-sensitive changes, fill these lines before requesting review:

  • Cache-impact: none, low, medium, or high, plus the reason.
  • Cache-guard: the focused guard test/command added or run, or why an existing guard covers the change.
  • System-prompt-review: required reviewer/approval note when provider-visible system prompt, memory prefix, output style, or skill index behavior changes.

@github-actions github-actions Bot added v2 Go rewrite (1.x) — main-v2 branch, active development desktop Wails desktop app (desktop/**) config Configuration & setup (internal/config) and removed v2 Go rewrite (1.x) — main-v2 branch, active development labels Jul 15, 2026
…fails (esengine#6499)

LoadForEdit silently falls back to config.Default() when the TOML file
cannot be parsed (corrupt, malformed, or a migration error). Callers
that mutate-then-save — notably applyInstallMCP — then persist this
empty default config via SaveTo, which does a full rewrite. All
provider keys, model settings, and other user configuration are lost.

Add LoadForEditSafe(path) (*Config, error) that propagates parse errors
when the file exists. When the file is absent (fresh start) it falls
back to defaults safely. Switch applyInstallMCP, applySkillRoot,
applyRemoveSkillRoot, and applyRemoveMCP to use the safe variant.

Update TestApplyMCPRollsBackOnSaveFailure to reflect the new fail-fast
behaviour: LoadForEditSafe rejects a directory path before connecting
any MCP server, so no disconnect rollback is needed.
@myipanta
myipanta force-pushed the fix/6499-config-overwrite-on-mcp-install branch from fc61a13 to b8194a6 Compare July 15, 2026 12:16
@github-actions github-actions Bot added the v2 Go rewrite (1.x) — main-v2 branch, active development label Jul 16, 2026
@SivanCola

SivanCola commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

Thanks for the fix. #6784 has now landed strict, no-write-on-parse-error handling for permission approval persistence. For the install_source / #6499 path covered here, #6505 is the broader implementation: it applies strict loading across MCP and skill install, remove, and uninstall paths, and includes wider regression coverage.

Closing this PR as superseded by #6505 so the remaining config-edit work can be reviewed in one place. Thank you @myipanta for identifying and implementing the fail-before-write approach.

@SivanCola SivanCola closed this Jul 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

config Configuration & setup (internal/config) desktop Wails desktop app (desktop/**) v2 Go rewrite (1.x) — main-v2 branch, active development

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants