@tjamescouch/gro 1.3.17 → 1.3.18

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.
@@ -135,12 +135,17 @@ function parseResponseContent(data, onToken) {
135
135
  */
136
136
  function supportsAdaptiveThinking(model) {
137
137
  const m = model.toLowerCase();
138
+ // Opus 4.x — supports thinking
138
139
  if (/claude-opus-4/.test(m))
139
140
  return true;
140
- if (/claude-sonnet-4/.test(m))
141
+ // Sonnet 4 dated builds (e.g. claude-sonnet-4-20250514) — supports thinking
142
+ // Sonnet 4.5 (claude-sonnet-4-5) does NOT support adaptive thinking
143
+ if (/claude-sonnet-4-\d{8}/.test(m))
141
144
  return true;
145
+ // Claude 3.7 Sonnet — supports thinking
142
146
  if (/claude-3[.-]7/.test(m))
143
147
  return true;
148
+ // Claude 3.5 Sonnet (Oct 2024) — supports thinking
144
149
  if (/claude-3[.-]5-sonnet.*20241022/.test(m))
145
150
  return true;
146
151
  return false;
@@ -197,6 +202,12 @@ export function makeAnthropicDriver(cfg) {
197
202
  continue;
198
203
  }
199
204
  const text = await res.text().catch(() => "");
205
+ // If 400 due to thinking not supported, retry without thinking params
206
+ if (res.status === 400 && body.thinking && /thinking|not supported/i.test(text)) {
207
+ Logger.warn(`Model ${resolvedModel} rejected adaptive thinking — retrying without`);
208
+ delete body.thinking;
209
+ continue;
210
+ }
200
211
  const ge = groError("provider_error", `Anthropic API failed (${res.status}): ${text}`, {
201
212
  provider: "anthropic",
202
213
  model: resolvedModel,
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tjamescouch/gro",
3
- "version": "1.3.17",
3
+ "version": "1.3.18",
4
4
  "description": "Provider-agnostic LLM runtime with context management",
5
5
  "bin": {
6
6
  "gro": "./dist/main.js"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tjamescouch/gro",
3
- "version": "1.3.17",
3
+ "version": "1.3.18",
4
4
  "description": "Provider-agnostic LLM runtime with context management",
5
5
  "bin": {
6
6
  "gro": "./dist/main.js"