fix(setup): drop non-boolean activation switches from retained entries
A string such as enabled: "false" was kept and then accepted as the desired entry, so setup could report success while doctor rejected the registration. Those values are removed with the other managed switches.
This commit is contained in:
committed by
xeropresence
parent
53ba7e7b31
commit
ff34e7aeff
@@ -1533,8 +1533,11 @@ const REGISTRATION_REMOTE_KEYS: Readonly<Record<string, true>> = {
|
||||
/**
|
||||
* Whether setup replaces or removes an existing entry key. Setup registers an
|
||||
* active server, so entry-level switches that turn it off are removed too.
|
||||
* Grok Build's entry `disabled` is kept, matching registration status, which
|
||||
* reads only Grok's root `disabled_mcp_servers` list.
|
||||
* Non-boolean `enabled` or `disabled` values are removed as well: registration
|
||||
* status requires booleans, and retaining a string would leave doctor invalid
|
||||
* after setup reports success. Grok Build's boolean entry `disabled` is kept,
|
||||
* matching registration status, which reads only Grok's root
|
||||
* `disabled_mcp_servers` list.
|
||||
*/
|
||||
const registrationManagedKey = (
|
||||
dialect: ClientRegistrationDialect,
|
||||
@@ -1543,6 +1546,7 @@ const registrationManagedKey = (
|
||||
): boolean =>
|
||||
Object.hasOwn(REGISTRATION_LAUNCHER_KEYS, key) ||
|
||||
Object.hasOwn(REGISTRATION_REMOTE_KEYS, key) ||
|
||||
((key === "enabled" || key === "disabled") && typeof value !== "boolean") ||
|
||||
(key === "enabled" && value === false) ||
|
||||
(key === "disabled" && value === true && dialect !== "grok");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user