agent-sh 0.14.4 → 0.14.5
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/dist/agent/agent-loop.js +6 -1
- package/dist/agent/index.js +2 -0
- package/package.json +1 -1
package/dist/agent/agent-loop.js
CHANGED
|
@@ -192,11 +192,15 @@ export class AgentLoop {
|
|
|
192
192
|
const modes = this.pullModes();
|
|
193
193
|
const prev = this.activeMode;
|
|
194
194
|
const fresh = modes.find((m) => m.model === prev.model && m.provider === prev.provider);
|
|
195
|
+
let identityChanged = false;
|
|
195
196
|
if (fresh) {
|
|
196
197
|
this.activeMode = fresh;
|
|
197
198
|
if (fresh.providerConfig && fresh.providerConfig !== prev.providerConfig) {
|
|
198
199
|
this.llmClient.reconfigure({ ...fresh.providerConfig, model: fresh.model });
|
|
199
200
|
}
|
|
201
|
+
identityChanged = fresh.model !== prev.model
|
|
202
|
+
|| fresh.provider !== prev.provider
|
|
203
|
+
|| fresh.contextWindow !== prev.contextWindow;
|
|
200
204
|
}
|
|
201
205
|
else if (prev.provider) {
|
|
202
206
|
// Ghost: keep prev active so mid-turn stream() doesn't switch models.
|
|
@@ -204,7 +208,8 @@ export class AgentLoop {
|
|
|
204
208
|
message: `${prev.provider}:${prev.model} is not in the refreshed catalog — keeping it active until you /model to another.`,
|
|
205
209
|
});
|
|
206
210
|
}
|
|
207
|
-
|
|
211
|
+
if (identityChanged)
|
|
212
|
+
this.emitIdentity();
|
|
208
213
|
this.bus.emit("config:changed", {});
|
|
209
214
|
});
|
|
210
215
|
onPipe("config:get-models", () => {
|
package/dist/agent/index.js
CHANGED
|
@@ -320,6 +320,8 @@ export default function agentBackend(ctx) {
|
|
|
320
320
|
bus.emit("agent:modes-changed", {});
|
|
321
321
|
if (!ashActive)
|
|
322
322
|
return;
|
|
323
|
+
if (buildModes().some((m) => m.model === llmClient.model))
|
|
324
|
+
return;
|
|
323
325
|
const pendingProvider = getSettings().defaultProvider;
|
|
324
326
|
if (!pendingProvider)
|
|
325
327
|
return;
|