fix(coding-agent): stop the live advisor runtime when /settings disables it

Disabling the Advisor from /settings persisted the setting but left the
live Advisor runtime running 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 — the same call /advisor
off already uses to stop the runtime immediately.
This commit is contained in:
Paolo Mazzitti
2026-07-26 12:25:19 +00:00
parent 667111575e
commit 81bc0d4368
3 changed files with 22 additions and 0 deletions
+1
View File
@@ -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
@@ -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;
@@ -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]) {