@link-assistant/hive-mind 1.23.0 ā 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 +11 -0
- package/package.json +1 -1
- package/src/agent.lib.mjs +12 -1
- package/src/solve.mjs +3 -1
- package/src/usage-limit.lib.mjs +4 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
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
|
+
|
|
3
14
|
## 1.23.0
|
|
4
15
|
|
|
5
16
|
### Minor Changes
|
package/package.json
CHANGED
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
|
-
|
|
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;
|
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
|
-
|
|
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
|
package/src/usage-limit.lib.mjs
CHANGED
|
@@ -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
|
|
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:
|
|
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));
|