Skip to content

feat: allow skipping tasks that exceed time/cost threshold in auto mode #87

@rubenmarcus

Description

@rubenmarcus

Feature: Interactive controls during auto mode loops

Problem

In auto mode, once the loop starts, the user has no way to interact with it. If a task is stuck, taking too long, or the user realizes it should be skipped, they have to kill the entire process and restart.

Proposed: Live interaction during loops

While auto mode is running, the user should be able to interact with the loop in real-time via the terminal:

Interactive keybinds (during loop execution)

Key Action
s Skip — stop current task, move to next in queue
p Pause — pause after current iteration, wait for resume
r Resume — continue after pause
d Debug — toggle verbose output (agent commands, file reads/writes, tool calls, errors in real-time)
i Info — show current task, iteration count, elapsed time, cost so far
h Hint — pause and let user type a one-line instruction for the agent to consider next iteration (e.g., "try using esm imports instead")
q Quit — graceful shutdown after current iteration completes

Debug mode detail

When d is pressed, toggle between:

  • Normal mode (default): shows iteration number, pass/fail status, cost per iteration
  • Debug mode: streams the agent's activity in real-time:
    • Files being read/written
    • Commands being executed + their output
    • Tool calls and their results
    • Validation output (build/test results)
    • Error messages and stack traces

Debug mode is especially useful when:

  • A task keeps failing and you can't tell why from the summary
  • You want to verify the agent isn't going in circles
  • You want to learn what approach the agent is taking before deciding to skip

Toggle on/off anytime with d. Debug state persists across iterations until toggled off.

UX during the loop

🔄 Task 3/7: feat: scaffold Next.js landing page
   Iteration 4/10 | 2m 13s | $0.84
   [s] skip  [p] pause  [d] debug  [i] info  [h] hint  [q] quit

With debug on:

🔄 Task 3/7: feat: scaffold Next.js landing page  [DEBUG ON]
   Iteration 4/10 | 2m 13s | $0.84
   │ READ package.json
   │ EDIT src/app/page.tsx (lines 12-34)
   │ BASH npm run build
   │ └─ error TS2307: Cannot find module './components/Hero'
   │ EDIT src/app/page.tsx (line 2) — fixing import
   │ BASH npm run build
   │ └─ ✓ compiled successfully
   [s] skip  [p] pause  [d] debug off  [i] info  [h] hint  [q] quit

Additionally: pre-configured thresholds (optional)

For unattended runs (overnight, CI), set automatic skip thresholds via CLI flags:

  • --max-time-per-task 30m — skip task if it exceeds N minutes
  • --max-cost-per-task 5 — skip task if it exceeds $N
  • --debug — start with debug mode on from the beginning

These work alongside interactive controls — if the user is watching, they can interact manually. If running unattended, the thresholds kick in automatically.

When a task is skipped (manual or automatic)

  • Log the skip reason in activity.md (user-skipped vs timeout vs cost-limit)
  • Comment on the issue explaining it was skipped and include last error if available
  • Optionally label the issue (e.g., needs-human-review)
  • Move on to the next task in the queue

Use cases

  1. Watching the loop — user sees a task is struggling, presses s to skip and move on
  2. Debugging a stuck task — press d to see what the agent is doing, realize it's looping on the same error, press h to give it a hint
  3. Quick check — press i to see elapsed time and cost
  4. Overnight batch — set --max-time-per-task 20m and let it run unattended
  5. Redirecting the agent — press h and type "the test needs jsdom, add it to vitest config" to nudge it in the right direction

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions