@link-assistant/hive-mind 1.22.6 → 1.23.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,43 @@
1
1
  # @link-assistant/hive-mind
2
2
 
3
+ ## 1.23.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 5c635fc: Fix agent tool error handling: upload failure logs to PR even when sessionId is not available
8
+ - Remove overly strict sessionId requirement for failure log upload in solve.mjs
9
+ - Add FreeUsageLimitError pattern detection for Agent/OpenCode Zen rate limits
10
+ - Improve rate limit detection by checking multiple sources (lastMessage, errorMatch, fullOutput)
11
+ - Add comprehensive case study documentation for issue #1287
12
+ - Add tests for FreeUsageLimitError detection
13
+
14
+ ## 1.23.0
15
+
16
+ ### Minor Changes
17
+
18
+ - 7a74bc6: Add Kilo Gateway free models support for --tool agent
19
+
20
+ This release adds support for 6 free models from Kilo Gateway:
21
+ - `kilo/glm-5-free` - Z.AI flagship model (free for limited time)
22
+ - `kilo/glm-4.7-free` - Z.AI agent-centric model
23
+ - `kilo/kimi-k2.5-free` - MoonshotAI agentic model
24
+ - `kilo/minimax-m2.1-free` - MiniMax general-purpose model
25
+ - `kilo/giga-potato-free` - Evaluation model
26
+ - `kilo/trinity-large-preview` - Arcee AI preview model
27
+
28
+ Short aliases are also supported (e.g., `glm-5-free`, `kilo-glm-4.7-free`).
29
+
30
+ Usage:
31
+
32
+ ```bash
33
+ solve https://github.com/owner/repo/issues/123 --tool agent --model kilo/glm-5-free
34
+ /solve https://github.com/owner/repo/issues/123 --tool agent --model glm-5-free
35
+ ```
36
+
37
+ See docs/FREE_MODELS.md for comprehensive documentation.
38
+
39
+ Fixes #1282
40
+
3
41
  ## 1.22.6
4
42
 
5
43
  ### Patch Changes
package/README.md CHANGED
@@ -481,9 +481,14 @@ Free Models (with --tool agent):
481
481
  /solve https://github.com/owner/repo/issues/123 --tool agent --model gpt-5-nano
482
482
  /solve https://github.com/owner/repo/issues/123 --tool agent --model glm-4.7-free
483
483
  /solve https://github.com/owner/repo/issues/123 --tool agent --model big-pickle
