[GH-ISSUE #1606] [Bug] setup deletes configured MCP schema profile and adapter settings #543

Closed
opened 2026-10-15 18:26:00 +00:00 by bsakaguchi · 0 comments
Owner

Originally created by @Adkid-Zephyr on GitHub (Oct 10, 2026).
Original GitHub issue: https://github.com/morluto/rea/issues/1606

Before submitting

  • Searched open/closed issues and competing PRs.
  • Used synthetic configuration only; no private paths, credentials, or target data below.

Area / interface / earliest failure stage

Setup and agent integration / CLI setup / configuration writing.

Observed behavior

rea setup replaces an existing REA server entry using only the provider environment discovered by setup. Valid environment overrides already stored in that entry disappear, including REA_MCP_INPUT_SCHEMA_PROFILE=compact, REA_MCP_MAX_RESPONSE_BYTES, and optional adapter executable paths. Setup still reports ready.

Reproduction

  1. In an isolated home, create .pi/agent/mcp.json:
    {"mcpServers":{"rea":{"type":"stdio","command":"npx","args":["-y","rea-agents@1.0.0","mcp"],"env":{"REA_MCP_INPUT_SCHEMA_PROFILE":"compact","REA_LOG_LEVEL":"silent"}}}}
    
    The old version is just a migration fixture; it is never invoked.
  2. Run the built current checkout: node scripts/rea.mjs setup --client pi --skill=false --yes --json, with HOME/USERPROFILE set to that temporary home.
  3. The resulting registration loses the two environment entries. Launch the command that setup wrote and request tools/list over stdio MCP: four input schemas exceed the compact profile's 13,312-byte budget.

Expected behavior

Keep valid per-server environment overrides when migrating the launcher or updating provider settings. Newly discovered provider values should replace matching keys without deleting independent settings. Repeated setup should leave the configuration unchanged.

Impact and scope

The shared writer affects JSON, TOML, OpenCode's environment field, and Hermes YAML registrations. This can undo a required schema-compatibility setting: #1484/#1514 documented complete request rejection in Moonshot-backed clients with the full catalog. The local reproduction confirms configuration loss and oversized advertisement; it does not repeat a paid model request or claim a fresh real-provider test. Optional adapter paths and response-budget overrides are also lost.

Version / runtime / target

Source 603d04ee3ac6ed496f84478164f832a9b5ce3b91; Node 24.18.0, npm 11.16.0, macOS arm64. Synthetic MCP registration, no analysis target.

Evidence and proposed correction

Before changing production code, four filesystem regressions failed on lost environment values and the public CLI/stdio-MCP regression failed on the oversized schemas. Preserve the existing dialect's string environment map, merge detected provider values over it, and use the same desired registration for inspection, alignment, writing and readback. Include OpenCode V1-to-V2 migration and idempotence coverage.

Disclosure: investigated and prepared with OpenAI Codex assistance.

Originally created by @Adkid-Zephyr on GitHub (Oct 10, 2026). Original GitHub issue: https://github.com/morluto/rea/issues/1606 ### Before submitting - [x] Searched open/closed issues and competing PRs. - [x] Used synthetic configuration only; no private paths, credentials, or target data below. ### Area / interface / earliest failure stage Setup and agent integration / CLI setup / configuration writing. ### Observed behavior `rea setup` replaces an existing REA server entry using only the provider environment discovered by setup. Valid environment overrides already stored in that entry disappear, including `REA_MCP_INPUT_SCHEMA_PROFILE=compact`, `REA_MCP_MAX_RESPONSE_BYTES`, and optional adapter executable paths. Setup still reports `ready`. ### Reproduction 1. In an isolated home, create `.pi/agent/mcp.json`: ```json {"mcpServers":{"rea":{"type":"stdio","command":"npx","args":["-y","rea-agents@1.0.0","mcp"],"env":{"REA_MCP_INPUT_SCHEMA_PROFILE":"compact","REA_LOG_LEVEL":"silent"}}}} ``` The old version is just a migration fixture; it is never invoked. 2. Run the built current checkout: `node scripts/rea.mjs setup --client pi --skill=false --yes --json`, with `HOME`/`USERPROFILE` set to that temporary home. 3. The resulting registration loses the two environment entries. Launch the command that setup wrote and request `tools/list` over stdio MCP: four input schemas exceed the compact profile's 13,312-byte budget. ### Expected behavior Keep valid per-server environment overrides when migrating the launcher or updating provider settings. Newly discovered provider values should replace matching keys without deleting independent settings. Repeated setup should leave the configuration unchanged. ### Impact and scope The shared writer affects JSON, TOML, OpenCode's `environment` field, and Hermes YAML registrations. This can undo a required schema-compatibility setting: #1484/#1514 documented complete request rejection in Moonshot-backed clients with the full catalog. The local reproduction confirms configuration loss and oversized advertisement; it does **not** repeat a paid model request or claim a fresh real-provider test. Optional adapter paths and response-budget overrides are also lost. ### Version / runtime / target Source `603d04ee3ac6ed496f84478164f832a9b5ce3b91`; Node 24.18.0, npm 11.16.0, macOS arm64. Synthetic MCP registration, no analysis target. ### Evidence and proposed correction Before changing production code, four filesystem regressions failed on lost environment values and the public CLI/stdio-MCP regression failed on the oversized schemas. Preserve the existing dialect's string environment map, merge detected provider values over it, and use the same desired registration for inspection, alignment, writing and readback. Include OpenCode V1-to-V2 migration and idempotence coverage. Disclosure: investigated and prepared with OpenAI Codex assistance.
bsakaguchi 2026-10-15 18:26:00 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#543
No description provided.