diff --git a/packages/coding-agent/CHANGELOG.md b/packages/coding-agent/CHANGELOG.md index c4777f2be..4e3d4fe0e 100644 --- a/packages/coding-agent/CHANGELOG.md +++ b/packages/coding-agent/CHANGELOG.md @@ -12,6 +12,7 @@ - Fixed the Docker `natives-builder` stage failing to build releases ≥ 17.1.1: the native audio stack added bindgen (miniaudio needs libclang) and a bundled-opus CMake build (needs cmake + make), none of which were installed in the slim builder image. - Fixed `omp usage` duplicating org-less legacy accounts as "no usage data" rows whenever any sibling report carried an organization (mixed pools of pre-org-capture rows and fresh org-scoped logins): an org-less account is now covered by its own org-less report, while org-attributed sibling reports still never count as its coverage. - `omp usage` revalidates the broker credential snapshot before rendering: live usage reports were previously paired with a disk-cached account list up to an hour old, so a just-completed re-login (org-less row upserted to org-scoped) rendered as a phantom duplicate until the cache expired. +- Fixed disabling the Advisor from `/settings` updating the persisted setting without stopping the live Advisor runtime until the session restarted: `SelectorController.handleSettingChange` had no case for `advisor.enabled`, unlike other session-managed toggles (`autoCompact`, `steeringMode`, ...), so the change never reached `session.setAdvisorEnabled`. ## [17.1.3] - 2026-07-24 diff --git a/packages/coding-agent/src/modes/controllers/selector-controller.ts b/packages/coding-agent/src/modes/controllers/selector-controller.ts index 396aea078..a2010c276 100644 --- a/packages/coding-agent/src/modes/controllers/selector-controller.ts +++ b/packages/coding-agent/src/modes/controllers/selector-controller.ts @@ -420,6 +420,11 @@ export class SelectorController { this.ctx.session.setAutoCompactionEnabled(value as boolean); this.ctx.statusLine.setAutoCompactEnabled(value as boolean); break; + case "advisor.enabled": + this.ctx.session.setAdvisorEnabled(value as boolean); + this.ctx.statusLine.invalidate(); + this.ctx.ui.requestRender(); + break; case "steeringMode": this.ctx.session.setSteeringMode(value as "all" | "one-at-a-time"); break; diff --git a/packages/coding-agent/test/selector-settings-side-effects.test.ts b/packages/coding-agent/test/selector-settings-side-effects.test.ts index e7d558ca9..a30f4cb10 100644 --- a/packages/coding-agent/test/selector-settings-side-effects.test.ts +++ b/packages/coding-agent/test/selector-settings-side-effects.test.ts @@ -77,6 +77,22 @@ describe("selector setting side effects", () => { expect(applyMemoryBackend).toHaveBeenCalledTimes(1); }); + it("stops the live advisor runtime when advisor.enabled is turned off in /settings", () => { + const setAdvisorEnabled = vi.fn(); + const invalidate = vi.fn(); + const requestRender = vi.fn(); + const controller = new SelectorController({ + session: { setAdvisorEnabled }, + statusLine: { invalidate }, + ui: { requestRender }, + } as unknown as InteractiveModeContext); + + controller.handleSettingChange("advisor.enabled", false); + + expect(setAdvisorEnabled).toHaveBeenCalledWith(false); + expect(invalidate).toHaveBeenCalledTimes(1); + expect(requestRender).toHaveBeenCalledTimes(1); + }); for (const id of ["terminal.showImages", "showImages"]) { for (const visible of [false, true]) {