484
+
485
+ Free Models via Kilo Gateway (with --tool agent):
486
+ /solve https://github.com/owner/repo/issues/123 --tool agent --model kilo/glm-5-free
487
+ /solve https://github.com/owner/repo/issues/123 --tool agent --model kilo/glm-4.7-free
488
+ /solve https://github.com/owner/repo/issues/123 --tool agent --model kilo/kimi-k2.5-free
484
489
  ```
485
490
 
486
- > **šŸ“– Free Models Guide**: See [docs/FREE_MODELS.md](./docs/FREE_MODELS.md) for comprehensive information about all free models.
491
+ > **šŸ“– Free Models Guide**: See [docs/FREE_MODELS.md](./docs/FREE_MODELS.md) for comprehensive information about all free models including OpenCode Zen and Kilo Gateway providers.
487
492
 
488
493
  #### `/hive` - Run Hive Orchestration
489
494
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@link-assistant/hive-mind",
3
- "version": "1.22.6",
3
+ "version": "1.23.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",
package/src/agent.lib.mjs CHANGED
@@ -848,7 +848,18 @@ export const executeAgentCommand = async params => {
848
848
  };
849
849
 
850
850
  // Check for usage limit errors first (more specific)
851
- const limitInfo = detectUsageLimit(lastMessage);
851
+ // Issue #1287: Check multiple sources for usage limit detection:
852
+ // 1. lastMessage (the last chunk of output)
853
+ // 2. errorMatch (the extracted error message from JSON output)
854
+ // 3. fullOutput (complete output - fallback)
855
+ let limitInfo = detectUsageLimit(lastMessage);
856
+ if (!limitInfo.isUsageLimit && outputError.match) {
857
+ limitInfo = detectUsageLimit(outputError.match);
858
+ }
859
+ if (!limitInfo.isUsageLimit) {
860
+ // Fallback: scan fullOutput for usage limit patterns
861
+ limitInfo = detectUsageLimit(fullOutput);
862
+ }
852
863
  if (limitInfo.isUsageLimit) {
853
864
  limitReached = true;
854
865
  limitResetTime = limitInfo.resetTime;
@@ -25,8 +25,9 @@ export const claudeModels = {
25
25
  'claude-haiku-4-5': 'claude-haiku-4-5-20251001', // Haiku 4.5
26
26
  };
27
27
 
28
- // Agent models (OpenCode API via agent CLI)
28
+ // Agent models (OpenCode API and Kilo Gateway via agent CLI)
29
29
  export const agentModels = {
30
+ // OpenCode Zen free models
30
31
  grok: 'opencode/grok-code',
31
32
  'grok-code': 'opencode/grok-code',
32
33
  'grok-code-fast-1': 'opencode/grok-code',
@@ -35,6 +36,14 @@ export const agentModels = {
35
36
  'glm-4.7-free': 'opencode/glm-4.7-free',
36
37
  'minimax-m2.1-free': 'opencode/minimax-m2.1-free',
37
38
  'kimi-k2.5-free': 'opencode/kimi-k2.5-free',
39
+ // Kilo Gateway free models (Issue #1282)
40
+ 'kilo/glm-5-free': 'kilo/glm-5-free',
41
+ 'kilo/glm-4.7-free': 'kilo/glm-4.7-free',
42
+ 'kilo/kimi-k2.5-free': 'kilo/kimi-k2.5-free',
43
+ 'kilo/minimax-m2.1-free': 'kilo/minimax-m2.1-free',
44
+ 'kilo/giga-potato-free': 'kilo/giga-potato-free',
45
+ 'kilo/trinity-large-preview': 'kilo/trinity-large-preview',
46
+ // Premium models
38
47
  sonnet: 'anthropic/claude-3-5-sonnet',
39
48
  haiku: 'anthropic/claude-3-5-haiku',
40
49
  opus: 'anthropic/claude-3-opus',
@@ -102,18 +102,28 @@ export const AGENT_MODELS = {
102
102
  'glm-4.7-free': 'opencode/glm-4.7-free',
103
103
  'minimax-m2.1-free': 'opencode/minimax-m2.1-free',
104
104
  'kimi-k2.5-free': 'opencode/kimi-k2.5-free',
105
+ // Free models (via Kilo Gateway)
106
+ // Issue #1282: Kilo provider adds access to 500+ models including free tier
107
+ // See: https://kilo.ai/docs/advanced-usage/free-and-budget-models
108
+ 'kilo/glm-5-free': 'kilo/glm-5-free', // Z.AI flagship model (free limited time)
109
+ 'kilo/glm-4.7-free': 'kilo/glm-4.7-free', // Z.AI agent-centric model
110
+ 'kilo/kimi-k2.5-free': 'kilo/kimi-k2.5-free', // MoonshotAI agentic model
111
+ 'kilo/minimax-m2.1-free': 'kilo/minimax-m2.1-free', // MiniMax general-purpose
112
+ 'kilo/giga-potato-free': 'kilo/giga-potato-free', // Evaluation model
113
+ 'kilo/trinity-large-preview': 'kilo/trinity-large-preview', // Arcee AI preview
105
114
  // Premium models (requires OpenCode Zen subscription)
106
115
  sonnet: 'anthropic/claude-3-5-sonnet',
107
116
  haiku: 'anthropic/claude-3-5-haiku',
108
117
  opus: 'anthropic/claude-3-opus',
109
118
  'gemini-3-pro': 'google/gemini-3-pro',
110
- // Full model IDs with provider prefix
119
+ // Full model IDs with provider prefix (OpenCode Zen)
111
120
  'opencode/grok-code': 'opencode/grok-code',
112
121
  'opencode/big-pickle': 'opencode/big-pickle',
113
122
  'opencode/gpt-5-nano': 'opencode/gpt-5-nano',
114
123
  'opencode/glm-4.7-free': 'opencode/glm-4.7-free',
115
124
  'opencode/minimax-m2.1-free': 'opencode/minimax-m2.1-free',
116
125
  'opencode/kimi-k2.5-free': 'opencode/kimi-k2.5-free',
126
+ // Premium models with provider prefix
117
127
  'anthropic/claude-3-5-sonnet': 'anthropic/claude-3-5-sonnet',
118
128
  'anthropic/claude-3-5-haiku': 'anthropic/claude-3-5-haiku',
119
129
  'anthropic/claude-3-opus': 'anthropic/claude-3-opus',
package/src/solve.mjs CHANGED
@@ -1112,7 +1112,9 @@ try {
1112
1112
  }
1113
1113
 
1114
1114
  // If --attach-logs is enabled and we have a PR, attach failure logs before exiting
1115
- if (shouldAttachLogs && sessionId && global.createdPR && global.createdPR.number) {
1115
+ // Note: sessionId is not required - logs should be uploaded even if agent failed before establishing a session
1116
+ // This aligns with the pattern in handleFailure() in solve.error-handlers.lib.mjs
1117
+ if (shouldAttachLogs && global.createdPR && global.createdPR.number) {
1116
1118
  await log('\nšŸ“„ Attaching failure logs to Pull Request...');
1117
1119
  try {
1118
1120
  // Build Claude CLI resume command
@@ -44,7 +44,7 @@ export function isUsageLimitError(message) {
44
44
  'rate limit exceeded',
45
45
  'limit reached',
46
46
  'limit has been reached',
47
- // Provider-specific phrasings we’ve seen in the wild
47
+ // Provider-specific phrasings we've seen in the wild
48
48
  'session limit reached', // Claude
49
49
  'weekly limit reached', // Claude
50
50
  'daily limit reached',
@@ -52,7 +52,9 @@ export function isUsageLimitError(message) {
52
52
  'billing hard limit',
53
53
  'please try again at', // Codex/OpenCode style
54
54
  'available again at',
55
- 'resets', // Claude shows: ā€œāˆ™ resets 5amā€
55
+ 'resets', // Claude shows: "āˆ™ resets 5am"
56
+ // Agent/OpenCode Zen specific - issue #1287
57
+ 'freeusagelimiterror', // Agent JSON error type
56
58
  ];
57
59
 
58
60
  return patterns.some(pattern => lowerMessage.includes(pattern));