[PR #6286] [CLOSED] feat(setup): add Trae CN client registration #7257

Closed
opened 2026-11-01 21:46:32 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/6286
Author: @aiblsse
Created: 10/22/2026
Status: ❌ Closed

Base: main ← Head: feat/trae-cn-client


📝 Commits (1)

  • a7a5dd4 feat(setup): add Trae CN client registration

📊 Changes

5 files changed (+105 additions, -0 deletions)

View changed files

📝 docs/client-configuration.md (+15 -0)
📝 docs/installation.md (+1 -0)
📝 src/application/SupportedClients.ts (+29 -0)
📝 tests/boundary/filesystem/clientLifecycle.test.ts (+1 -0)
📝 tests/boundary/filesystem/traeClientConfiguration.test.ts (+59 -0)

📄 Description

Summary

Trae CN (the China build of Trae) stores its VS Code-style user data under a
renamed directory ("Trae CN" / ".trae-cn"), so REA's existing trae client —
which hard-codes %APPDATA%\Trae\User and ~/.trae/skills — never matches it.
Setup therefore cannot register REA into Trae CN, and no skill copy is
installed for it.

This adds a separate trae_cn client so setup, doctor, and uninstall address
the correct paths, mirroring how REA already models other same-product variants
(e.g. Claude Code vs Claude Desktop).

Problem and expected behavior

  • Trigger: run rea setup on a host whose only Trae install is Trae CN.
  • Violated expectation: REA's client model assumes one data directory per
    product; Trae CN's renamed directory is invisible to the trae client.
  • New behavior: rea setup --client trae_cn writes mcpServers.rea into the
    Trae CN user mcp.json and installs the bundled skill under the renamed
    home root; rea doctor reports it aligned.

Change and scope

  • Add traeCnUserDirectory() in src/application/SupportedClients.ts and a new
    registry entry trae_cn (displayName: "Trae CN", format: "json",
    skillPath: [".trae-cn", "skills"]).
  • Paths: %APPDATA%\Trae CN\User\mcp.json (Windows),
    ~/Library/Application Support/Trae CN/User/mcp.json (macOS),
    ~/.config/Trae CN/User/mcp.json (Linux, XDG-overridable).
  • Deliberately not included: no change to the existing trae client, and no
    automatic fallback from trae to trae_cn (keeps the change purely
    additive and each product variant explicit).
  • Contribution scope: not applicable — additive client support, no target
    execution, injection, mutation, or protection-recovery behavior.

Contract and boundary impact

  • Semantic owner and earliest changed stage: client path resolution /
    registration (src/application/SupportedClients.ts).
  • Contribution scope fit and linked maintainer decision: not applicable.
  • CLI and MCP/tool-catalog contract: new --client trae_cn value; no tool
    contract change.
  • Provider, bridge, target-format, or platform compatibility: reuses the
    existing json registration dialect; no provider change.
  • Evidence, artifact, provenance, or reconstruction contract: none.
  • Target selection, authority, upstream behavior, and cleanup details: none.
  • Generated metadata (docs/public/product-catalog.json), package, or
    installation impact: catalog is regenerated by CI; authored docs updated in
    docs/installation.md and docs/client-configuration.md.

Expected effects:

  • Documentation or usability only; no target interaction.

Evidence and regression coverage

  • Tests added or updated: tests/boundary/filesystem/traeClientConfiguration.test.ts
    adds describe("Trae CN configuration paths") (per-platform config path,
    marker path, format, and skill destination); clientLifecycle.test.ts
    includes trae_cn in the detected-client list.
  • Base reproduction or other evidence: supportedClients() before this change
    has no trae_cn entry, so the new tests fail on the base revision.
  • User-visible CLI/MCP output: rea setup --client trae_cn --dry-run --json
    resolves configPath %APPDATA%\Trae CN\User\mcp.json,
    markerPath %APPDATA%\Trae CN\User, displayName Trae CN.
  • Remaining proof gaps: whether Trae CN actually consumes that user mcp.json
    is unverified (same caveat already recorded for the trae client).

Evidence-bearing change: not applicable.

Validation performed

  • npm ci — succeeded
  • npm run build:cached — 3 tasks successful
  • vitest run tests/boundary/filesystem/traeClientConfiguration.test.ts — 10/10 passed
  • vitest run tests/boundary/filesystem/clientLifecycle.test.ts — 51 passed, 1 skipped;
    two symlink cases (codex TOML config and cursor removal) fail on this Windows
    host on the base revision as well, independently of this change
  • node scripts/generate-product-catalog.mjs --check — exit 0
  • node scripts/check-doc-facts.mjs — exit 0
  • oxfmt --check and oxlint on changed files — clean
  • rea setup --client trae_cn --dry-run --json — resolves the Trae CN paths above

Compatibility, safety, and release

  • Breaking changes or migration steps: none; purely additive.
  • Real Hopper/Ghidra, browser, or OS coverage: not applicable (not a
    provider/analysis change).
  • Package or release metadata impact: none (generated catalogs are CI-owned).
  • Security, privacy, process, or containment review: none.

Author readiness

Human owner: @aiblsse

  • 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.
  • 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.
  • 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.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/morluto/rea/pull/6286 **Author:** [@aiblsse](https://github.com/aiblsse) **Created:** 10/22/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `feat/trae-cn-client` --- ### 📝 Commits (1) - [`a7a5dd4`](https://github.com/morluto/rea/commit/a7a5dd42c6ea3ee0d7ee3e24aade979649835b8b) feat(setup): add Trae CN client registration ### 📊 Changes **5 files changed** (+105 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `docs/client-configuration.md` (+15 -0) 📝 `docs/installation.md` (+1 -0) 📝 `src/application/SupportedClients.ts` (+29 -0) 📝 `tests/boundary/filesystem/clientLifecycle.test.ts` (+1 -0) 📝 `tests/boundary/filesystem/traeClientConfiguration.test.ts` (+59 -0) </details> ### 📄 Description ## Summary Trae CN (the China build of Trae) stores its VS Code-style user data under a renamed directory ("Trae CN" / ".trae-cn"), so REA's existing `trae` client — which hard-codes `%APPDATA%\Trae\User` and `~/.trae/skills` — never matches it. Setup therefore cannot register REA into Trae CN, and no skill copy is installed for it. This adds a separate `trae_cn` client so setup, doctor, and uninstall address the correct paths, mirroring how REA already models other same-product variants (e.g. Claude Code vs Claude Desktop). ## Problem and expected behavior - Trigger: run `rea setup` on a host whose only Trae install is Trae CN. - Violated expectation: REA's client model assumes one data directory per product; Trae CN's renamed directory is invisible to the `trae` client. - New behavior: `rea setup --client trae_cn` writes `mcpServers.rea` into the Trae CN user `mcp.json` and installs the bundled skill under the renamed home root; `rea doctor` reports it aligned. ## Change and scope - Add `traeCnUserDirectory()` in `src/application/SupportedClients.ts` and a new registry entry `trae_cn` (`displayName: "Trae CN"`, `format: "json"`, `skillPath: [".trae-cn", "skills"]`). - Paths: `%APPDATA%\Trae CN\User\mcp.json` (Windows), `~/Library/Application Support/Trae CN/User/mcp.json` (macOS), `~/.config/Trae CN/User/mcp.json` (Linux, XDG-overridable). - Deliberately not included: no change to the existing `trae` client, and no automatic fallback from `trae` to `trae_cn` (keeps the change purely additive and each product variant explicit). - Contribution scope: `not applicable` — additive client support, no target execution, injection, mutation, or protection-recovery behavior. ## Contract and boundary impact - Semantic owner and earliest changed stage: client path resolution / registration (`src/application/SupportedClients.ts`). - Contribution scope fit and linked maintainer decision: not applicable. - CLI and MCP/tool-catalog contract: new `--client trae_cn` value; no tool contract change. - Provider, bridge, target-format, or platform compatibility: reuses the existing `json` registration dialect; no provider change. - Evidence, artifact, provenance, or reconstruction contract: none. - Target selection, authority, upstream behavior, and cleanup details: none. - Generated metadata (`docs/public/product-catalog.json`), package, or installation impact: catalog is regenerated by CI; authored docs updated in `docs/installation.md` and `docs/client-configuration.md`. Expected effects: - [x] Documentation or usability only; no target interaction. ## Evidence and regression coverage - Tests added or updated: `tests/boundary/filesystem/traeClientConfiguration.test.ts` adds `describe("Trae CN configuration paths")` (per-platform config path, marker path, `format`, and skill destination); `clientLifecycle.test.ts` includes `trae_cn` in the detected-client list. - Base reproduction or other evidence: `supportedClients()` before this change has no `trae_cn` entry, so the new tests fail on the base revision. - User-visible CLI/MCP output: `rea setup --client trae_cn --dry-run --json` resolves `configPath` `%APPDATA%\Trae CN\User\mcp.json`, `markerPath` `%APPDATA%\Trae CN\User`, `displayName` `Trae CN`. - Remaining proof gaps: whether Trae CN actually consumes that user `mcp.json` is unverified (same caveat already recorded for the `trae` client). Evidence-bearing change: not applicable. ## Validation performed - `npm ci` — succeeded - `npm run build:cached` — 3 tasks successful - `vitest run tests/boundary/filesystem/traeClientConfiguration.test.ts` — 10/10 passed - `vitest run tests/boundary/filesystem/clientLifecycle.test.ts` — 51 passed, 1 skipped; two symlink cases (codex TOML config and cursor removal) fail on this Windows host on the base revision as well, independently of this change - `node scripts/generate-product-catalog.mjs --check` — exit 0 - `node scripts/check-doc-facts.mjs` — exit 0 - `oxfmt --check` and `oxlint` on changed files — clean - `rea setup --client trae_cn --dry-run --json` — resolves the Trae CN paths above ## Compatibility, safety, and release - Breaking changes or migration steps: none; purely additive. - Real Hopper/Ghidra, browser, or OS coverage: not applicable (not a provider/analysis change). - Package or release metadata impact: none (generated catalogs are CI-owned). - Security, privacy, process, or containment review: none. ## Author readiness Human owner: @aiblsse - [x] 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. - [x] I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps. - [x] I declare this PR ready for initial maintainer review. ## Before merge - [x] This PR addresses a concrete problem or an agreed enhancement. - [ ] Material scope and authority questions are resolved. - [x] The PR has one focused outcome and the title follows `type(scope): outcome`. - [x] Related issue is linked, or the reason for not linking one is stated. - [x] Tests cover changed observable behavior and meaningful failure paths. - [x] Owning docs, contracts, and generated metadata are updated where needed. - [x] User-visible CLI/MCP changes include representative output. - [x] I checked the final diff for secrets, unrelated cleanup, and unsupported claims. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-01 21:46:32 +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#7257
No description provided.