Skip to content

fix(setup): register Amp in settings.jsonc when that is its settings file - #10717

Merged
morluto merged 1 commit into
refactor/fold-mcp-add-clientsfrom
fix/amp-settings-jsonc
Nov 15, 2026
Merged

morluto merged 1 commit into
refactor/fold-mcp-add-clientsfrom
fix/amp-settings-jsonc

Conversation

@morluto

@morluto morluto commented Nov 15, 2026

Copy link
Copy Markdown
Owner

Summary

Amp reads ~/.config/amp/settings.json or settings.jsonc (Amp settings docs). REA always used settings.json, which created a second file beside an existing settings.jsonc. REA now uses settings.jsonc when it is Amp's only settings file. When both exist it refuses, because Amp does not document which one it reads.

Stacked on #10694 (the Amp row). Refs #7181.

Problem and expected behavior

Trigger: only ~/.config/amp/settings.jsonc exists, and you run rea mcp add --agent amp or rea setup --client amp. REA created settings.json. Whether Amp then reads that new file is undocumented. Expected: write the file Amp already uses, and do not guess when the choice is unknown.

Change and scope

  • SupportedClients.ts: Amp's row resolves its location by probing both names.
    • One file exists: use it.
    • Neither exists: create settings.json.
    • Both exist, or a probe fails: configPathError.
  • Setup, doctor, update, uninstall and mcp add all take the path from this row.
  • Not included: --settings-file, which REA cannot observe. Workspace .amp/settings.json[c] files are also out of scope (mcp add stays global-only for Amp).

Contract and boundary impact

  • Semantic owner and earliest changed stage: the Amp row's location.

  • Contribution scope fit and linked maintainer decision: coordinator request ("fix the Amp settings.jsonc gap").

  • CLI and MCP/tool-catalog contract: config_path can now be settings.jsonc. With both files present, Amp registration fails with a remediation. This includes mcp add's default selection, which always includes Amp.

  • Provider, bridge, target-format, or platform compatibility: none.

  • Evidence, artifact, provenance, or reconstruction contract: none.

  • Target selection, authority, upstream behavior, and cleanup details: no new write locations beyond the file Amp already uses.

  • Generated metadata, package, or installation impact: none.

  • Read existing files or captured data.

  • Launch or attach to a process.

  • Inject instrumentation or run scripts/code.

  • Change process memory, registers, files, or configuration.

  • Contact network services.

  • Recover protected code or work around protections.

  • Documentation or usability only; no target interaction.

  • Not sure yet; investigation or maintainer guidance needed.

Evidence and regression coverage

  • Tests added: a new case in tests/boundary/filesystem/mcpAddClientLifecycle.test.ts. With only settings.jsonc present, mcp add selects and writes it and keeps its // keep comment. After settings.json is added, the row reports configPathError and mcp add refuses.
  • Base reproduction: on the base, the selected path is settings.json, so the first assertion fails.
  • Remaining proof gaps: no installed Amp was run. Amp is closed source.

Validation performed

  • npm run test:focused -- tests/boundary/filesystem/mcpAddClientLifecycle.test.ts tests/boundary/cli/defaultAmpRegistration.test.ts tests/boundary/cli/ampRegistrationPreservation.test.ts — 17 passed.
  • npm run check:fast — passed (pre-push hook).
  • npm run docs:check — passed.

Compatibility, safety, and release

  • Breaking changes or migration steps: none. Users with both files must merge them before REA writes Amp.
  • Real Hopper/Ghidra, browser, or OS coverage: macOS filesystem tests.
  • Package or release metadata impact: none.
  • Security, privacy, process, or containment review: none.

Author readiness

Human owner:

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

Before merge

  • This PR addresses a concrete problem or an agreed enhancement.
  • Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff.
  • The PR has one focused outcome and the title follows type(scope): outcome.
  • Related issue is linked, or the reason for not linking one is stated above.
  • Tests cover changed observable behavior and meaningful failure paths.
  • Owning docs, contracts, and generated metadata are updated where needed.
  • User-visible CLI/MCP changes include representative output.
  • I checked the final diff for secrets, unrelated cleanup, and unsupported claims.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-15T01:47:19.780932Z 4142bf2 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@greptile-apps

