@link-assistant/hive-mind 0.54.6 → 1.0.0
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 +14 -0
- package/README.md +4 -4
- package/package.json +1 -1
- package/src/claude.command-builder.lib.mjs +2 -2
- package/src/hive.config.lib.mjs +2 -2
- package/src/hive.mjs +1 -1
- package/src/solve.auto-continue.lib.mjs +5 -4
- package/src/solve.config.lib.mjs +2 -2
- package/src/solve.mjs +8 -8
- package/src/solve.repository.lib.mjs +1 -1
- package/src/solve.results.lib.mjs +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @link-assistant/hive-mind
|
|
2
2
|
|
|
3
|
+
## 1.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- 4e8d141: Rename `--auto-continue-on-limit-reset` to `--auto-resume-on-limit-reset` for clarity
|
|
8
|
+
|
|
9
|
+
BREAKING CHANGE: The `--auto-continue-on-limit-reset` option has been renamed to `--auto-resume-on-limit-reset`. Users must update their commands and configurations to use the new flag name.
|
|
10
|
+
|
|
11
|
+
The option is related to `--resume` for `claude` command and has an entirely different meaning from `--auto-continue` mode. This rename makes the distinction clearer and aligns the terminology with the resume functionality.
|
|
12
|
+
|
|
13
|
+
Migration:
|
|
14
|
+
- Replace `--auto-continue-on-limit-reset` with `--auto-resume-on-limit-reset` in all commands
|
|
15
|
+
- Update environment variables and configuration files accordingly
|
|
16
|
+
|
|
3
17
|
## 0.54.6
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -223,12 +223,12 @@ See [docs/HELM.md](./docs/HELM.md) for detailed Helm configuration options.
|
|
|
223
223
|
--attach-logs
|
|
224
224
|
--verbose
|
|
225
225
|
--no-tool-check
|
|
226
|
-
--auto-
|
|
226
|
+
--auto-resume-on-limit-reset
|
|
227
227
|
TELEGRAM_SOLVE_OVERRIDES:
|
|
228
228
|
--attach-logs
|
|
229
229
|
--verbose
|
|
230
230
|
--no-tool-check
|
|
231
|
-
--auto-
|
|
231
|
+
--auto-resume-on-limit-reset
|
|
232
232
|
TELEGRAM_BOT_VERBOSE: true
|
|
233
233
|
"
|
|
234
234
|
|
|
@@ -250,12 +250,12 @@ See [docs/HELM.md](./docs/HELM.md) for detailed Helm configuration options.
|
|
|
250
250
|
--attach-logs
|
|
251
251
|
--verbose
|
|
252
252
|
--no-tool-check
|
|
253
|
-
--auto-
|
|
253
|
+
--auto-resume-on-limit-reset
|
|
254
254
|
)" --solve-overrides "(
|
|
255
255
|
--attach-logs
|
|
256
256
|
--verbose
|
|
257
257
|
--no-tool-check
|
|
258
|
-
--auto-
|
|
258
|
+
--auto-resume-on-limit-reset
|
|
259
259
|
)" --verbose
|
|
260
260
|
|
|
261
261
|
# Press CTRL + A + D for detach from screen
|
package/package.json
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
*
|
|
10
10
|
* (cd "/path/to/workdir" && claude --resume <session-id>)
|
|
11
11
|
*
|
|
12
|
-
* This is the same pattern used by --auto-
|
|
12
|
+
* This is the same pattern used by --auto-resume-on-limit-reset and allows users to:
|
|
13
13
|
* 1. Resume sessions directly using Claude CLI (not through solve.mjs)
|
|
14
14
|
* 2. Investigate issues interactively in the working directory
|
|
15
15
|
* 3. Continue work after usage limits reset
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
*
|
|
27
27
|
* This generates a copy-pasteable command that users can execute directly
|
|
28
28
|
* to resume a Claude session in interactive mode. This is the same pattern
|
|
29
|
-
* used by --auto-
|
|
29
|
+
* used by --auto-resume-on-limit-reset.
|
|
30
30
|
*
|
|
31
31
|
* The command includes all necessary flags to match how the original session was run:
|
|
32
32
|
* - --resume <sessionId>: Resume from the specified session
|
package/src/hive.config.lib.mjs
CHANGED
|
@@ -202,9 +202,9 @@ export const createYargsConfig = yargsInstance => {
|
|
|
202
202
|
description: 'Pass --auto-continue to solve for each issue (continues with existing PRs instead of creating new ones)',
|
|
203
203
|
default: true,
|
|
204
204
|
})
|
|
205
|
-
.option('auto-
|
|
205
|
+
.option('auto-resume-on-limit-reset', {
|
|
206
206
|
type: 'boolean',
|
|
207
|
-
description: 'Automatically
|
|
207
|
+
description: 'Automatically resume when AI tool limit resets (calculates reset time and waits). Passed to solve command.',
|
|
208
208
|
default: false,
|
|
209
209
|
})
|
|
210
210
|
.option('think', {
|
package/src/hive.mjs
CHANGED
|
@@ -745,7 +745,7 @@ if (isDirectExecution) {
|
|
|
745
745
|
if (argv.dryRun) args.push('--dry-run');
|
|
746
746
|
if (argv.skipToolConnectionCheck || argv.toolConnectionCheck === false) args.push('--skip-tool-connection-check');
|
|
747
747
|
args.push(argv.autoContinue ? '--auto-continue' : '--no-auto-continue');
|
|
748
|
-
if (argv.
|
|
748
|
+
if (argv.autoResumeOnLimitReset) args.push('--auto-resume-on-limit-reset');
|
|
749
749
|
if (argv.think) args.push('--think', argv.think);
|
|
750
750
|
if (argv.promptPlanSubAgent) args.push('--prompt-plan-sub-agent');
|
|
751
751
|
if (!argv.sentry) args.push('--no-sentry');
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
//
|
|
3
|
+
// Session continuation module for solve command
|
|
4
|
+
// Handles session resumption, PR detection, and limit reset waiting
|
|
4
5
|
// Extracted from solve.mjs to keep files under 1500 lines
|
|
5
6
|
|
|
6
7
|
// Use use-m to dynamically import modules for cross-runtime compatibility
|
|
@@ -103,9 +104,9 @@ export const autoContinueWhenLimitResets = async (issueUrl, sessionId, argv, sho
|
|
|
103
104
|
sessionId,
|
|
104
105
|
];
|
|
105
106
|
|
|
106
|
-
// Preserve auto-
|
|
107
|
-
if (argv.
|
|
108
|
-
resumeArgs.push('--auto-
|
|
107
|
+
// Preserve auto-resume flag
|
|
108
|
+
if (argv.autoResumeOnLimitReset) {
|
|
109
|
+
resumeArgs.push('--auto-resume-on-limit-reset');
|
|
109
110
|
}
|
|
110
111
|
|
|
111
112
|
// Preserve other flags from original invocation
|
package/src/solve.config.lib.mjs
CHANGED
|
@@ -145,9 +145,9 @@ export const createYargsConfig = yargsInstance => {
|
|
|
145
145
|
description: 'Continue with existing PR when issue URL is provided (instead of creating new PR)',
|
|
146
146
|
default: true,
|
|
147
147
|
})
|
|
148
|
-
.option('auto-
|
|
148
|
+
.option('auto-resume-on-limit-reset', {
|
|
149
149
|
type: 'boolean',
|
|
150
|
-
description: 'Automatically
|
|
150
|
+
description: 'Automatically resume when AI tool limit resets (calculates reset time and waits)',
|
|
151
151
|
default: false,
|
|
152
152
|
})
|
|
153
153
|
.option('auto-resume-on-errors', {
|
package/src/solve.mjs
CHANGED
|
@@ -892,10 +892,10 @@ try {
|
|
|
892
892
|
|
|
893
893
|
// Handle limit reached scenario
|
|
894
894
|
if (limitReached) {
|
|
895
|
-
const
|
|
895
|
+
const shouldAutoResumeOnReset = argv.autoResumeOnLimitReset;
|
|
896
896
|
|
|
897
|
-
// If limit was reached but auto-
|
|
898
|
-
if (!
|
|
897
|
+
// If limit was reached but auto-resume-on-limit-reset is NOT enabled, fail immediately
|
|
898
|
+
if (!shouldAutoResumeOnReset) {
|
|
899
899
|
await log('\n❌ USAGE LIMIT REACHED!');
|
|
900
900
|
await log(' The AI tool has reached its usage limit.');
|
|
901
901
|
|
|
@@ -972,9 +972,9 @@ try {
|
|
|
972
972
|
}
|
|
973
973
|
}
|
|
974
974
|
|
|
975
|
-
await safeExit(1, 'Usage limit reached - use --auto-
|
|
975
|
+
await safeExit(1, 'Usage limit reached - use --auto-resume-on-limit-reset to wait for reset');
|
|
976
976
|
} else {
|
|
977
|
-
// auto-
|
|
977
|
+
// auto-resume-on-limit-reset is enabled - attach logs and/or post waiting comment
|
|
978
978
|
if (prNumber && global.limitResetTime) {
|
|
979
979
|
// If --attach-logs is enabled, upload logs with usage limit details
|
|
980
980
|
if (shouldAttachLogs && sessionId) {
|
|
@@ -1030,7 +1030,7 @@ try {
|
|
|
1030
1030
|
// Build Claude CLI resume command
|
|
1031
1031
|
const tool = argv.tool || 'claude';
|
|
1032
1032
|
const resumeCmd = tool === 'claude' ? buildClaudeResumeCommand({ tempDir, sessionId, model: argv.model }) : null;
|
|
1033
|
-
const waitingComment = `⏳ **Usage Limit Reached - Waiting to Continue**\n\nThe AI tool has reached its usage limit. Auto-
|
|
1033
|
+
const waitingComment = `⏳ **Usage Limit Reached - Waiting to Continue**\n\nThe AI tool has reached its usage limit. Auto-resume is enabled with \`--auto-resume-on-limit-reset\`.\n\n**Reset time:** ${global.limitResetTime}\n**Wait time:** ${formatWaitTime(waitMs)} (days:hours:minutes:seconds)\n\nThe session will automatically resume when the limit resets.\n\nSession ID: \`${sessionId}\`${resumeCmd ? `\n\nTo resume manually:\n\`\`\`bash\n${resumeCmd}\n\`\`\`` : ''}`;
|
|
1034
1034
|
|
|
1035
1035
|
const commentResult = await $`gh pr comment ${prNumber} --repo ${owner}/${repo} --body ${waitingComment}`;
|
|
1036
1036
|
if (commentResult.code === 0) {
|
|
@@ -1044,9 +1044,9 @@ try {
|
|
|
1044
1044
|
}
|
|
1045
1045
|
}
|
|
1046
1046
|
|
|
1047
|
-
// Handle failure cases, but skip exit if limit reached with auto-
|
|
1047
|
+
// Handle failure cases, but skip exit if limit reached with auto-resume enabled
|
|
1048
1048
|
// This allows the code to continue to showSessionSummary() where autoContinueWhenLimitResets() is called
|
|
1049
|
-
const shouldSkipFailureExitForAutoLimitContinue = limitReached && argv.
|
|
1049
|
+
const shouldSkipFailureExitForAutoLimitContinue = limitReached && argv.autoResumeOnLimitReset;
|
|
1050
1050
|
|
|
1051
1051
|
if (!success && !shouldSkipFailureExitForAutoLimitContinue) {
|
|
1052
1052
|
// Show claude resume command only for --tool claude (or default) on failure
|
|
@@ -1171,7 +1171,7 @@ export const checkoutPrBranch = async (tempDir, branchName, prForkRemote, prFork
|
|
|
1171
1171
|
// Cleanup temporary directory
|
|
1172
1172
|
export const cleanupTempDirectory = async (tempDir, argv, limitReached) => {
|
|
1173
1173
|
// Determine if we should skip cleanup
|
|
1174
|
-
const shouldKeepDirectory = !argv.autoCleanup || argv.resume || limitReached || (argv.
|
|
1174
|
+
const shouldKeepDirectory = !argv.autoCleanup || argv.resume || limitReached || (argv.autoResumeOnLimitReset && global.limitResetTime);
|
|
1175
1175
|
|
|
1176
1176
|
if (!shouldKeepDirectory) {
|
|
1177
1177
|
try {
|
|
@@ -27,7 +27,7 @@ import { safeExit } from './exit-handler.lib.mjs';
|
|
|
27
27
|
const githubLib = await import('./github.lib.mjs');
|
|
28
28
|
const { sanitizeLogContent, attachLogToGitHub } = githubLib;
|
|
29
29
|
|
|
30
|
-
// Import
|
|
30
|
+
// Import continuation functions (session resumption, PR detection)
|
|
31
31
|
const autoContinue = await import('./solve.auto-continue.lib.mjs');
|
|
32
32
|
const { autoContinueWhenLimitResets } = autoContinue;
|
|
33
33
|
|
|
@@ -376,8 +376,8 @@ export const showSessionSummary = async (sessionId, limitReached, argv, issueUrl
|
|
|
376
376
|
if (limitReached) {
|
|
377
377
|
await log('⏰ LIMIT REACHED DETECTED!');
|
|
378
378
|
|
|
379
|
-
if (argv.
|
|
380
|
-
await log(`\n🔄 AUTO-
|
|
379
|
+
if (argv.autoResumeOnLimitReset && global.limitResetTime) {
|
|
380
|
+
await log(`\n🔄 AUTO-RESUME ON LIMIT RESET ENABLED - Will resume at ${global.limitResetTime}`);
|
|
381
381
|
await autoContinueWhenLimitResets(issueUrl, sessionId, argv, shouldAttachLogs);
|
|
382
382
|
} else {
|
|
383
383
|
if (global.limitResetTime) {
|