qwen-code/docs/developers
qqqys 7bda51a070
feat(core): add model.loopProtection and remind instead of stopping loops by default (#15016)
* feat(core): add model.loopProtection and remind before loop stops

Add the model.loopProtection setting (stop, warn, off). Under the default
stop, every stop point stays where it is; the always-on guards (identical
calls, shell inspection, daemon invalid tool parameters, stuck repetition
past the adaptive cap) first send the model one reminder with the next tool
results. warn only reminds, except for content and thought repetition; off
neither reminds nor stops. Budgets stop in every mode.

A new loop_protection telemetry event records each reminded, stopped and
observed decision. Loop stop hints and the TUI dialog note name the setting.

Refs #14828

* feat(core): default model.loopProtection to warn

A firing loop guard now reminds the model once and lets the turn continue
by default. Budgets still stop every mode, and content and thought
repetition still stops. Set model.loopProtection to "stop" to keep the
previous stop points.

Refs #14828

* fix(core): keep side queries out of the running turn's loop decisions

A concurrent /btw side query shares the client's loop detector. Its retry
dropped the turn's pending reminders, its stateful tool results could queue a
global-duplicate reminder into the turn, and under `off` it marked patterns
observed under the turn's prompt id. Route recordToolResult through the same
ownership gate, drop pending reminders once on the owner's Retry only, and
skip observed decisions for side queries.

Warn once when model.loopProtection is not a valid mode instead of silently
using the default, and update the consecutive-identical comment that still
described an unconditional halt.

* fix(core): keep reminders across side queries and guard unknown modes

A concurrent /btw side query starts as a UserQuery, so its reset cleared the
running turn's queued reminders and reminded/observed decisions. Under `warn`
the stuck turn then got no reminder at all. Keep that state on a side query's
reset, and log each reminder under the prompt id that queued it.

Validate model.loopProtection in core Config as well, since SDK and serve
embedders bypass the CLI check and an unknown mode acted as `off`.

For a stateful read tool with no recorded results, `warn` now records an
observed decision at the stop point instead of a reminder claiming the
result will not change; `stop` still fails safe and stops.

* fix(core): let late stateful results earn the warn reminder

Under `warn`, a stateful read that reached the stop point before its results
were recorded was observed under the 'identical' key, which then blocked the
reminder for the rest of the streak even after the results came back
unchanged. Record that case under its own key so the reminder can still be
sent once the evidence is in.

In daemon sessions, leave queued loop reminders untaken when the repeated
tool failure guard stops the batch, so they are not logged as `reminded`
without being sent.

Update the telemetry docs for `observed` under `warn`, note in
model.skipLoopDetection that model.loopProtection decides whether the
always-on guards remind or stop, and drop the stale DashScope #5019 rationale.
2026-10-21 13:11:16 +00:00
..
daemon fix(sdk): size session create from the daemon session budget (#14588) 2026-10-19 13:38:12 +08:00
daemon-client-adapters fix(web-shell): preserve slash highlighting in user messages (#14171) 2026-10-19 22:39:03 +00:00
daemon-ui feat(web-shell): add adaptive navigation rail and unified Live settings (#12943) 2026-10-05 08:13:30 +00:00
development feat(core): add model.loopProtection and remind instead of stopping loops by default (#15016) 2026-10-21 13:11:16 +00:00
examples docs(daemon): complete REST integration coverage (#12144) 2026-09-18 04:34:39 +00:00
tools feat(providers): add QwenCloud as the first /auth entry (#14073) 2026-10-16 21:34:43 +08:00
_meta.ts docs(daemon): publish the REST API reference (#11592) 2026-09-12 11:34:20 +00:00
architecture.md chore(desktop): rename packages/desktop-shell to packages/desktop (#12653) 2026-09-25 05:41:25 +00:00
channel-plugins.md refactor(channels): remove obsolete block streaming (#11381) 2026-09-09 04:41:31 +00:00
contributing.md docs: require bilingual design documents (#11419) 2026-09-09 03:41:56 +00:00
daemon-rest-api-reference.md feat(web-shell): show background shell task runtime details (#14831) 2026-10-20 16:18:17 +08:00
daemon-rest-api.openapi.json feat(web-shell): bridge trajectory history and live lifecycle state (#13952) 2026-10-13 11:28:30 +00:00
qwen-serve-protocol.md feat(serve): add persisted workspace artifact library (#14867) 2026-10-21 14:42:51 +08:00
rest-api-integration.md feat(serve): support model and reasoning selection at session creation (#12308) 2026-09-25 16:45:37 +00:00
roadmap.md feat(core): enable the built-in web_search by default on ModelStudio Standard/Token Plan (#11348) 2026-09-09 04:08:29 +00:00
sdk-java.md docs(sdk): clarify empty core-tool allowlists across SDKs (#13949) 2026-10-12 13:19:59 +00:00
sdk-python.md fix(sdk-python): resolve Windows command shims on the effective PATH (#13862) 2026-10-14 14:03:28 +00:00
sdk-typescript.md feat(workflow): add per-turn human-origin workflow hints (#14876) 2026-10-21 06:54:24 +00:00