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
@@ -110,6 +110,34 @@ it.each([
},
);
it("drops Codex oauth_resource from a local command entry", async () => {
const root = await createTestTempDirectory(
"rea-registration-oauth-resource-",
);
const configPath = join(root, "config.toml");
const client: SetupClient = { name: "codex", format: "toml", configPath };
const existing = {
...clientRegistrationEntry("toml", ["rea-old", "mcp"], environment),
tool_timeout_sec: 900,
oauth_resource: "https://stale.example/resource",
};
await writeFile(
configPath,
serializeClientConfiguration(configurationWith("toml", existing), "toml"),
);
expect(await configureClientConfiguration(client, {}, command)).toMatchObject(
{ status: "configured" },
);
expect(
parseClientConfiguration(await readFile(configPath, "utf8"), "toml").servers
.rea,
).toEqual({
...clientRegistrationEntry("toml", command, environment),
startup_timeout_sec: MCP_STARTUP_POLICY.codexStartupTimeoutSeconds,
tool_timeout_sec: 900,
});
});
it("replaces a remote server entry instead of merging its fields", async () => {
const root = await createTestTempDirectory("rea-registration-remote-");
const configPath = join(root, "mcp.json");