@@ -152,6 +152,12 @@ if (!QUEUE_ID) {
152152 return ;
153153 }
154154
155+ // Auto mode: auto-select if exactly one active queue
156+ if (autoYes && activeQueues .length === 1 ) {
157+ QUEUE_ID = activeQueues[0 ].id ;
158+ console .log (` Auto-selected queue: ${ QUEUE_ID } ` );
159+ } else {
160+
155161 // Display and prompt user
156162 console .log (' \n Available Queues:' );
157163 console .log (' ID' .padEnd (22 ) + ' Status' .padEnd (12 ) + ' Progress' .padEnd (12 ) + ' Issues' );
@@ -176,6 +182,7 @@ if (!QUEUE_ID) {
176182 });
177183
178184 QUEUE_ID = answer[' Queue' ];
185+ } // end else (multi-queue prompt)
179186}
180187
181188console .log (` \n ## Executing Queue: ${ QUEUE_ID } \n ` );
@@ -203,6 +210,13 @@ console.log(`
203210- Parallel in batch 1: ${ dag .parallel_batches [0 ]? .length || 0 }
204211` );
205212
213+ // Auto mode: use recommended defaults (Codex + Execute + Worktree)
214+ if (autoYes) {
215+ var executor = 'codex';
216+ var isDryRun = false;
217+ var useWorktree = true;
218+ } else {
219+
206220// Interactive selection via AskUserQuestion
207221const answer = AskUserQuestion({
208222 questions: [
@@ -237,9 +251,10 @@ const answer = AskUserQuestion({
237251 ]
238252});
239253
240- const executor = answer['Executor'].toLowerCase().split(' ')[0]; // codex|gemini|agent
241- const isDryRun = answer['Mode'].includes('Dry-run');
242- const useWorktree = answer['Worktree'].includes('Yes');
254+ var executor = answer['Executor'].toLowerCase().split(' ')[0]; // codex|gemini|agent
255+ var isDryRun = answer['Mode'].includes('Dry-run');
256+ var useWorktree = answer['Worktree'].includes('Yes');
257+ } // end else (interactive selection)
243258
244259// Dry run mode
245260if (isDryRun) {
@@ -451,27 +466,33 @@ if (refreshedDag.ready_count > 0) {
451466if (useWorktree && refreshedDag.ready_count === 0 && refreshedDag.completed_count === refreshedDag.total) {
452467 console.log('\n ## All Solutions Completed - Worktree Cleanup');
453468
454- const answer = AskUserQuestion({
455- questions: [{
456- question: ` Queue complete . What to do with worktree branch " ${worktreeBranch}" ? ` ,
457- header: 'Merge',
458- multiSelect: false,
459- options: [
460- { label: 'Create PR (Recommended)', description: 'Push branch and create pull request' },
461- { label: 'Merge to main', description: 'Merge all commits and cleanup worktree' },
462- { label: 'Keep branch', description: 'Cleanup worktree, keep branch for manual handling' }
463- ]
464- }]
465- });
469+ // Auto mode: Create PR (recommended)
470+ if (autoYes) {
471+ var mergeAction = 'Create PR';
472+ } else {
473+ const answer = AskUserQuestion({
474+ questions: [{
475+ question: ` Queue complete . What to do with worktree branch " ${worktreeBranch}" ? ` ,
476+ header: 'Merge',
477+ multiSelect: false,
478+ options: [
479+ { label: 'Create PR (Recommended)', description: 'Push branch and create pull request' },
480+ { label: 'Merge to main', description: 'Merge all commits and cleanup worktree' },
481+ { label: 'Keep branch', description: 'Cleanup worktree, keep branch for manual handling' }
482+ ]
483+ }]
484+ });
485+ var mergeAction = answer['Merge'];
486+ }
466487
467488 const repoRoot = Bash('git rev-parse --show-toplevel').trim();
468489
469- if (answer['Merge'] .includes('Create PR')) {
490+ if (mergeAction .includes('Create PR')) {
470491 Bash(` git - C " ${worktreePath}" push - u origin " ${worktreeBranch}" ` );
471492 Bash(` gh pr create -- title " Queue ${dag.queue_id}" -- body " Issue queue execution - all solutions completed" -- head " ${worktreeBranch}" ` );
472493 Bash(` git worktree remove " ${worktreePath}" ` );
473494 console.log(` PR created for branch: ${worktreeBranch}` );
474- } else if (answer['Merge'] .includes('Merge to main')) {
495+ } else if (mergeAction .includes('Merge to main')) {
475496 // Check main is clean
476497 const mainDirty = Bash('git status --porcelain').trim();
477498 if (mainDirty) {
0 commit comments