pi-advisor-flow 0.16.0 → 0.16.1-dev.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +5 -0
- package/README.md +1 -1
- package/dist/index.js +12 -40
- package/package.json +1 -1
- package/src/commands/activation-preparation.ts +3 -10
- package/src/commands/activation.ts +1 -9
- package/src/commands/lifecycle.ts +4 -47
- package/src/commands/manual-command.ts +4 -3
- package/src/commands/manual-consultation.ts +5 -5
- package/src/commands/model-commands.ts +1 -4
- package/src/commands/model-options.ts +0 -12
- package/src/commands/runtime.ts +0 -1
- package/src/commands/types.ts +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,11 @@ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and
|
|
|
6
6
|
|
|
7
7
|
## Unreleased
|
|
8
8
|
|
|
9
|
+
### Fixed
|
|
10
|
+
|
|
11
|
+
- Prevent `/model` and model cycling from changing the persisted Executor; update it only through `/advisor-models` or an explicit `/advisor executor=...` override.
|
|
12
|
+
- `/advisor-manual` now waits for the consultation in `pi --mode json -p` one-shot runs, so the result (or failure) message is emitted before the process exits instead of being lost to teardown, and no Executor turn is triggered there.
|
|
13
|
+
|
|
9
14
|
## 0.16.0 - 2026-11-16
|
|
10
15
|
|
|
11
16
|
### Added
|
package/README.md
CHANGED
|
@@ -78,7 +78,7 @@ Reload Pi after installing. The package also installs the `pi-advisor-flow` skil
|
|
|
78
78
|
/advisor-stats # Show retained outcome adoption and validation stats
|
|
79
79
|
```
|
|
80
80
|
|
|
81
|
-
The Executor is whichever model your Pi session is using
|
|
81
|
+
The Executor is whichever model your Pi session is using unless you pin one with `executor=` or `/advisor-models`. Changing the active model with `/model` or model cycling does not change the saved Executor; use `/advisor-models` or an explicit `/advisor executor=...` to change that configuration. On first use, or whenever the saved Advisor is unavailable, `/advisor` opens the available-model picker; it never silently chooses an unconfigured Advisor. Pi virtual models can be selected as Advisors; Pi routes each request to a physical model and resolves that model's credentials. They require a Pi runtime with `modelRegistry.streamSimple`; on older runtimes, the request explains how to upgrade or select a physical Advisor model. If the active Executor and Advisor use the same provider/model, calls and automatic gates are skipped with a notice; switching either model resumes consultations. Turn off **Disable same-model Advisor** in `/advisor-settings` (or set `"advisorDisableSameModel": false` globally) if you intentionally want a higher-effort review from that same model. You can also enable the flow and select both models at once:
|
|
82
82
|
|
|
83
83
|
```text
|
|
84
84
|
/advisor executor=openai-codex/gpt-5.6-luna advisor=openai-codex/gpt-5.6-sol
|
package/dist/index.js
CHANGED
|
@@ -1466,12 +1466,10 @@ var getExplicitModelError = (ctx, ref, label, overridden, availableRefs) => {
|
|
|
1466
1466
|
}
|
|
1467
1467
|
}
|
|
1468
1468
|
};
|
|
1469
|
-
var planActivationModels = (ctx, executor, advisor,
|
|
1470
|
-
const
|
|
1471
|
-
const executorConfigured = executorOverride || Boolean(pendingExecutor) || !persisted.executor || isSelectableModel(ctx, executor, availableRefs);
|
|
1469
|
+
var planActivationModels = (ctx, executor, advisor, persisted, executorOverride, advisorOverride, availableRefs) => {
|
|
1470
|
+
const executorConfigured = executorOverride || !persisted.executor || isSelectableModel(ctx, executor, availableRefs);
|
|
1472
1471
|
const advisorConfigured = advisorOverride || Boolean(persisted.advisor && isSelectableModel(ctx, advisor, availableRefs));
|
|
1473
1472
|
return {
|
|
1474
|
-
pendingExecutor,
|
|
1475
1473
|
selectAdvisor: !advisorConfigured,
|
|
1476
1474
|
selectExecutor: !executorConfigured
|
|
1477
1475
|
};
|
|
@@ -5542,7 +5540,6 @@ class CommandRuntime {
|
|
|
5542
5540
|
requestManualRender = requestManualRender;
|
|
5543
5541
|
scoutStatus;
|
|
5544
5542
|
manualProgressSequence = 0;
|
|
5545
|
-
pendingExecutorModelRef;
|
|
5546
5543
|
suppressModelSelectionSync = false;
|
|
5547
5544
|
toolAvailabilityRevision = 0;
|
|
5548
5545
|
lastSameModelDisabled;
|
|
@@ -5612,10 +5609,9 @@ var prepareActivationModels = async (runtime, ctx, announce, executorOverride, a
|
|
|
5612
5609
|
notify(ctx, explicitError, "error");
|
|
5613
5610
|
return;
|
|
5614
5611
|
}
|
|
5615
|
-
const plan = planActivationModels(ctx, executorRef, advisorRef,
|
|
5616
|
-
setExecutorRef(plan.pendingExecutor ?? executorRef);
|
|
5612
|
+
const plan = planActivationModels(ctx, executorRef, advisorRef, persisted, executorOverride, advisorOverride, availableRefSet);
|
|
5617
5613
|
if (!(plan.selectExecutor || plan.selectAdvisor)) {
|
|
5618
|
-
return {
|
|
5614
|
+
return { pickedModels: false };
|
|
5619
5615
|
}
|
|
5620
5616
|
if (!announce) {
|
|
5621
5617
|
notify(ctx, t("notify.modelsNotConfigured.message", "Advisor models are not configured or available. Run /advisor to choose them."), "error");
|
|
@@ -5625,7 +5621,7 @@ var prepareActivationModels = async (runtime, ctx, announce, executorOverride, a
|
|
|
5625
5621
|
advisor: advisorOverride || persisted.advisor ? advisorRef : "",
|
|
5626
5622
|
advisorEffort: advisorEffortRef,
|
|
5627
5623
|
advisorFallbackModel: advisorFallbackModelRef,
|
|
5628
|
-
executor: executorOverride ||
|
|
5624
|
+
executor: executorOverride || persisted.executor ? executorRef : "",
|
|
5629
5625
|
executorEffort: executorEffortRef,
|
|
5630
5626
|
selectAdvisor: plan.selectAdvisor,
|
|
5631
5627
|
selectExecutor: plan.selectExecutor
|
|
@@ -5638,7 +5634,7 @@ var prepareActivationModels = async (runtime, ctx, announce, executorOverride, a
|
|
|
5638
5634
|
setAdvisorEffortRef(selection.advisorEffort);
|
|
5639
5635
|
setExecutorRef(selection.executor);
|
|
5640
5636
|
setExecutorEffortRef(selection.executorEffort);
|
|
5641
|
-
return {
|
|
5637
|
+
return { pickedModels: true };
|
|
5642
5638
|
};
|
|
5643
5639
|
|
|
5644
5640
|
// src/commands/advisor-tools.ts
|
|
@@ -5783,11 +5779,10 @@ var activateAdvisor = async (runtime, args, ctx, announce = true) => {
|
|
|
5783
5779
|
if (reenableTools) {
|
|
5784
5780
|
setAdvisorToolsEnabledRef(true);
|
|
5785
5781
|
}
|
|
5786
|
-
const shouldSave = Boolean(args.trim() || prepared.pickedModels ||
|
|
5782
|
+
const shouldSave = Boolean(args.trim() || prepared.pickedModels || reenableTools);
|
|
5787
5783
|
if (!persistSuccessfulActivation(ctx, shouldSave, reenableTools, () => restoreRefs(liveRefSnapshot()))) {
|
|
5788
5784
|
return;
|
|
5789
5785
|
}
|
|
5790
|
-
runtime.pendingExecutorModelRef = undefined;
|
|
5791
5786
|
if (executorEffortRef && !isMarkedSubagent()) {
|
|
5792
5787
|
runtime.pi.setThinkingLevel(executorEffortRef);
|
|
5793
5788
|
}
|
|
@@ -6312,7 +6307,6 @@ var registerAdvisorConfigurationTool = (runtime, dependencies = {}) => {
|
|
|
6312
6307
|
// src/commands/lifecycle.ts
|
|
6313
6308
|
var registerCommandLifecycle = (runtime, activateAdvisor) => {
|
|
6314
6309
|
runtime.pi.on("session_start", async (_event, ctx) => {
|
|
6315
|
-
runtime.pendingExecutorModelRef = undefined;
|
|
6316
6310
|
runtime.resetSameModelNotice();
|
|
6317
6311
|
try {
|
|
6318
6312
|
loadConfig(ctx);
|
|
@@ -6337,27 +6331,6 @@ var registerCommandLifecycle = (runtime, activateAdvisor) => {
|
|
|
6337
6331
|
if (!runtime.suppressModelSelectionSync) {
|
|
6338
6332
|
runtime.updateSameModelNotice(ctx, event.model);
|
|
6339
6333
|
}
|
|
6340
|
-
if (event.source !== "set" || runtime.suppressModelSelectionSync || isMarkedSubagent()) {
|
|
6341
|
-
return;
|
|
6342
|
-
}
|
|
6343
|
-
const selected = `${event.model.provider}/${event.model.id}`;
|
|
6344
|
-
if (!getPersistedModelRefs().executor) {
|
|
6345
|
-
return;
|
|
6346
|
-
}
|
|
6347
|
-
if (!runtime.flowEnabled()) {
|
|
6348
|
-
runtime.pendingExecutorModelRef = selected;
|
|
6349
|
-
return;
|
|
6350
|
-
}
|
|
6351
|
-
runtime.pendingExecutorModelRef = undefined;
|
|
6352
|
-
if (selected === executorRef) {
|
|
6353
|
-
return;
|
|
6354
|
-
}
|
|
6355
|
-
const persisted = getPersistedModelRefs();
|
|
6356
|
-
setExecutorRef(selected);
|
|
6357
|
-
saveConfig(ctx, {
|
|
6358
|
-
persistAdvisor: Boolean(persisted.advisor),
|
|
6359
|
-
persistExecutor: true
|
|
6360
|
-
});
|
|
6361
6334
|
});
|
|
6362
6335
|
runtime.pi.on("session_shutdown", (_event, ctx) => {
|
|
6363
6336
|
if (ctx.hasUI) {
|
|
@@ -7245,7 +7218,7 @@ var screeningSkipText = (outcome) => outcome.kind === "repeat" && outcome.reatta
|
|
|
7245
7218
|
|
|
7246
7219
|
// src/commands/manual-consultation.ts
|
|
7247
7220
|
var startManualConsultation = async (runtime, ctx, question, controller, scoutStatusToken, progress, gitContext) => {
|
|
7248
|
-
const
|
|
7221
|
+
const isOneShot = ctx.mode === "print" || ctx.mode === "json";
|
|
7249
7222
|
progress.phase = "preparing";
|
|
7250
7223
|
runtime.requestManualRender(ctx);
|
|
7251
7224
|
if (uiAvailable(ctx)) {
|
|
@@ -7326,7 +7299,7 @@ ${markdown}`,
|
|
|
7326
7299
|
display: true
|
|
7327
7300
|
}, {
|
|
7328
7301
|
deliverAs: "steer",
|
|
7329
|
-
triggerTurn: !
|
|
7302
|
+
triggerTurn: !isOneShot
|
|
7330
7303
|
});
|
|
7331
7304
|
} catch (error) {
|
|
7332
7305
|
if (controller.signal.aborted) {
|
|
@@ -7351,7 +7324,7 @@ ${markdown}`,
|
|
|
7351
7324
|
text: `**Advisor consultation failed:** ${message}`
|
|
7352
7325
|
},
|
|
7353
7326
|
display: true
|
|
7354
|
-
}, { deliverAs: "steer", triggerTurn: !
|
|
7327
|
+
}, { deliverAs: "steer", triggerTurn: !isOneShot });
|
|
7355
7328
|
notify(ctx, `${t("manualCmd.consultFailed.prefix", "Advisor consultation failed:")} ${message}`, "error");
|
|
7356
7329
|
notifyHerdrAdvisorFailure("Advisor consultation failed", message);
|
|
7357
7330
|
} finally {
|
|
@@ -7445,7 +7418,7 @@ var registerManualCommand = (runtime) => {
|
|
|
7445
7418
|
runtime.scoutStatus.register(scoutStatusToken);
|
|
7446
7419
|
runtime.manualConsultations.set(controller, scoutStatusToken);
|
|
7447
7420
|
runtime.pi.appendEntry?.("advisor-manual-call", { progressId, question });
|
|
7448
|
-
if (ctx.mode === "print") {
|
|
7421
|
+
if (ctx.mode === "print" || ctx.mode === "json") {
|
|
7449
7422
|
await startManualConsultation(runtime, ctx, question, controller, scoutStatusToken, progress, gitContext);
|
|
7450
7423
|
return;
|
|
7451
7424
|
}
|
|
@@ -7475,7 +7448,7 @@ var registerModelCommands = (runtime) => {
|
|
|
7475
7448
|
advisor: persisted.advisor ? advisorRef : "",
|
|
7476
7449
|
advisorEffort: advisorEffortRef,
|
|
7477
7450
|
advisorFallbackModel: advisorFallbackModelRef,
|
|
7478
|
-
executor:
|
|
7451
|
+
executor: persisted.executor ? executorRef : "",
|
|
7479
7452
|
executorEffort: executorEffortRef,
|
|
7480
7453
|
selectAdvisor: true,
|
|
7481
7454
|
selectExecutor: true
|
|
@@ -7492,7 +7465,6 @@ var registerModelCommands = (runtime) => {
|
|
|
7492
7465
|
persistAdvisor: true,
|
|
7493
7466
|
persistExecutor: true
|
|
7494
7467
|
});
|
|
7495
|
-
runtime.pendingExecutorModelRef = undefined;
|
|
7496
7468
|
runtime.updateSameModelNotice(ctx);
|
|
7497
7469
|
ctx.ui.notify(`${t("notify.modelsSaved.prefix", "Saved Executor + Advisor configurations to")} ${path}`, "info");
|
|
7498
7470
|
}
|
package/package.json
CHANGED
|
@@ -25,7 +25,6 @@ import { notify } from "./runtime.ts";
|
|
|
25
25
|
import type { CommandRuntime } from "./types.ts";
|
|
26
26
|
|
|
27
27
|
export interface PreparedActivationModels {
|
|
28
|
-
pendingExecutor?: string;
|
|
29
28
|
pickedModels: boolean;
|
|
30
29
|
}
|
|
31
30
|
|
|
@@ -86,17 +85,14 @@ export const prepareActivationModels = async (
|
|
|
86
85
|
ctx,
|
|
87
86
|
executorRef,
|
|
88
87
|
advisorRef,
|
|
89
|
-
runtime.pendingExecutorModelRef,
|
|
90
88
|
persisted,
|
|
91
89
|
executorOverride,
|
|
92
90
|
advisorOverride,
|
|
93
91
|
availableRefSet
|
|
94
92
|
);
|
|
95
93
|
|
|
96
|
-
setExecutorRef(plan.pendingExecutor ?? executorRef);
|
|
97
|
-
|
|
98
94
|
if (!(plan.selectExecutor || plan.selectAdvisor)) {
|
|
99
|
-
return {
|
|
95
|
+
return { pickedModels: false };
|
|
100
96
|
}
|
|
101
97
|
|
|
102
98
|
// Always-on startup cannot open an interactive picker, so it leaves the
|
|
@@ -118,10 +114,7 @@ export const prepareActivationModels = async (
|
|
|
118
114
|
advisor: advisorOverride || persisted.advisor ? advisorRef : "",
|
|
119
115
|
advisorEffort: advisorEffortRef,
|
|
120
116
|
advisorFallbackModel: advisorFallbackModelRef,
|
|
121
|
-
executor:
|
|
122
|
-
executorOverride || plan.pendingExecutor || persisted.executor
|
|
123
|
-
? executorRef
|
|
124
|
-
: "",
|
|
117
|
+
executor: executorOverride || persisted.executor ? executorRef : "",
|
|
125
118
|
executorEffort: executorEffortRef,
|
|
126
119
|
selectAdvisor: plan.selectAdvisor,
|
|
127
120
|
selectExecutor: plan.selectExecutor,
|
|
@@ -137,5 +130,5 @@ export const prepareActivationModels = async (
|
|
|
137
130
|
setExecutorRef(selection.executor);
|
|
138
131
|
setExecutorEffortRef(selection.executorEffort);
|
|
139
132
|
|
|
140
|
-
return {
|
|
133
|
+
return { pickedModels: true };
|
|
141
134
|
};
|
|
@@ -253,10 +253,7 @@ export const activateAdvisor = async (
|
|
|
253
253
|
}
|
|
254
254
|
|
|
255
255
|
const shouldSave = Boolean(
|
|
256
|
-
args.trim() ||
|
|
257
|
-
prepared.pickedModels ||
|
|
258
|
-
prepared.pendingExecutor ||
|
|
259
|
-
reenableTools
|
|
256
|
+
args.trim() || prepared.pickedModels || reenableTools
|
|
260
257
|
);
|
|
261
258
|
|
|
262
259
|
if (
|
|
@@ -267,11 +264,6 @@ export const activateAdvisor = async (
|
|
|
267
264
|
return;
|
|
268
265
|
}
|
|
269
266
|
|
|
270
|
-
// A successful activation has committed the effective Executor. Do not let
|
|
271
|
-
// an older inactive selection override an explicit activation argument on a
|
|
272
|
-
// later attempt.
|
|
273
|
-
runtime.pendingExecutorModelRef = undefined;
|
|
274
|
-
|
|
275
267
|
if (executorEffortRef && !isMarkedSubagent()) {
|
|
276
268
|
// SAFETY: executorEffortRef is operator-configured and trusted to name a ThinkingLevel.
|
|
277
269
|
runtime.pi.setThinkingLevel(executorEffortRef as ThinkingLevel);
|
|
@@ -1,14 +1,7 @@
|
|
|
1
1
|
import type { ExtensionContext } from "@earendil-works/pi-coding-agent";
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
advisorToolsEnabledRef,
|
|
6
|
-
alwaysOnRef,
|
|
7
|
-
executorRef,
|
|
8
|
-
getPersistedModelRefs,
|
|
9
|
-
setExecutorRef,
|
|
10
|
-
} from "../config/state.ts";
|
|
11
|
-
import { loadConfig, saveConfig } from "../config/storage.ts";
|
|
3
|
+
import { advisorToolsEnabledRef, alwaysOnRef } from "../config/state.ts";
|
|
4
|
+
import { loadConfig } from "../config/storage.ts";
|
|
12
5
|
import { t } from "../i18n.ts";
|
|
13
6
|
import { setAdvisorToolsActive } from "./advisor-tools.ts";
|
|
14
7
|
import { notify } from "./runtime.ts";
|
|
@@ -25,7 +18,6 @@ export const registerCommandLifecycle = (
|
|
|
25
18
|
activateAdvisor: ActivateAdvisor
|
|
26
19
|
) => {
|
|
27
20
|
runtime.pi.on("session_start", async (_event, ctx) => {
|
|
28
|
-
runtime.pendingExecutorModelRef = undefined;
|
|
29
21
|
runtime.resetSameModelNotice();
|
|
30
22
|
|
|
31
23
|
// A malformed advisor.json or a provider auth failure must not reject a
|
|
@@ -62,43 +54,8 @@ export const registerCommandLifecycle = (
|
|
|
62
54
|
runtime.updateSameModelNotice(ctx, event.model);
|
|
63
55
|
}
|
|
64
56
|
|
|
65
|
-
//
|
|
66
|
-
//
|
|
67
|
-
// configured Executor.
|
|
68
|
-
if (
|
|
69
|
-
event.source !== "set" ||
|
|
70
|
-
runtime.suppressModelSelectionSync ||
|
|
71
|
-
isMarkedSubagent()
|
|
72
|
-
) {
|
|
73
|
-
return;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
const selected = `${event.model.provider}/${event.model.id}`;
|
|
77
|
-
|
|
78
|
-
if (!getPersistedModelRefs().executor) {
|
|
79
|
-
return;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
if (!runtime.flowEnabled()) {
|
|
83
|
-
// Defer persistence until `/advisor` succeeds. This keeps ordinary model
|
|
84
|
-
// selection global defaults untouched when the flow is not enabled.
|
|
85
|
-
runtime.pendingExecutorModelRef = selected;
|
|
86
|
-
|
|
87
|
-
return;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
runtime.pendingExecutorModelRef = undefined;
|
|
91
|
-
|
|
92
|
-
if (selected === executorRef) {
|
|
93
|
-
return;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
const persisted = getPersistedModelRefs();
|
|
97
|
-
setExecutorRef(selected);
|
|
98
|
-
saveConfig(ctx, {
|
|
99
|
-
persistAdvisor: Boolean(persisted.advisor),
|
|
100
|
-
persistExecutor: true,
|
|
101
|
-
});
|
|
57
|
+
// Model selection changes the active Pi session model only. Persisted
|
|
58
|
+
// Executor settings are changed explicitly through `/advisor-models`.
|
|
102
59
|
});
|
|
103
60
|
|
|
104
61
|
runtime.pi.on("session_shutdown", (_event, ctx) => {
|
|
@@ -123,9 +123,10 @@ export const registerManualCommand = (runtime: CommandRuntime) => {
|
|
|
123
123
|
runtime.manualConsultations.set(controller, scoutStatusToken);
|
|
124
124
|
runtime.pi.appendEntry?.("advisor-manual-call", { progressId, question });
|
|
125
125
|
|
|
126
|
-
//
|
|
127
|
-
//
|
|
128
|
-
|
|
126
|
+
// One-shot runs (`pi -p`, `pi --mode json -p`) tear the session down
|
|
127
|
+
// when the handler returns, so the consultation must complete inside
|
|
128
|
+
// the handler to keep its ctx valid.
|
|
129
|
+
if (ctx.mode === "print" || ctx.mode === "json") {
|
|
129
130
|
await startManualConsultation(
|
|
130
131
|
runtime,
|
|
131
132
|
ctx,
|
|
@@ -34,7 +34,9 @@ export const startManualConsultation = async (
|
|
|
34
34
|
progress: ManualAdvisorProgressState,
|
|
35
35
|
gitContext?: GitContextLevel
|
|
36
36
|
) => {
|
|
37
|
-
|
|
37
|
+
// One-shot runs (`pi -p`, `pi --mode json -p`) have no follow-up turn;
|
|
38
|
+
// triggering one trips pi's turn_end entry resolution during teardown.
|
|
39
|
+
const isOneShot = ctx.mode === "print" || ctx.mode === "json";
|
|
38
40
|
progress.phase = "preparing";
|
|
39
41
|
runtime.requestManualRender(ctx);
|
|
40
42
|
|
|
@@ -153,10 +155,8 @@ export const startManualConsultation = async (
|
|
|
153
155
|
{
|
|
154
156
|
// Steer lets the current turn finish its active work; the Executor sees
|
|
155
157
|
// the result before its next model call rather than being interrupted.
|
|
156
|
-
// Print mode has no follow-up turn; triggering one trips pi's turn_end
|
|
157
|
-
// entry resolution during teardown.
|
|
158
158
|
deliverAs: "steer",
|
|
159
|
-
triggerTurn: !
|
|
159
|
+
triggerTurn: !isOneShot,
|
|
160
160
|
}
|
|
161
161
|
);
|
|
162
162
|
} catch (error) {
|
|
@@ -185,7 +185,7 @@ export const startManualConsultation = async (
|
|
|
185
185
|
},
|
|
186
186
|
display: true,
|
|
187
187
|
},
|
|
188
|
-
{ deliverAs: "steer", triggerTurn: !
|
|
188
|
+
{ deliverAs: "steer", triggerTurn: !isOneShot }
|
|
189
189
|
);
|
|
190
190
|
notify(
|
|
191
191
|
ctx,
|
|
@@ -42,9 +42,7 @@ export const registerModelCommands = (runtime: CommandRuntime) => {
|
|
|
42
42
|
advisor: persisted.advisor ? advisorRef : "",
|
|
43
43
|
advisorEffort: advisorEffortRef,
|
|
44
44
|
advisorFallbackModel: advisorFallbackModelRef,
|
|
45
|
-
executor:
|
|
46
|
-
runtime.pendingExecutorModelRef ??
|
|
47
|
-
(persisted.executor ? executorRef : ""),
|
|
45
|
+
executor: persisted.executor ? executorRef : "",
|
|
48
46
|
executorEffort: executorEffortRef,
|
|
49
47
|
selectAdvisor: true,
|
|
50
48
|
selectExecutor: true,
|
|
@@ -65,7 +63,6 @@ export const registerModelCommands = (runtime: CommandRuntime) => {
|
|
|
65
63
|
persistExecutor: true,
|
|
66
64
|
});
|
|
67
65
|
|
|
68
|
-
runtime.pendingExecutorModelRef = undefined;
|
|
69
66
|
runtime.updateSameModelNotice(ctx);
|
|
70
67
|
ctx.ui.notify(
|
|
71
68
|
`${t("notify.modelsSaved.prefix", "Saved Executor + Advisor configurations to")} ${path}`,
|
|
@@ -165,7 +165,6 @@ export const getExplicitModelError = (
|
|
|
165
165
|
};
|
|
166
166
|
|
|
167
167
|
export interface ActivationModelPlan {
|
|
168
|
-
pendingExecutor: string | undefined;
|
|
169
168
|
selectAdvisor: boolean;
|
|
170
169
|
selectExecutor: boolean;
|
|
171
170
|
}
|
|
@@ -174,23 +173,13 @@ export const planActivationModels = (
|
|
|
174
173
|
ctx: ExtensionContext,
|
|
175
174
|
executor: string | undefined,
|
|
176
175
|
advisor: string | undefined,
|
|
177
|
-
pendingExecutorRef: string | undefined,
|
|
178
176
|
persisted: ReturnType<typeof getPersistedModelRefs>,
|
|
179
177
|
executorOverride: boolean,
|
|
180
178
|
advisorOverride: boolean,
|
|
181
179
|
availableRefs: Set<string> | undefined
|
|
182
180
|
): ActivationModelPlan => {
|
|
183
|
-
const pendingExecutor =
|
|
184
|
-
!executorOverride &&
|
|
185
|
-
persisted.executor &&
|
|
186
|
-
pendingExecutorRef &&
|
|
187
|
-
isSelectableModel(ctx, pendingExecutorRef, availableRefs)
|
|
188
|
-
? pendingExecutorRef
|
|
189
|
-
: undefined;
|
|
190
|
-
|
|
191
181
|
const executorConfigured =
|
|
192
182
|
executorOverride ||
|
|
193
|
-
Boolean(pendingExecutor) ||
|
|
194
183
|
!persisted.executor ||
|
|
195
184
|
isSelectableModel(ctx, executor, availableRefs);
|
|
196
185
|
|
|
@@ -201,7 +190,6 @@ export const planActivationModels = (
|
|
|
201
190
|
);
|
|
202
191
|
|
|
203
192
|
return {
|
|
204
|
-
pendingExecutor,
|
|
205
193
|
selectAdvisor: !advisorConfigured,
|
|
206
194
|
selectExecutor: !executorConfigured,
|
|
207
195
|
};
|
package/src/commands/runtime.ts
CHANGED
|
@@ -64,7 +64,6 @@ class CommandRuntime implements CommandRuntimeContract {
|
|
|
64
64
|
readonly requestManualRender = requestManualRender;
|
|
65
65
|
readonly scoutStatus: ScoutStatusManager;
|
|
66
66
|
manualProgressSequence = 0;
|
|
67
|
-
pendingExecutorModelRef: string | undefined;
|
|
68
67
|
suppressModelSelectionSync = false;
|
|
69
68
|
toolAvailabilityRevision = 0;
|
|
70
69
|
private lastSameModelDisabled: boolean | undefined;
|
package/src/commands/types.ts
CHANGED
|
@@ -62,7 +62,6 @@ export interface CommandRuntime {
|
|
|
62
62
|
ReturnType<typeof setInterval>
|
|
63
63
|
>;
|
|
64
64
|
nextManualProgressId: () => string;
|
|
65
|
-
pendingExecutorModelRef: string | undefined;
|
|
66
65
|
readonly pi: ExtensionAPI;
|
|
67
66
|
reportManualBudgetExhausted: (ctx: ExtensionContext) => void;
|
|
68
67
|
readonly requestAdvisor: ManualConsult;
|