diff --git a/src/app-server.mjs b/src/app-server.mjs index f8e8357..35303db 100644 --- a/src/app-server.mjs +++ b/src/app-server.mjs @@ -1026,8 +1026,8 @@ export class CodexAppServer { case "feedback/upload": return this.#feedbackUpload(); case "config/value/write": case "config/batchWrite": - case "remoteControl/enable": return {}; case "config/write": return this.#configWrite(params); + case "remoteControl/enable": return {}; case "config/read": return this.#configRead(params); case "features/list": return this.#featuresList(); case "thread/start": return this.#threadStart(peer, params); diff --git a/test/app-server.test.mjs b/test/app-server.test.mjs index 0b0fc02..1d02bc1 100644 --- a/test/app-server.test.mjs +++ b/test/app-server.test.mjs @@ -191,6 +191,34 @@ test("initialization and model discovery", () => withHarness({}, async (h) => { assert.deepEqual(await h.request("remoteControl/enable", { enabled: true }), {}); })); +test("new-thread model picker writes update the defaults used by thread/start", () => withHarness({ + config: { defaultModel: "mock/omp", defaultReasoningEffort: "medium" }, +}, async (h) => { + await h.initialize(); + const result = await h.request("config/batchWrite", { + edits: [ + { keyPath: "model", value: "claude-opus-5", mergeStrategy: "upsert" }, + { keyPath: "model_reasoning_effort", value: "xhigh", mergeStrategy: "upsert" }, + ], + filePath: null, + expectedVersion: null, + reloadUserConfig: true, + }); + assert.equal(result.status, "ok"); + + const { config } = await h.request("config/read", { cwd: h.temp }); + assert.equal(config.model, "claude-opus-5"); + assert.equal(config.model_reasoning_effort, "xhigh"); + + const { thread } = await h.request("thread/start", { cwd: h.temp }); + assert.equal(thread.model, "claude-opus-5"); + assert.equal(thread.reasoningEffort, "xhigh"); + + const persisted = JSON.parse(await fs.readFile(path.join(h.temp, "config.json"), "utf8")); + assert.equal(persisted.defaultModel, "claude-opus-5"); + assert.equal(persisted.defaultReasoningEffort, "xhigh"); +})); + test("fuzzy file search supports single-shot and streaming mention completion", () => withHarness({}, async (h) => { await h.initialize(); await fs.mkdir(path.join(h.temp, "src"), { recursive: true });