greptile-apps Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no blocking issue was found.

Summary

Amp now uses an existing settings.jsonc instead of creating a second settings file.

  • Amp registration uses its only existing settings file.

No actionable issues were found. Tests were inspected but not run. Checking for a superseding PR was blocked by unavailable GitHub authentication; the supplied stack contains no higher dependent PR.

Reviews (2) · Last reviewed commit: "fix(setup): register Amp in settings.jso..." · Reviewed by Greptile

@morluto
morluto force-pushed the fix/amp-settings-jsonc branch from cef0eb4 to fdac7d9 Compare November 15, 2026 01:16
…file

Amp reads ~/.config/amp/settings.json or settings.jsonc. REA always
used settings.json, creating a second file beside an existing
settings.jsonc. Use settings.jsonc when it is the only file, and refuse
when both exist because Amp does not document which one it reads.
@morluto
morluto force-pushed the fix/amp-settings-jsonc branch from fdac7d9 to 4142bf2 Compare November 15, 2026 01:45
@morluto
morluto merged commit e00a1c5 into refactor/fold-mcp-add-clients Nov 15, 2026
@morluto
morluto deleted the fix/amp-settings-jsonc branch November 15, 2026 02:18
morluto added a commit that referenced this pull request Nov 15, 2026
…10694)

* feat(setup): give five mcp-add clients one client-table row

Cline VS Code extension, Kiro, Mastra Code, Zed and Amp move from
registration-only catalog entries to rows in the client table. rea mcp add
projects those rows, so doctor, update and uninstall now inspect, refresh
and remove what it wrote, and setup offers each client when detected.

Refs #7181

* refactor(setup): keep FreeBuff's comment on its declaration

The client helpers added for the folded mcp-add clients were inserted
between FreeBuff's profile-directory comment and its declaration. Move
them above it, and drop an import the folded locations no longer use.

* test(setup): refresh an older mcp-add registration through setup

Address review: seed each folded client with an older REA-owned package
runner launcher, then check that doctor reports it stale, update selects
it, setup plans and applies the update, and doctor then reads the
current launcher.

* fix(setup): register Amp in settings.jsonc when that is its settings file (#10717)

Amp reads ~/.config/amp/settings.json or settings.jsonc. REA always
used settings.json, creating a second file beside an existing
settings.jsonc. Use settings.jsonc when it is the only file, and refuse
when both exist because Amp does not document which one it reads.

* feat(setup): manage Cline in VS Code Insiders, VSCodium, Cursor and Windsurf (#10729)

* feat(setup): manage Cline in VS Code Insiders, VSCodium, Cursor and Windsurf

The Cline extension keeps its MCP settings in the global storage of
whichever editor runs it. REA resolved only VS Code's, so a Cline in
another editor was never configured, inspected or cleaned. Add one
client-table row per editor, resolved through the shared Code-OSS user
data rule, and detected where that editor's Cline settings exist.

* test(setup): cover VSCODE_PORTABLE for Cline's editor hosts

Address review: VSCODE_PORTABLE moves only VS Code's own storage, so the other editors keep their settings path; and the older-release note now says which hosts mcp add could register before.

* fix(setup): find a Linux Flatpak Zed's configuration (#10721)

* fix(setup): find a Linux Flatpak Zed's configuration

Zed's config_dir honors FLATPAK_XDG_CONFIG_HOME first, and a Flathub Zed
reads ~/.var/app/dev.zed.Zed/config/zed inside its sandbox. REA always
wrote ~/.config/zed, which that Zed never reads. Honor the override, use
the sandbox folder when it is the only one, and refuse when both a
native and a Flatpak configuration exist.

* fix(setup): treat an XDG_CONFIG_HOME naming the Flatpak folder as one Zed folder

* fix(setup): treat linked native and Flatpak Zed folders as one configuration

* test(setup): expect doctor to report the Amp registration mcp add wrote
@morluto morluto added area: setup Setup, packaging, upgrade, install, Doctor, and client registration bug Something isn't working labels Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: setup Setup, packaging, upgrade, install, Doctor, and client registration bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant