[PR #3123] [CLOSED] fix(clients): report the active ZCode fallback registration in status #5633

Closed
opened 2026-10-31 01:08:08 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/3123
Author: @IvenKooLab
Created: 10/14/2026
Status: ❌ Closed

Base: main ← Head: fix/zcode-fallback-status


📝 Commits (2)

  • 6dd7ce5 fix(clients): report the active ZCode fallback registration in status
  • bbcaa98 fix(clients): distinguish an unreadable ZCode fallback from an absent one

📊 Changes

3 files changed (+212 additions, -35 deletions)

View changed files

📝 src/application/ClientRegistrationStatus.ts (+74 -34)
📝 tests/boundary/filesystem/zcodeClientConfiguration.test.ts (+121 -1)
📝 tests/process-global/updateMaintenance.test.ts (+17 -0)

📄 Description

Summary

rea doctor and the update maintenance scope now report the ZCode registration that ~/.agents/mcp.json provides while the native mcp.servers table is empty, instead of reporting ZCode as missing.

Problem and expected behavior

ZCode loads the user-scope ~/.agents/mcp.json mcpServers fallback whenever its native mcp.servers table is empty — the same premise #2664 fixed for uninstall (ff56f7859), which visits the fallback as a zcode_fallback configuration. The registration status still read only the native file:

  • With ~/.zcode/cli present, an empty or missing native config, and an rea entry in the fallback, ZCode actively loads that registration while rea doctor reports ZCode as missing ("Run rea setup…").
  • existingMaintenanceScope selects only aligned/stale clients, so rea update never refreshed such a registration — a pinned rea-agents@<old> fallback entry kept launching with no remediation path, and neither doctor nor update ever surfaced the drift.

The status now substitutes the fallback as a zcode_fallback configuration when the native table is empty and the fallback exists, reusing the whole status pipeline (command ownership, activation, package drift, policy) and reporting the fallback as the config_path. A nonempty native table keeps suppressing the fallback in status exactly as ZCode itself does, and a malformed or unreadable fallback fails closed as invalid, matching setup admission.

Validation

  • zcodeClientConfiguration.test.ts 28/28 — four new cases: aligned fallback-only registration, stale package drift, malformed fallback, native-suppressed fallback
  • updateMaintenance.test.ts maintenance-activation describe 3/3 — new: a fallback-only registration enters the update maintenance scope
  • clientRegistrationStatus / clientLifecycle / setupClientConfigCleanupOwnership / layered-environment suites 106/106
  • tsc --noEmit clean, prettier --check clean, repo pre-commit (oxfmt/oxlint) passed

🔄 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/3123 **Author:** [@IvenKooLab](https://github.com/IvenKooLab) **Created:** 10/14/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/zcode-fallback-status` --- ### 📝 Commits (2) - [`6dd7ce5`](https://github.com/morluto/rea/commit/6dd7ce589c5817b118a10b9bed8a2c7ae9c817a0) fix(clients): report the active ZCode fallback registration in status - [`bbcaa98`](https://github.com/morluto/rea/commit/bbcaa987cbba40c94c6330cad2a9ca5dedf828ea) fix(clients): distinguish an unreadable ZCode fallback from an absent one ### 📊 Changes **3 files changed** (+212 additions, -35 deletions) <details> <summary>View changed files</summary> 📝 `src/application/ClientRegistrationStatus.ts` (+74 -34) 📝 `tests/boundary/filesystem/zcodeClientConfiguration.test.ts` (+121 -1) 📝 `tests/process-global/updateMaintenance.test.ts` (+17 -0) </details> ### 📄 Description ## Summary `rea doctor` and the update maintenance scope now report the ZCode registration that `~/.agents/mcp.json` provides while the native `mcp.servers` table is empty, instead of reporting ZCode as missing. ## Problem and expected behavior ZCode loads the user-scope `~/.agents/mcp.json` `mcpServers` fallback whenever its native `mcp.servers` table is empty — the same premise #2664 fixed for uninstall (ff56f7859), which visits the fallback as a `zcode_fallback` configuration. The registration status still read only the native file: - With `~/.zcode/cli` present, an empty or missing native config, and an `rea` entry in the fallback, ZCode actively loads that registration while `rea doctor` reports ZCode as `missing` ("Run rea setup…"). - `existingMaintenanceScope` selects only `aligned`/`stale` clients, so `rea update` never refreshed such a registration — a pinned `rea-agents@<old>` fallback entry kept launching with no remediation path, and neither doctor nor update ever surfaced the drift. The status now substitutes the fallback as a `zcode_fallback` configuration when the native table is empty and the fallback exists, reusing the whole status pipeline (command ownership, activation, package drift, policy) and reporting the fallback as the `config_path`. A nonempty native table keeps suppressing the fallback in status exactly as ZCode itself does, and a malformed or unreadable fallback fails closed as `invalid`, matching setup admission. ## Validation - `zcodeClientConfiguration.test.ts` 28/28 — four new cases: aligned fallback-only registration, stale package drift, malformed fallback, native-suppressed fallback - `updateMaintenance.test.ts` maintenance-activation describe 3/3 — new: a fallback-only registration enters the update maintenance scope - `clientRegistrationStatus` / `clientLifecycle` / `setupClientConfigCleanupOwnership` / layered-environment suites 106/106 - `tsc --noEmit` clean, `prettier --check` clean, repo pre-commit (oxfmt/oxlint) passed --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-31 01:08:08 +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#5633
No description provided.