alvin-bot 4.15.0 → 4.15.1

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 CHANGED
@@ -2,6 +2,24 @@
2
2
 
3
3
  All notable changes to Alvin Bot are documented here.
4
4
 
5
+ ## [4.15.1] — 2026-04-16
6
+
7
+ ### 🐛 Patch: suppress `fallbackModel` when primary is Haiku
8
+
9
+ v4.15.0 unconditionally set `fallbackModel: "haiku"` on every Agent SDK call as a rate-limit safety net. When the user switched to `claude-haiku` (via `/model claude-haiku` or a workspace `model: haiku`), the SDK rejected the request:
10
+
11
+ > *Fallback model cannot be the same as the main model. Please specify a different model for fallbackModel option.*
12
+
13
+ The provider registry treated this as a normal failure and cascaded to the next fallback — Ollama — which then had to cold-boot (~45 s for `gemma4:e4b`). Visible symptom: a sudden multi-second latency spike immediately after picking Haiku, followed by the bot answering via the local model instead of Claude.
14
+
15
+ **Fix:** `src/providers/claude-sdk-provider.ts` now checks whether the resolved primary model contains `"haiku"` and omits `fallbackModel` in that case. Opus / Sonnet / `inherit` still get Haiku as fallback. No other provider paths affected.
16
+
17
+ ### Commits
18
+
19
+ - `ec205b5` — fix(providers): v4.15.1 — don't set fallbackModel when primary is Haiku
20
+
21
+ ---
22
+
5
23
  ## [4.15.0] — 2026-04-16
6
24
 
7
25
  ### ✨ Feature: auto-latest Claude model selection + per-workspace overrides
@@ -133,6 +133,14 @@ export class ClaudeSDKProvider {
133
133
  // Aliases "opus" | "sonnet" | "haiku" auto-resolve to the latest tier.
134
134
  const rawModel = options.model ?? this.config.model;
135
135
  const modelOverride = rawModel && rawModel !== "inherit" ? rawModel : undefined;
136
+ // v4.15.1 — Suppress fallbackModel when the primary model is already
137
+ // Haiku. The Agent SDK rejects identical model/fallbackModel pairs with
138
+ // "Fallback model cannot be the same as the main model", which then
139
+ // cascades all the way down the provider fallback chain (→ Ollama
140
+ // on-demand boot → noticeable latency spike). For opus/sonnet/inherit,
141
+ // keep Haiku as the rate-limit fallback.
142
+ const primaryIsHaiku = (modelOverride ?? "").toLowerCase().includes("haiku");
143
+ const fallbackModel = primaryIsHaiku ? undefined : "haiku";
136
144
  const q = query({
137
145
  prompt,
138
146
  options: {
@@ -156,11 +164,11 @@ export class ClaudeSDKProvider {
156
164
  maxTurns: 50,
157
165
  betas: ["context-1m-2025-08-07"],
158
166
  ...(modelOverride ? { model: modelOverride } : {}),
159
- // Always prefer Haiku as fallback on rate-limit/overload — cheap
160
- // and fast, keeps the bot responsive when the primary tier is
161
- // throttled. Users can disable this by setting model: "inherit"
162
- // and relying purely on CLI defaults.
163
- fallbackModel: "haiku",
167
+ // Prefer Haiku as fallback on rate-limit/overload — cheap and
168
+ // fast, keeps the bot responsive when the primary tier is
169
+ // throttled. Omitted when the primary IS Haiku (SDK requires
170
+ // distinct model/fallbackModel values see v4.15.1 fix above).
171
+ ...(fallbackModel ? { fallbackModel } : {}),
164
172
  },
165
173
  });
166
174
  let accumulatedText = "";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "alvin-bot",
3
- "version": "4.15.0",
3
+ "version": "4.15.1",
4
4
  "description": "Alvin Bot \u2014 Your personal AI agent on Telegram, WhatsApp, Discord, Signal, and Web.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",