Qwen Code 0.23.4 Goal limits: stop autonomous runs by turns or active time
Quick answer
Qwen Code v0.23.4, released on September 14, 2026, adds two optional runtime ceilings for long-running Goals: model.goalMaxTurns and model.goalMaxActiveMinutes. The first counts finished Goal turns. The second counts wall-clock time while the Goal is active. When a configured ceiling is reached, Qwen Code allows one wind-down turn, then moves the Goal to usage_limited until a user resumes it.
These are runtime controls, not prose in the Goal objective. They are disabled by default, require a restart, and apply only to Goals created afterward. Canary both ceilings and keep the token budget as a separate spend guard.
Who this is for
This guide is for developers using Qwen Code Goals for unattended tests, migrations, research, or multi-step repository work, especially when a Goal can remain active between turns or wait on tools.
If your problem is deciding whether a Goal has enough evidence to claim completion, use the Qwen Code Goal evidence checklist. This article solves a different task: enforcing how long autonomous continuation is authorized to run.
What changed—and what the limits mean
Before this release, a sentence such as “stop after 20 turns” in the objective was guidance the model might follow; it did not configure a runtime timer. Qwen Code already tracked turnCount and activeTimeMs, but the runtime had no corresponding ceilings. Version 0.23.4 connects those meters to two opt-in settings.
| Control | Measures | Important boundary |
|---|---|---|
goalMaxTurns |
Every finished Goal turn, including user-driven turns | The crossing turn completes; the next autonomous continuation becomes the wind-down turn |
goalMaxActiveMinutes |
Wall time while the Goal remains active, including waits and idle time between turns | It is checked between turns, not by a mid-turn timer, so a long turn can exceed it |
| Token budget | Model tokens counted by the Goal meter | It remains a spend guard and takes priority if one turn crosses multiple ceilings |
Paused, blocked, stopped, and process-downtime periods do not consume the window. A suspended process can still consume it while the Goal remains active.
Configure a bounded canary
Use a low-risk repository with deterministic checks and no production credentials. The settings live under model:
{
"model": {
"goalMaxTurns": 20,
"goalMaxActiveMinutes": 30
}
}
Restart Qwen Code, then create a new Goal. Settings do not retrofit ceilings onto an existing Goal. Replacing one starts revision 1 with reset meters and a new evidence boundary.
Both values must be positive integers. Use -1 to express no ceiling; 0 is rejected. Qwen Code caps the configured turn ceiling at 10,000 and the active-time ceiling at 10,080 minutes. Treat those maxima as typo guards, not recommended operating targets.
Choose initial values from observable work. A 20-turn limit may fit a bounded migration; a 30-minute limit may fit a test-and-fix loop. Neither guarantees progress. Pair them with a named test, immutable artifact, or current deployment receipt.
Run seven acceptance cases
| Case | Expected evidence |
|---|---|
| Turn ceiling | After the configured number of finished turns, exactly one wind-down turn runs and the Goal settles as usage_limited with limitKind: turn_budget
|
| Time ceiling | A Goal that accumulates the configured active time stops at a continuation boundary with limitKind: time_budget
|
| Long crossing turn | The current turn is not killed midway; its elapsed time may exceed the configured minutes before the boundary is evaluated |
| Pause and restart | Paused time and process downtime do not consume the window; a restored active Goal's in-flight clock is rebased |
| Resume |
/goal resume grants another window above the amount already used; the historical counters do not reset |
| Dual ceiling | Only the ceiling that was spent moves on resume; an unspent ceiling remains unchanged |
| Existing Goal | A Goal created before the setting change remains unbounded by the new values, proving there was no silent retrofit |
Record the version, Goal ID and revision, settings, timestamps, counters, limitKind, wind-down output, and the resume or replacement action.
Use a three-layer stop contract
Turn and time ceilings answer “how long may this run?” They do not answer “how much may it cost?” or “is the result correct?” Keep three independent gates:
Cadence authority
-> turn ceiling + active-time ceiling
Spend authority
-> token budget + provider/account limits
Completion authority
-> deterministic checks + current external evidence + human gate where needed
A Goal that stops at a ceiling is not complete. Its wind-down should report state, decisive evidence, unfinished work, and the safest next action. Bind repository checks to the exact revision or commit; for publication, require the public URL and terminal platform state.
Copyable rollout receipt
feature: qwen-goal-cadence-limits
qwen_code_version: 0.23.4
goal_revision: 1
goal_max_turns: 20
goal_max_active_minutes: 30
token_budget: separate-and-recorded
created_after_restart: true
crossing_turn_completed: true
wind_down_turns: 1
terminal_status: usage_limited
limit_kind: turn_budget
resume_moves_only_spent_ceiling: true
completion_evidence: not-inferred-from-limit
rollback: set ceilings to -1, restart, create a new Goal
Common mistakes
- Writing a turn limit into the Goal objective and assuming the runtime enforces it.
- Changing settings without restarting, or expecting them to alter a Goal already on the record.
- Treating active minutes as CPU time or assuming a timer interrupts a long tool call.
- Resetting dashboard counters after resume even though Qwen Code extends the ceiling above prior usage.
- Replacing the token budget with a time limit and losing a direct spend guard.
- Marking
usage_limitedas completed instead of requiring task-specific evidence.
Building something? Turn your product page into a show people want to watch with PromoFast—hosted, embeddable, and ready to export.
FAQ
Do these settings stop a Goal in the middle of a turn?
No. Qwen Code reads the ceilings at the continuation boundary. The crossing turn finishes, and the Goal receives one wind-down turn before it settles as usage_limited.
Does /goal resume reset the turn and time counters?
No. Resume authorizes another window on top of recorded usage and moves only the ceiling that was exhausted.
Can I add a ceiling to a Goal that is already running?
Not by changing the setting. Restart and create a new Goal. Replacement resets the revision and evidence boundary, so old evidence becomes context that must be revalidated.
Sources
- Qwen Code v0.23.4 release: https://github.com/QwenLM/qwen-code/releases/tag/v0.23.4
- Qwen Code PR #11457 — Goal turn and active-time budgets: https://github.com/QwenLM/qwen-code/pull/11457
- Qwen Code Goal budget design: https://github.com/QwenLM/qwen-code/blob/5a9c9b34068164d0aa5efe1b9e8b4de3d292ae92/docs/design/2026-09-09-goal-turn-and-time-budget.md
- Qwen Code Goal reliability roadmap issue #4228: https://github.com/QwenLM/qwen-code/issues/4228
Originally published on IndieSeek.
Top comments (0)