Problem
Currently, Qoder lacks a native mechanism for goal-driven autonomous execution. When working on complex, multi-step tasks, the Agent processes one round of work and stops — even if the overall goal hasn’t been achieved yet. Users must manually send “continue” messages to keep the Agent working, which breaks the flow for long-running tasks.
This is particularly painful for:
- Large refactoring tasks that require iterative verification
- Multi-file changes with test-driven validation
- Tasks where the Agent needs to try multiple approaches before succeeding
- Any task that naturally requires “plan → execute → verify → iterate” cycles
While Qoder provides Planning Agent (/plan) and Quest (Spec-driven) for structured planning, neither supports autonomous multi-round looping — the ability to set a goal with acceptance criteria and have the Agent automatically continue working across rounds until all criteria are met.
Solution
Add a native /goal command that implements goal-driven autonomous execution:
Core Mechanism
/goal <task description with acceptance criteria>
- Goal Setup: Agent parses the user’s input into a goal description + measurable acceptance criteria
- Autonomous Loop: After each response round, Qoder automatically checks if all acceptance criteria are met:
Not met → Agent automatically continues to the next round (no user intervention needed)
All met → Agent stops normally with a completion summary
- Failure Handling: If a step fails, the Agent automatically retries with alternative approaches (up to N times) before skipping
- Progress Report: Each round ends with a brief status update showing completed/remaining criteria
- Max Rounds Protection: Configurable max rounds (default: 20) to prevent infinite loops
Subcommands
/goal - Set a new goal (with task description)
/goal status - Show current goal progress
/goal pause - Pause the autonomous loop
/goal resume - Resume a paused goal
/goal clear - Clear the goal and stop the loop
Acceptance Criteria Examples
The Agent should auto-infer acceptance criteria from the task description, or users can specify explicitly:
/goal Replace all print() with logging in server/. Acceptance: zero print() calls remain, all tests pass.
How It Differs from Existing Features
| Feature | Planning Agent (/plan) |
Quest (Spec-driven) | Proposed /goal |
|---|---|---|---|
| Structured planning | |||
| Step-by-step execution | |||
| Auto multi-round loop | |||
| Auto goal achievement check | |||
| Auto retry on failure | |||
| Pause/resume | |||
| Max round protection |
Use Case
Scenario 1: Large Refactoring
/goal Migrate all database queries from raw SQL to SQLAlchemy ORM. Acceptance: no raw SQL strings remain in server/, all existing tests pass, no new lint errors.
The Agent would work across multiple rounds — refactoring files, running tests, fixing failures, iterating — until all criteria are met, without requiring the user to say “continue” after each round.
Scenario 2: Test-Driven Feature Development
/goal Add batch subtitle download API endpoint. Acceptance: endpoint returns correct ASS file for given batch_id, error handling for invalid IDs, integration tests pass.
Scenario 3: Codebase Cleanup
/goal Remove all deprecated v8/v9/v10 pipeline scripts and update imports. Acceptance: no import errors, pytest passes, git status clean.
In all cases, the user sets the goal and walks away. The Agent works autonomously, reporting progress each round, and only stops when the goal is achieved or it hits an unrecoverable blocker.
Priority
-
High - Blocking issue -
Medium - Important improvement -
Low - Nice to have
Additional Info
Workaround (current)
We’ve implemented a hook-based workaround using Qoder’s Stop Hook + Custom Command:
- A custom
/goalcommand creates agoal-state.jsonfile with goal description, acceptance criteria, and round counter - A
Stophook checksgoal-state.jsonwhen the Agent tries to stop — if criteria aren’t met, it returnsexit 2to block the stop and injects a “continue working” message - This creates an autonomous loop:
work → stop attempt → hook blocks → work → ... → all criteria met → hook allows stop
Files:
.qoder/commands/goal.md— Custom command with goal parsing, TodoWrite integration, and jq-based state updates.qoder/hooks/goal-loop.sh— Stop hook that reads goal state and blocks stop if criteria unmet.qoder/settings.local.json— Hook registration
Limitations of the workaround:
- Stop hook
exit 2blocking is only fully supported in Qoder CLI, not consistently in IDE - Requires manual state file management (jq updates) which the Agent may forget to do
- No native pause/resume — relies on file-based state
- State file can become stale if Agent crashes mid-task
Prior Art
- OpenAI Codex CLI: Native
/goalcommand with autonomous loop, pause/resume, and goal achievement checking - Claude Code: Similar mechanism (v2.1.139+) with persistent goals and auto-continuation
A native implementation would eliminate the state management complexity, work consistently across IDE and CLI, and integrate seamlessly with Qoder’s existing Planning Agent and TodoWrite systems.