Lines 742-782javascript
742 // Track if this issue failed
743 let issueFailed = false;
744 // Issue #1823: Track a graceful shutdown stop so it is neither failed nor completed.
745 let gracefulStop = false;
747 // Process the issue multiple times if needed
748 for (let prNum = 1; prNum <= argv.pullRequestsPerIssue; prNum++) {
749 if (argv.pullRequestsPerIssue > 1) {
750 await log(` 📝 Creating PR ${prNum}/${argv.pullRequestsPerIssue} for issue`);
754 // Execute solve command using spawn to enable real-time streaming while avoiding command-stream quoting issues
756 await log(` 🧪 [DRY RUN] Executing ${solveCommand} in dry-run mode for ${issueUrl}...`);
758 await log(` 🚀 Executing ${solveCommand} for ${issueUrl}...`);
761 const startTime = Date.now();
762 // Use spawn to get real-time streaming output while avoiding command-stream's automatic quote addition
763 const { spawn } = await import('child_process');
764 // Auto-forward all solve-passthrough options from hive argv to solve.
765 // New options added to SOLVE_OPTION_DEFINITIONS are automatically forwarded.
766 // See: https://github.com/link-assistant/hive-mind/issues/1209
767 const { getSolvePassthroughOptionNames } = await import('./hive.config.lib.mjs');
768 const { SOLVE_OPTION_DEFINITIONS } = await import('./solve.config.lib.mjs');
769 const kebabToCamel = str => str.replace(/-([a-z])/g, (_, c) => c.toUpperCase());
770 const args = [issueUrl, '--model', argv.model];
771 // Special handling for options with different semantics in hive vs solve
772 // Validate branch name before forwarding (issue #1482: reject URLs used as branch names)
773 const branchValue = argv.baseBranch || argv.targetBranch;
775 const { validateBranchName } = await import('./solve.branch.lib.mjs');
776 const branchValidation = validateBranchName(branchValue);
777 if (!branchValidation.valid) {
778 throw new Error(`Invalid branch name for --base-branch/--target-branch: ${branchValidation.reason}`);
780 args.push('--base-branch', branchValue);
782 if (argv.skipToolConnectionCheck || argv.toolConnectionCheck === false) args.push('--skip-tool-connection-check');