@link-assistant/hive-mind 2.8.11 → 2.9.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
@@ -1,5 +1,17 @@
1
1
  # @link-assistant/hive-mind
2
2
 
3
+ ## 2.9.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 3e48cb3: Resume Codex sessions after transient high-demand failures and preserve uncommitted work before uploading failure logs.
8
+
9
+ ## 2.9.0
10
+
11
+ ### Minor Changes
12
+
13
+ - 42c4e91: Add full support for Claude Opus 5 (`claude-opus-5`) and make it the default model for `--tool claude` (and therefore for the `/claude` and `/solve` commands). The bare `opus` alias now resolves to `claude-opus-5` (previously `claude-opus-4-8`). Opus 5 supports 1M context (`[1m]`), the full effort ladder including `xhigh` and `max`, 128K max output tokens, and adaptive-thinking-only environment handling. Explicit `opus-5`/`claude-opus-5` aliases now correctly receive `xhigh` effort. The `opus-4-8`/`claude-opus-4-8` (and earlier) aliases are retained for backward compatibility. (Issue #2096)
14
+
3
15
  ## 2.8.11
4
16
 
5
17
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@link-assistant/hive-mind",
3
- "version": "2.8.11",
3
+ "version": "2.9.1",
4
4
  "description": "AI-powered issue solver and hive mind for collaborative problem solving",
5
5
  "main": "src/hive.mjs",
6
6
  "type": "module",
@@ -209,7 +209,7 @@ export const isOpus46OrLater = model => {
209
209
  if (!model) return false;
210
210
  const normalizedModel = model.toLowerCase();
211
211
  // Check for explicit opus-4-6 or later versions, or opusplan (Issue #1223)
212
- // Note: The 'opus' alias now maps to Opus 4.8 (Issue #1832), so we also check for the alias directly
212
+ // Note: The 'opus' alias now maps to Opus 5 (Issue #2096), so we also check for the alias directly
213
213
  // opusplan uses Opus for planning, so it should get Opus-level settings
214
214
  return normalizedModel === 'opus' || normalizedModel === 'opusplan' || normalizedModel.includes('opus-4-6') || normalizedModel.includes('opus-4-7') || normalizedModel.includes('opus-4-8') || normalizedModel.includes('opus-5');
215
215
  };
@@ -217,7 +217,7 @@ export const isOpus46OrLater = model => {
217
217
  const isOpus47 = model => {
218
218
  if (!model) return false;
219
219
  const normalizedModel = model.toLowerCase();
220
- // 'opus' alias now maps to Opus 4.8 (Issue #1832), which inherits 4.7 behaviour
220
+ // 'opus' alias now maps to Opus 5 (Issue #2096), which inherits 4.7/4.8 behaviour
221
221
  // opusplan uses Opus for planning, so it gets Opus-level settings
222
222
  return normalizedModel === 'opus' || normalizedModel === 'opusplan' || normalizedModel.includes('opus-4-7') || normalizedModel.includes('opus-4-8');
223
223
  };
@@ -246,10 +246,26 @@ export const isOpus47OrLater = model => {
246
246
  export const isOpus48OrLater = model => {
247
247
  if (!model) return false;
248
248
  const normalizedModel = model.toLowerCase();
249
- // 'opus' alias now maps to Opus 4.8 (Issue #1832)
249
+ // 'opus' alias now maps to Opus 5 (Issue #2096)
250
250
  return normalizedModel === 'opus' || normalizedModel === 'opusplan' || normalizedModel.includes('opus-4-8') || normalizedModel.includes('opus-5');
251
251
  };
252
252
 
253
+ /**
254
+ * Check if a model is Claude Opus 5 (Issue #2096)
255
+ * Opus 5 (`claude-opus-5`) is the current default for `--tool claude` (the bare
256
+ * `opus` alias now resolves to it). Like Opus 4.8 it supports the full effort ladder
257
+ * (low/medium/high/xhigh/max), up to 128k output tokens, a 1M context window, and uses
258
+ * adaptive thinking only (extended/manual thinking with an explicit budget is
259
+ * unavailable). See: https://www.anthropic.com/news/claude-opus-5
260
+ * @param {string} model - The model name or ID
261
+ * @returns {boolean} True if the model is Claude Opus 5
262
+ */
263
+ export const isOpus5 = model => {
264
+ if (!model) return false;
265
+ const m = model.toLowerCase();
266
+ return m === 'opus' || m === 'opus-5' || m.includes('opus-5');
267
+ };
268
+
253
269
  const isOpus45 = model => {
254
270
  if (!model) return false;
255
271
  const m = model.toLowerCase();
@@ -294,7 +310,7 @@ const isMythosPreview = model => {
294
310
  * Fable 5 (`claude-fable-5`) is Anthropic's most capable widely released model
295
311
  * (generally available June 9, 2026). It is a Mythos-class model wrapped in safety
296
312
  * classifiers that can refuse high-risk requests (returning stop_reason "refusal")
297
- * and fall back to Claude Opus 4.8.
313
+ * and fall back to Claude Opus (the bare `opus` alias, now Opus 5).
298
314
  * @param {string} model - The model name or ID
299
315
  * @returns {boolean} True if the model is Claude Fable 5
300
316
  */
@@ -360,11 +376,11 @@ export const supportsAdaptiveThinking = model => {
360
376
  /**
361
377
  * Check if a model supports the xhigh effort level.
362
378
  * Official docs list xhigh for Claude Fable 5, Claude Mythos 5, Claude Opus 4.7,
363
- * Opus 4.8, and Sonnet 5 (Issue #1832, Issue #1875, Issue #2003).
379
+ * Opus 4.8, Opus 5, and Sonnet 5 (Issue #1832, Issue #1875, Issue #2003, Issue #2096).
364
380
  * @param {string} model - The model name or ID
365
381
  * @returns {boolean} True if the model supports xhigh effort
366
382
  */
367
- export const supportsXHighEffortLevel = model => isFable5OrMythos5(model) || isOpus47(model) || isSonnet5(model);
383
+ export const supportsXHighEffortLevel = model => isFable5OrMythos5(model) || isOpus47(model) || isOpus5(model) || isSonnet5(model);
368
384
 
369
385
  /**
370
386
  * Check if a model supports the max effort level.
@@ -492,9 +508,9 @@ export const describeRequestedThinking = (argv = {}) => {
492
508
  export const OPUS_46_EFFORT_LEVELS = ['low', 'medium', 'high', 'max'];
493
509
 
494
510
  /**
495
- * Valid effort levels for Opus 4.7 and Opus 4.8 (Issue #1620, Issue #1832)
496
- * Both models support the additional 'xhigh' level.
497
- * Opus 4.8 keeps the same effort level set; the default effort level is 'high'
511
+ * Valid effort levels for Opus 4.7, Opus 4.8, and Opus 5 (Issue #1620, Issue #1832, Issue #2096)
512
+ * These models support the additional 'xhigh' level.
513
+ * Opus 5 keeps the same effort level set as Opus 4.8; the default effort level is 'high'
498
514
  * (enforced by Claude Code itself, not by this module).
499
515
  * See: https://platform.claude.com/docs/en/build-with-claude/effort
500
516
  * @type {string[]}
@@ -29,11 +29,11 @@ const execFileAsync = promisify(execFile);
29
29
  // ─── MODEL DATA ──────────────────────────────────────────────────────────────
30
30
 
31
31
  // Claude models (Anthropic API)
32
- // Updated for Opus 4.5/4.6/4.7/4.8, Sonnet 4.6/5, and Fable 5 / Mythos 5 support
33
- // (Issue #1221, Issue #1238, Issue #1329, Issue #1433, Issue #1620, Issue #1832, Issue #1875, Issue #2003)
32
+ // Updated for Opus 4.5/4.6/4.7/4.8/5, Sonnet 4.6/5, and Fable 5 / Mythos 5 support
33
+ // (Issue #1221, Issue #1238, Issue #1329, Issue #1433, Issue #1620, Issue #1832, Issue #1875, Issue #2003, Issue #2096)
34
34
  export const claudeModels = {
35
- sonnet: 'claude-sonnet-5', // Sonnet 5 (default, Issue #2003)
36
- opus: 'claude-opus-4-8', // Opus 4.8 (Issue #1832)
35
+ sonnet: 'claude-sonnet-5', // Sonnet 5 (Issue #2003)
36
+ opus: 'claude-opus-5', // Opus 5 (default, Issue #2096)
37
37
  haiku: 'claude-haiku-4-5-20251001', // Haiku 4.5
38
38
  'haiku-3-5': 'claude-3-5-haiku-20241022', // Haiku 3.5
39
39
  'haiku-3': 'claude-3-haiku-20240307', // Haiku 3
@@ -48,13 +48,15 @@ export const claudeModels = {
48
48
  // Shorter version aliases (Issue #1221, Issue #1329 - PR comment feedback)
49
49
  'sonnet-5': 'claude-sonnet-5', // Sonnet 5 short alias (Issue #2003)
50
50
  'sonnet-4-6': 'claude-sonnet-4-6', // Sonnet 4.6 short alias (Issue #1329)
51
+ 'opus-5': 'claude-opus-5', // Opus 5 short alias (Issue #2096)
51
52
  'opus-4-8': 'claude-opus-4-8', // Opus 4.8 short alias (Issue #1832)
52
53
  'opus-4-7': 'claude-opus-4-7', // Opus 4.7 short alias (backward compatibility)
53
54
  'opus-4-6': 'claude-opus-4-6', // Opus 4.6 short alias (backward compatibility)
54
55
  'opus-4-5': 'claude-opus-4-5-20251101', // Opus 4.5 short alias
55
56
  'sonnet-4-5': 'claude-sonnet-4-5-20250929', // Sonnet 4.5 short alias (backward compatibility)
56
57
  'haiku-4-5': 'claude-haiku-4-5-20251001', // Haiku 4.5 short alias
57
- // Version aliases for backward compatibility (Issue #1221, Issue #1329, Issue #1620, Issue #1832)
58
+ // Version aliases for backward compatibility (Issue #1221, Issue #1329, Issue #1620, Issue #1832, Issue #2096)
59
+ 'claude-opus-5': 'claude-opus-5', // Opus 5 (Issue #2096)
58
60
  'claude-opus-4-8': 'claude-opus-4-8', // Opus 4.8 (Issue #1832)
59
61
  'claude-opus-4-7': 'claude-opus-4-7', // Opus 4.7 (backward compatibility)
60
62
  'claude-sonnet-5': 'claude-sonnet-5', // Sonnet 5 (Issue #2003)
@@ -230,7 +232,7 @@ export const geminiModels = {
230
232
 
231
233
  // Default model for each tool (Issue #1473: centralized to avoid scattered hardcoded defaults)
232
234
  export const defaultModels = {
233
- claude: 'opus', // Issue #2033: Opus is the preferred default for Claude; sonnet remains available explicitly
235
+ claude: 'opus', // Issue #2033: Opus is the preferred default for Claude; sonnet remains available explicitly. Opus now maps to Opus 5 (Issue #2096)
234
236
  agent: 'nemotron-3-super-free', // Issue #1563: changed from qwen3.6-plus-free (free promotion ended) per agent PR #243
235
237
  opencode: 'grok-code-fast-1',
236
238
  codex: 'gpt-5.6-sol', // Issue #2027: GPT-5.6 Sol is the released Codex flagship; runtime falls back to gpt-5.5 when Sol is not in the local catalog
@@ -254,10 +256,12 @@ export const MODELS_SUPPORTING_1M_CONTEXT = [
254
256
  'claude-sonnet-4-6', // Sonnet 4.6 (Issue #1329)
255
257
  'claude-sonnet-4-5-20250929',
256
258
  'claude-sonnet-4-5',
259
+ 'claude-opus-5', // Opus 5 — 1M context (Issue #2096)
257
260
  'sonnet', // Now maps to Sonnet 5 (Issue #2003)
258
261
  'sonnet-5', // Short alias (Issue #2003)
259
262
  'sonnet-4-6', // Short alias (Issue #1329)
260
- 'opus', // Now maps to Opus 4.8 (Issue #1832)
263
+ 'opus', // Now maps to Opus 5 (Issue #2096)
264
+ 'opus-5', // Short alias (Issue #2096)
261
265
  'opus-4-8', // Short alias (Issue #1832)
262
266
  'opus-4-7', // Short alias (Issue #1620)
263
267
  'opus-4-6', // Short alias (Issue #1221 - PR comment feedback)
@@ -290,6 +294,7 @@ export const CLAUDE_MODELS = {
290
294
  ...claudeModels,
291
295
  'claude-fable-5': 'claude-fable-5', // Fable 5 full ID (Issue #1875)
292
296
  'claude-mythos-5': 'claude-mythos-5', // Mythos 5 full ID (Issue #1875)
297
+ 'claude-opus-5': 'claude-opus-5', // Opus 5 full ID (Issue #2096)
293
298
  'claude-opus-4-8': 'claude-opus-4-8', // Opus 4.8 full ID (Issue #1832)
294
299
  'claude-opus-4-7': 'claude-opus-4-7', // Opus 4.7 full ID (Issue #1620)
295
300
  'claude-sonnet-4-5-20250929': 'claude-sonnet-4-5-20250929',
@@ -1231,12 +1236,14 @@ export const resolveModelId = (requestedModel, tool) => {
1231
1236
  export const defaultFallbackModels = {
1232
1237
  claude: {
1233
1238
  // Claude Fable 5's safety classifiers can refuse high-risk requests and hand them
1234
- // off to Claude Opus 4.8; mirror that documented fallback here (Issue #1875).
1239
+ // off to Claude Opus; mirror that documented fallback here (Issue #1875).
1235
1240
  // See: https://platform.claude.com/docs/en/about-claude/models/introducing-claude-fable-5-and-claude-mythos-5
1236
1241
  'claude-fable-5': 'opus',
1237
1242
  // Claude Mythos 5 (limited availability) falls back to the generally available
1238
1243
  // Mythos-class model, Claude Fable 5 (Issue #1875).
1239
1244
  'claude-mythos-5': 'fable',
1245
+ // Claude Opus 5 falls back to the prior Opus generation (Issue #2096).
1246
+ 'claude-opus-5': 'opus-4-8',
1240
1247
  'claude-opus-4-8': 'opus-4-7',
1241
1248
  'claude-opus-4-7': 'opus-4-6',
1242
1249
  // Claude Sonnet 5 falls back to the prior Sonnet generation (Issue #2003).
@@ -354,7 +354,7 @@ export const SOLVE_OPTION_DEFINITIONS = {
354
354
  },
355
355
  'fallback-model': {
356
356
  type: 'string',
357
- description: 'Fallback model to switch to on model capacity/overload errors (and, for Fable 5, on safety-classifier refusals). When supported, retries resume the same session with this model. An explicit value is pinned exactly; the built-in defaults form a chain that steps to the next-closest model on repeated capacity errors. Defaults: claude fable/claude-fable-5 -> opus (Opus 4.8); claude mythos-5/claude-mythos-5 -> fable; claude opus/opus-4-8 -> opus-4-7; claude opus-4-7 -> opus-4-6; codex gpt-5.6-sol -> gpt-5.6-terra -> gpt-5.6-luna -> gpt-5.5 -> gpt-5.4; all others unset.',
357
+ description: 'Fallback model to switch to on model capacity/overload errors (and, for Fable 5, on safety-classifier refusals). When supported, retries resume the same session with this model. An explicit value is pinned exactly; the built-in defaults form a chain that steps to the next-closest model on repeated capacity errors. Defaults: claude fable/claude-fable-5 -> opus (Opus 5); claude mythos-5/claude-mythos-5 -> fable; claude opus/opus-5 -> opus-4-8; claude opus-4-8 -> opus-4-7; claude opus-4-7 -> opus-4-6; codex gpt-5.6-sol -> gpt-5.6-terra -> gpt-5.6-luna -> gpt-5.5 -> gpt-5.4; all others unset.',
358
358
  default: undefined,
359
359
  },
360
360
  'sub-agent-model': {
@@ -364,7 +364,7 @@ export const SOLVE_OPTION_DEFINITIONS = {
364
364
  },
365
365
  'show-thinking-content': {
366
366
  type: 'boolean',
367
- description: 'Show thinking content in Claude responses. Opus 4.7+ omits thinking content by default (applies to Opus 4.8 as well); this option opts in to receive summarized thinking blocks. Disabled by default. Only affects --tool claude.',
367
+ description: 'Show thinking content in Claude responses. Opus 4.7+ omits thinking content by default (applies to Opus 4.8 and Opus 5 as well); this option opts in to receive summarized thinking blocks. Disabled by default. Only affects --tool claude.',
368
368
  default: false,
369
369
  },
370
370
  'prompt-plan-sub-agent': {
@@ -79,10 +79,12 @@ const TIER_ALIASES = {
79
79
  'claude-sonnet-4-6': 'sonnet',
80
80
  'claude-sonnet-4-5': 'sonnet',
81
81
  opus: 'opus',
82
+ 'opus-5': 'opus',
82
83
  'opus-4-8': 'opus',
83
84
  'opus-4-7': 'opus',
84
85
  'opus-4-6': 'opus',
85
86
  'opus-4-5': 'opus',
87
+ 'claude-opus-5': 'opus',
86
88
  'claude-opus-4-8': 'opus',
87
89
  'claude-opus-4-7': 'opus',
88
90
  fable: 'fable',
package/src/solve.mjs CHANGED
@@ -1117,6 +1117,17 @@ try {
1117
1117
  await log('');
1118
1118
  }
1119
1119
 
1120
+ // Preserve work before remote diagnostics; issue #2101 ended during log upload.
1121
+ try {
1122
+ const { criticalErrorRecovery } = await import('./config.lib.mjs');
1123
+ if (criticalErrorRecovery.autoCommitUncommittedChanges) {
1124
+ const { commitUncommittedChangesOnCriticalError } = await import('./critical-error-commit.lib.mjs');
1125
+ await commitUncommittedChangesOnCriticalError({ tempDir, branchName, $, log, reason: toolFailureMessage });
1126
+ }
1127
+ } catch (preserveError) {
1128
+ await log(` ⚠️ Could not auto-commit before failure exit: ${preserveError.message}`, { verbose: true });
1129
+ }
1130
+
1120
1131
  // Attach failure logs before exiting (Issues #1212, #1462: fall back to issue if no PR)
1121
1132
  const hasPR = global.createdPR && global.createdPR.number;
1122
1133
  const hasIssue = global.issueNumber;
@@ -1167,19 +1178,6 @@ try {
1167
1178
  }
1168
1179
  }
1169
1180
 
1170
- // Issue #1834 (PR #1835 feedback): "on all critical errors we auto commit uncommitted changes by
1171
- // default." A failed session exits here before the normal auto-commit chokepoint below, so commit
1172
- // + push any work first. On by default; disable via HIVE_MIND_AUTO_COMMIT_ON_CRITICAL_ERROR=false.
1173
- try {
1174
- const { criticalErrorRecovery } = await import('./config.lib.mjs');
1175
- if (criticalErrorRecovery.autoCommitUncommittedChanges) {
1176
- const { commitUncommittedChangesOnCriticalError } = await import('./critical-error-commit.lib.mjs');
1177
- await commitUncommittedChangesOnCriticalError({ tempDir, branchName, $, log, reason: toolFailureMessage });
1178
- }
1179
- } catch (preserveError) {
1180
- await log(` ⚠️ Could not auto-commit before failure exit: ${preserveError.message}`, { verbose: true });
1181
- }
1182
-
1183
1181
  await safeExit(1, toolFailureMessage);
1184
1182
  }
1185
1183
 
@@ -47,7 +47,11 @@ export const classifyRetryableError = value => {
47
47
  // overloaded API anyway. Claude Code already exposes its own per-request fallback
48
48
  // via `--fallback-model` (wired in claude.lib.mjs), so we keep `--model` stable and
49
49
  // simply retry. Therefore isCapacity is false → retry with the same model.
50
- if (lower.includes('overloaded') || lower.includes('overloaded_error')) {
50
+ // Issue #2101: Codex may exhaust its internal WebSocket/HTTPS attempts and
51
+ // surface only "We're currently experiencing high demand, which may cause
52
+ // temporary errors." The terminal message omits both the preceding 503 and
53
+ // the backend's concurrency_limit code, so it must be recognized directly.
54
+ if (lower.includes('overloaded') || lower.includes('overloaded_error') || lower.includes('currently experiencing high demand') || lower.includes('too many concurrent requests') || lower.includes('concurrency_limit')) {
51
55
  return { message, isRetryable: true, isCapacity: false, label: 'API overload' };
52
56
  }
53
57