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.
@@ -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
- this.emitIdentity();
211
+ if (identityChanged)
212
+ this.emitIdentity();
208
213
  this.bus.emit("config:changed", {});
209
214
  });
210
215
  onPipe("config:get-models", () => {
@@ -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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-sh",
3
- "version": "0.14.4",
3
+ "version": "0.14.5",
4
4
  "description": "A shell-first terminal where AI is one keystroke away",
5
5
  "type": "module",
6
6
  "workspaces": [