qwen-code/docs/developers/daemon
callmeYe be1a0a1fb0
feat(serve): support model and reasoning selection at session creation (#12308)
* feat(serve): support model and reasoning selection at session creation

* fix(serve): allow model-only session startup configuration

* test(serve): include startup capability in registry expectations

* fix(serve): roll back rejected standalone startup

* fix(serve): make definite startup rejections retryable and honest

- Map the ACP internalError wire shape ({code: -32603, data.details})
  produced when switchModel refuses an unregistered model to
  startup_config_rejected on the startup-config call path, so the
  ordinary route answers 422 instead of 500 and the standalone path
  takes its definite rollback branch.
- Roll back the persisted recording of a caller-supplied sessionId on
  POST /session after a definite startup rejection, so a retry of the
  same id is no longer answered with 409 session_id_conflict; uncertain
  failures keep the recording.
- Publish auto in the OpenAPI approvalMode enum and pin it against
  APPROVAL_MODES; narrow the 422/protocol/design cleanup wording to
  match the implemented best-effort semantics; restore the sessionId in
  the new rollback warning.

* fix(serve): keep uncertain startup faults uncertain and roll back ACP recordings (#12308)

- session-startup-config: drop the -32603 arm so child-side internal
  errors (auth, credential, timeout, transport) stay uncertain instead
  of a false definite startup_config_rejected; the ACP child now maps
  only its two caller-caused switchModel refusals (unknown model for the
  auth type, media-only primary) to invalid params, so definite
  rejections ride -32602 alone.
- dispatch: roll back the persisted recording of a caller-supplied
  sessionId on the ACP session/new transports after a definite startup
  rejection, mirroring the REST route; uncertain outcomes keep it.
- routes/session: warn once when the recording rollback is refused or
  fails instead of silently discarding the boolean outcome.
- standalone-session-service: extract the shared rollback sequence into
  one helper used by both the startup-config and model_selection_failed
  branches.
- openapi: qualify the 422 close/rollback as best-effort and replace the
  unconfirmable status-view pointer with the self-certifying retry check.

* fix(serve): name the rejected session in startup rollback and align ACP error codes (#12308)

- SessionStartupConfigError carries an optional sessionId so both
  rollback gates (REST route, ACP dispatcher) roll back the rejected
  session's recording even when the caller never supplied an id or the
  child did not honor it; a daemon-generated id no longer leaves a
  listed, resumable phantom after a definite 422.
- A refused ACP recording rollback now logs the same inconclusive
  warning the REST route emits instead of dropping the cleanup result.
- startup_config_rejected maps to JSON-RPC -32602 (caller input), with
  data.httpStatus keeping the REST-equivalent 422; SDK transports key
  on httpStatus, so client behavior is unchanged.
- SDK throws DaemonStartupConfigError (TypeError with code
  'invalid_startup_config') for pre-transport startup rejections.
- Docs: modelApplied is documented as spawn-scoped again (an attach
  omits it or reports the spawn owner's outcome).
- Tests: daemon-generated-id rollback pins on both transports, a
  refused-rollback log pin, a service-boundary invalid-config guard
  pin, full reasoning-selection acceptance coverage, whitespace trim
  pins, and a real-ModelsConfig classifier coupling test.

* test(sdk): keep the message assertion beside the stable code on startup rejections (#12308)

* fix(serve): fail closed on control-character startup model ids (#12308)

A modelServiceId carrying a newline slipped past parseSessionStartupConfig
and produced a core refusal message the single-line classifier regexes
could not match, so a definite caller-caused rejection degraded to an
internal error and skipped the recording rollback. Reject control
characters at the parse boundary and make isCallerCausedModelRefusal
newline-tolerant; align the SDK and integration-guide modelApplied
presence rule with the spawn-scoped wording the bridge and OpenAPI
already publish.

* docs(sdk): name both transport error-code locations in DaemonStartupConfigError JSDoc (#12308)

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>

---------

Co-authored-by: qwen-code-dev-bot <qwen-code-dev-bot@users.noreply.github.com>
Co-authored-by: qwen-code-dev-bot <qwen-code-dev@service.alibaba.com>
Co-authored-by: qwen-code-ci-bot <qwen-code-ci-bot@users.noreply.github.com>
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
Co-authored-by: Shaojin Wen <shaojin.wensj@alibaba-inc.com>
2026-09-25 16:45:37 +00:00
..
assets fix(web-shell): allow sequential SDK requests during session creation (#11913) 2026-09-18 06:52:16 +00:00
00-index.md docs(serve): state what --no-web actually removes (#11446) 2026-09-09 07:01:52 +00:00
01-architecture.md feat(serve): one-command remote start with a generated token, same-origin shell access, and a pairing QR (#11172) 2026-09-09 07:16:30 +00:00
02-serve-runtime.md feat(web-shell): add shared URL navigation for pages and sessions (#12499) 2026-09-23 09:43:09 +00:00
03-acp-bridge.md fix(acp): preserve original filenames in resource-link prompts (#11721) 2026-09-12 15:12:52 +00:00
04-permission-mediation.md fix(acp-bridge): Disable permission timeout by default (#9933) 2026-08-24 16:08:44 +00:00
05-mcp-transport-pool.md feat(serve): establish workspace runtime ownership (#10593) 2026-08-31 09:45:40 +00:00
06-mcp-budget-guardrails.md docs(serve): Close multi-workspace hardening gaps (#7019) 2026-07-16 17:33:53 +00:00
07-workspace-filesystem.md feat(daemon): make serve new-file mode configurable (QWEN_SERVE_NEW_FILE_MODE) (#9364) 2026-08-18 03:42:35 +00:00
08-session-lifecycle.md feat(serve): support model and reasoning selection at session creation (#12308) 2026-09-25 16:45:37 +00:00
09-event-schema.md feat(serve): let users stop workspace runtimes to release ACP capacity (#12008) 2026-09-19 01:52:33 +00:00
10-event-bus.md fix: Make chat recording failures durable and visible (#6743) 2026-07-12 10:52:26 +00:00
11-capabilities-versioning.md feat(serve): support model and reasoning selection at session creation (#12308) 2026-09-25 16:45:37 +00:00
12-auth-security.md feat(web-shell): add shared URL navigation for pages and sessions (#12499) 2026-09-23 09:43:09 +00:00
13-sdk-daemon-client.md feat(daemon): Add batched workspace session catalogs (#12254) 2026-09-21 15:26:34 +00:00
14-cli-tui-adapter.md refactor!: retire @qwen-code/webui (#9812) 2026-09-05 09:13:54 +00:00
15-channel-adapters.md feat(channels): separate private and group access policies (#12547) 2026-09-23 12:44:09 +00:00
16-vscode-ide-adapter.md refactor!: retire @qwen-code/webui (#9812) 2026-09-05 09:13:54 +00:00
17-configuration.md feat(web-shell): add shared URL navigation for pages and sessions (#12499) 2026-09-23 09:43:09 +00:00
18-error-taxonomy.md feat(serve): Enable full API access on trusted loopback (#10403) 2026-08-30 07:52:24 +00:00
19-observability.md feat(cli): correlate daemon logs with OpenTelemetry spans (#9084) 2026-08-13 16:33:12 +00:00
20-quickstart-operations.md feat(web-shell): add shared URL navigation for pages and sessions (#12499) 2026-09-23 09:43:09 +00:00
_meta.ts docs(daemon): Refresh daemon docs in English (#5144) 2026-06-15 22:38:01 +08:00