fix(setup): drop stale Codex oauth_resource and disclose remote replacement

A command entry that still carries oauth_resource is rejected by Codex for
stdio. Setup now treats that key as remote and removes it. The approval plan
keeps other fields only for a local command entry and says a remote entry's
other fields are replaced.
This commit is contained in:
Cursor Agent
2026-10-12 21:35:28 -04:00
committed by xeropresence
parent b478a8b011
commit 502e665212
5 changed files with 44 additions and 8 deletions
@@ -1522,6 +1522,9 @@ const REGISTRATION_REMOTE_KEYS: Readonly<Record<string, true>> = {
env_http_headers: true,
bearer_token_env_var: true,
oauth: true,
// Codex serializes `--oauth-resource` as `oauth_resource` and rejects it on
// a command entry (`oauth_resource is not supported for stdio`).
oauth_resource: true,
};
/**
+3
View File
@@ -152,6 +152,9 @@ describe("setup workflow", () => {
expect(result.plannedActions.map(({ id }) => id)).toEqual([
"configure_client:codex",
]);
expect(result.plannedActions[0]?.detail).toContain(
"replaced when that entry is remote",
);
expect(host.hopperInstalls).toBe(0);
expect(host.configurations).toBe(0);
});
+4 -2
View File
@@ -311,10 +311,12 @@ const clientConfigurationDetail = (
const entries = Object.entries(environment)
.sort(([left], [right]) => compareUnicodeCodePoints(left, right))
.map(([name, value]) => `${name}=${value}`);
const retainedFields =
"Other fields are retained on an existing local command entry and replaced when that entry is remote.";
const environmentDetail =
entries.length === 0
? " No additional provider environment variables. Existing server environment overrides are retained, as are other fields on REA's existing entry."
: ` Detected provider environment: ${entries.join(", ")}. Existing server environment overrides are retained; detected values replace matching keys. Other fields on REA's existing entry are retained.`;
? ` No additional provider environment variables. Existing server environment overrides are retained. ${retainedFields}`
: ` Detected provider environment: ${entries.join(", ")}. Existing server environment overrides are retained; detected values replace matching keys. ${retainedFields}`;
const hopperDetail = installHopper
? environment.HOPPER_LAUNCHER_PATH === undefined
? " If this plan installs Hopper, REA will add HOPPER_LAUNCHER_PATH using the launcher path reported by that installation."