qwen-code/packages/cli/src/serve
qqqys 7189a68334
fix(serve): isolate managed memory by selected workspace (#8056)
* fix(serve): isolate managed memory by workspace

* feat(serve): add memory project scope option

* test(serve): fix clean build type assertion

* test(serve): cover untrusted workspace memory tasks

* test(memory): cover remaining workspace paths

* test(serve): cover unavailable memory lanes

* test(memory): isolate default scope

* fix(serve): address review feedback on workspace memory isolation (#8056)

- Create secondary ACP mounts on demand for dynamically-registered
  workspaces so the qualified memory routes work beyond boot-time
  runtimes (rename getWorkspaceRememberLane → ensureWorkspaceRememberLane)
- Remove the symlink-alias machinery from getAutoMemoryRoot: it had no
  producer, relaxed a documented invariant, and could throw on the
  per-turn hot path; workspace mode now uses the same plain path.join
  as git-root mode
- Move memoryProjectScope validation into the pre-listen block
- Use the shared sendWorkspaceRuntimeUnavailable helper in server.ts
- Revert an unrelated test mock change; fix misleading 'compatibility
  fallback' wording in ServeOptions
- Add workspace_qualified_memory capability tag, docs for the new flag
  and env var

* docs(serve): add workspace_qualified_memory to conditional features table (#8056)

* fix(serve): address follow-up review feedback on workspace memory isolation (#8056)

* fix(serve): address follow-up review feedback on workspace memory isolation (#8056)

Extract MEMORY_PROJECT_SCOPES const and MemoryProjectScope type in core
so yargs choices, ServeOptions, ServeArgs, and the runQwenServe guard
share one source of truth (reduces drift risk from five to three edit
points; the fast-path guard keeps inline comparisons because an import
boundary test forbids core imports on the lightweight startup path).

Document memory-project-scope caveats in the user-facing docs: daemon
vs standalone CLI split-brain, sanitizeCwd punctuation collisions, and
flag vs env normalization differences. Add the per-lane MAX_PENDING
resource note to the developer configuration reference.

* fix(cli): add missing sessionRuntimeBaseDir to late-add workspace test (#8056)

* test(serve): cover untrusted forget/dream and no-lane memory poll (#8056)

* fix(core): extract MEMORY_PROJECT_SCOPES into zero-import leaf module (#8056)

Importing the constant as a value from the core barrel turned it into a
real static edge that pulled the entire 5.6 MB barrel into the serve
pre-listen bundle closure, breaking the fast-path gate.

Move MEMORY_PROJECT_SCOPES and MemoryProjectScope into a new
memory/scopes.ts with no imports of its own, re-export from paths.ts so
the barrel surface is unchanged, add a ./memoryScopes subpath export,
and switch run-qwen-serve.ts to the narrow import.

Also derive the unknown-scope guard in resolveWorkspaceProjectScope()
from the constant instead of hardcoding 'git-root'.

* test(cli): pin non-allocating contract in workspace memory poll test (#8056)

---------

Co-authored-by: qwen-code-dev-bot <269191875+qwen-code-dev-bot@users.noreply.github.com>
Co-authored-by: Shaojin Wen <shaojin.wensj@alibaba-inc.com>
Co-authored-by: qwen-code-dev-bot <qwen-code-dev@service.alibaba.com>
Co-authored-by: Qwen Autofix <qwen-autofix@users.noreply.github.com>
Co-authored-by: Qwen Code Bot <qwen-code-bot@users.noreply.github.com>
Co-authored-by: Qwen Code Autofix <qwen-code-autofix@users.noreply.github.com>
Co-authored-by: qwen-code-dev-bot <qwen-code-dev-bot@users.noreply.github.com>
2026-07-31 15:06:38 +00:00
..
acp-http fix(serve): isolate managed memory by selected workspace (#8056) 2026-07-31 15:06:38 +00:00
auth refactor(cli): rename serve files to kebab-case (#5592) 2026-06-22 13:13:07 +08:00
cdp-tunnel fix(release): reduce npm package scan triggers (#6164) 2026-07-02 08:06:43 +00:00
fs feat(serve): page large text files by byte cursor (#8002) 2026-07-30 12:07:05 +00:00
routes feat(serve): support caller-supplied sessionId in POST /session (#7836) 2026-07-31 13:27:33 +00:00
server fix(serve): Isolate daemon session maintenance writers (#7975) 2026-07-30 14:01:50 +00:00
voice feat(serve): Hot-reload workspace trust changes (#7268) 2026-07-25 08:43:07 +00:00
workspace-service fix(serve): Prevent repeated workspace skill rescans (#8080) 2026-07-30 12:52:37 +00:00
acp-http-enabled.ts feat(cli): workspace-qualified ACP transport (daemon multi-workspace phase 4) (#6621) 2026-07-11 00:24:01 +00:00
acp-session-bridge.ts feat(serve): add workspace-level generation (#7552) 2026-07-23 05:17:03 +00:00
auth.test.ts fix(serve): detect stale SSE cursors across daemon restarts via epoch token; preserve turn attribution and surface compaction failures in replay (#7458) 2026-07-23 07:24:36 +00:00
auth.ts fix(serve): detect stale SSE cursors across daemon restarts via epoch token; preserve turn attribution and surface compaction failures in replay (#7458) 2026-07-23 07:24:36 +00:00
bridge-file-system-adapter.test.ts feat(serve): page large text files by byte cursor (#8002) 2026-07-30 12:07:05 +00:00
bridge-file-system-adapter.ts refactor(cli): rename serve files to kebab-case (#5592) 2026-06-22 13:13:07 +08:00
capabilities-docs-contract.test.ts docs(serve): Close multi-workspace hardening gaps (#7019) 2026-07-16 17:33:53 +00:00
capabilities.ts fix(serve): isolate managed memory by selected workspace (#8056) 2026-07-31 15:06:38 +00:00
cdp-mcp-command.ts feat(cli): workspace-qualified ACP transport (daemon multi-workspace phase 4) (#6621) 2026-07-11 00:24:01 +00:00
channel-delivery-authorization.test.ts feat(daemon): add explicit channel delivery (#7388) 2026-07-23 17:44:23 +00:00
channel-delivery-authorization.ts feat(daemon): add explicit channel delivery (#7388) 2026-07-23 17:44:23 +00:00
channel-delivery-ipc.test.ts feat(daemon): add explicit channel delivery (#7388) 2026-07-23 17:44:23 +00:00
channel-delivery-ipc.ts feat(daemon): add explicit channel delivery (#7388) 2026-07-23 17:44:23 +00:00
channel-delivery.test.ts feat(daemon): add explicit channel delivery (#7388) 2026-07-23 17:44:23 +00:00
channel-delivery.ts feat(daemon): add explicit channel delivery (#7388) 2026-07-23 17:44:23 +00:00
channel-loop-mcp-ipc.test.ts feat(channels): expose loop tools in daemon sessions (#7891) 2026-07-28 13:07:36 +00:00
channel-loop-mcp-ipc.ts feat(channels): expose loop tools in daemon sessions (#7891) 2026-07-28 13:07:36 +00:00
channel-management-service.test.ts feat(channels): add pairing approval management API (#8045) 2026-07-29 14:55:03 +00:00
channel-management-service.ts feat(channels): add pairing approval management API (#8045) 2026-07-29 14:55:03 +00:00
channel-selection.test.ts feat(serve): scope channel lifecycle to workspace runtimes (#7577) 2026-07-23 23:09:19 +00:00
channel-selection.ts feat(serve): scope channel lifecycle to workspace runtimes (#7577) 2026-07-23 23:09:19 +00:00
channel-settings-store.test.ts feat(serve): persist workspace channel configuration (#7514) 2026-07-23 06:20:35 +00:00
channel-settings-store.ts feat(serve): persist workspace channel configuration (#7514) 2026-07-23 06:20:35 +00:00
channel-webhook-ipc.ts feat(channels): support webhook-triggered channel tasks (#6495) 2026-07-10 12:54:27 +00:00
channel-worker-diagnostics.test.ts fix(cli): Preserve channel startup failure details (#6950) 2026-07-16 01:17:19 +00:00
channel-worker-diagnostics.ts fix(cli): Preserve channel startup failure details (#6950) 2026-07-16 01:17:19 +00:00
channel-worker-env.ts feat(cli): Harden daemon-managed channel worker (#6098) 2026-07-01 13:26:38 +00:00
channel-worker-group.test.ts fix(daemon): distinguish draining channel worker diagnostics (#7932) 2026-07-29 08:54:18 +00:00
channel-worker-group.ts fix(daemon): distinguish draining channel worker diagnostics (#7932) 2026-07-29 08:54:18 +00:00
channel-worker-manager.test.ts feat(serve): scope channel lifecycle to workspace runtimes (#7577) 2026-07-23 23:09:19 +00:00
channel-worker-manager.ts feat(serve): scope channel lifecycle to workspace runtimes (#7577) 2026-07-23 23:09:19 +00:00
channel-worker-startup-ipc.test.ts fix(cli): Preserve channel startup failure details (#6950) 2026-07-16 01:17:19 +00:00
channel-worker-startup-ipc.ts feat(serve): scope channel lifecycle to workspace runtimes (#7577) 2026-07-23 23:09:19 +00:00
channel-worker-supervisor.test.ts feat(channels): expose loop tools in daemon sessions (#7891) 2026-07-28 13:07:36 +00:00
channel-worker-supervisor.ts feat(channels): expose loop tools in daemon sessions (#7891) 2026-07-28 13:07:36 +00:00
channel-workspace-grouping.test.ts feat(cli): group daemon channel workers by workspace (phase 4b) (#6635) 2026-07-11 13:08:02 +00:00
channel-workspace-grouping.ts feat(cli): group daemon channel workers by workspace (phase 4b) (#6635) 2026-07-11 13:08:02 +00:00
core-runtime.ts perf(core): Lazy-load first-use dependencies (#7686) 2026-07-26 03:04:33 +00:00
create-sub-session.test.ts fix(serve): detect stale SSE cursors across daemon restarts via epoch token; preserve turn attribution and surface compaction failures in replay (#7458) 2026-07-23 07:24:36 +00:00
create-sub-session.ts feat(daemon): record & query sub-session parentSessionId; drop isolated scheduled-task mode (#6676) 2026-07-10 17:15:13 +00:00
daemon-logger.test.ts feat(cli): Add bounded daemon log rotation (#6969) 2026-07-18 16:18:58 +00:00
daemon-logger.ts feat(cli): Add bounded daemon log rotation (#6969) 2026-07-18 16:18:58 +00:00
daemon-metrics-ring.test.ts feat(serve): add model API error & retry metrics to daemon status (#6837) 2026-07-14 02:06:09 +00:00
daemon-metrics-ring.ts feat(serve): add model API error & retry metrics to daemon status (#6837) 2026-07-14 02:06:09 +00:00
daemon-status-provider.test.ts feat(serve): Hot-reload workspace trust changes (#7268) 2026-07-25 08:43:07 +00:00
daemon-status-provider.ts feat(cli): Add serve env isolation and total admission (#6416) 2026-07-08 00:52:36 +00:00
daemon-status.test.ts fix(acp-bridge): raise live journal caps and expose as daemon config (#7715) 2026-07-25 14:14:09 +00:00
daemon-status.ts fix(acp-bridge): raise live journal caps and expose as daemon config (#7715) 2026-07-25 14:14:09 +00:00
debug-mode.ts refactor(cli): rename serve files to kebab-case (#5592) 2026-06-22 13:13:07 +08:00
demo.ts feat(serve): add /demo debug page for qwen serve daemon (#4132) 2026-05-18 16:31:03 +08:00
env-snapshot.test.ts feat(cli): Add serve env isolation and total admission (#6416) 2026-07-08 00:52:36 +00:00
env-snapshot.ts fix(cli): pick the memory unit from the rounded figure, not the raw bytes (#7871) 2026-07-31 12:36:52 +00:00
extension-operation-scheduler.test.ts feat(serve): add extension management v2 (#6825) 2026-07-14 03:30:47 +00:00
extension-operation-scheduler.ts feat(serve): add extension management v2 (#6825) 2026-07-14 03:30:47 +00:00
fast-path-argv.ts perf(cli): Optimize serve daemon startup (#5785) 2026-06-24 17:50:31 +08:00
fast-path-open.test.ts fix(cli): Keep serve health responsive before runtime load (#6013) 2026-06-30 10:39:08 +00:00
fast-path-settings.ts perf(cli): Propagate compile cache to ACP children (#7594) 2026-07-24 04:06:14 +00:00
fast-path.test.ts fix(serve): isolate managed memory by selected workspace (#8056) 2026-07-31 15:06:38 +00:00
fast-path.ts fix(serve): isolate managed memory by selected workspace (#8056) 2026-07-31 15:06:38 +00:00
generation-sse.ts feat(serve): add workspace-level generation (#7552) 2026-07-23 05:17:03 +00:00
health-query.ts feat(daemon): Aggregate deep health across workspaces (#6961) 2026-07-16 01:30:55 +00:00
index.ts refactor(cli): Remove serve bridge re-export shims (#5955) 2026-06-28 13:20:44 +00:00
large-pipe-frame-observer.test.ts feat(cli): Add large pipe frame measurement (#6335) 2026-07-05 15:46:53 +00:00
large-pipe-frame-observer.ts feat(cli): Add large pipe frame measurement (#6335) 2026-07-05 15:46:53 +00:00
loopback-binds.ts feat(cli): Add daemon-managed channel worker for serve --channel (#6031) 2026-07-01 01:40:54 +00:00
managed-scratch-workspace.test.ts feat(web-shell): add workspace selector button with add/switch dropdown in composer toolbar (#7390) 2026-07-22 01:10:18 +00:00
managed-scratch-workspace.ts feat(web-shell): add workspace selector button with add/switch dropdown in composer toolbar (#7390) 2026-07-22 01:10:18 +00:00
model-providers-edit.test.ts feat(web-shell): editable user-scope settings and in-panel model management (#6768) 2026-07-13 14:44:54 +00:00
model-providers-edit.ts feat(web-shell): editable user-scope settings and in-panel model management (#6768) 2026-07-13 14:44:54 +00:00
multi-workspace-sessions.test.ts fix(serve): Isolate daemon session maintenance writers (#7975) 2026-07-30 14:01:50 +00:00
native-directory-picker.test.ts feat(web-shell): add native workspace folder picker (#7849) 2026-07-28 05:58:13 +00:00
native-directory-picker.ts feat(web-shell): add native workspace folder picker (#7849) 2026-07-28 05:58:13 +00:00
permission-audit.test.ts refactor(cli): rename serve files to kebab-case (#5592) 2026-06-22 13:13:07 +08:00
permission-audit.ts refactor(cli): rename serve files to kebab-case (#5592) 2026-06-22 13:13:07 +08:00
process-env-guard.test.ts fix(acp-bridge): map Windows-shaped workspace paths to their sandbox mount (#7228) 2026-07-21 08:28:28 +00:00
rate-limit.test.ts feat(cli): workspace-qualified ACP transport (daemon multi-workspace phase 4) (#6621) 2026-07-11 00:24:01 +00:00
rate-limit.ts feat(cli): workspace-qualified ACP transport (daemon multi-workspace phase 4) (#6621) 2026-07-11 00:24:01 +00:00
run-qwen-serve.sandbox.test.ts fix(acp-bridge): map Windows-shaped workspace paths to their sandbox mount (#7228) 2026-07-21 08:28:28 +00:00
run-qwen-serve.test.ts fix(serve): isolate managed memory by selected workspace (#8056) 2026-07-31 15:06:38 +00:00
run-qwen-serve.ts fix(serve): isolate managed memory by selected workspace (#8056) 2026-07-31 15:06:38 +00:00
runtime-startup-errors.ts fix(cli): Keep serve health responsive before runtime load (#6013) 2026-06-30 10:39:08 +00:00
scheduled-task-keepalive.test.ts fix(serve): Isolate daemon session maintenance writers (#7975) 2026-07-30 14:01:50 +00:00
scheduled-task-keepalive.ts fix(serve): Isolate daemon session maintenance writers (#7975) 2026-07-30 14:01:50 +00:00
scheduled-task-session-lifecycle.test.ts feat(scheduled-tasks): run each task in its own dedicated, named session (#6389) 2026-07-07 06:22:36 +00:00
scheduled-task-session-lifecycle.ts feat(scheduled-tasks): run each task in its own dedicated, named session (#6389) 2026-07-07 06:22:36 +00:00
server-default-bridge-wiring.test.ts feat(cli): Add session owner index for workspace runtimes (#6540) 2026-07-08 22:35:53 +00:00
server-workspace-service.test.ts feat(serve): Add daemon workspace voice and control APIs (#5765) 2026-06-24 23:48:57 +00:00
server.test.ts fix(serve): isolate managed memory by selected workspace (#8056) 2026-07-31 15:06:38 +00:00
server.ts fix(serve): isolate managed memory by selected workspace (#8056) 2026-07-31 15:06:38 +00:00
session-organization-helpers.ts feat(daemon): Add session organization (#6305) 2026-07-05 07:52:56 +00:00
sse-last-event-id.test.ts fix(serve): detect stale SSE cursors across daemon restarts via epoch token; preserve turn attribution and surface compaction failures in replay (#7458) 2026-07-23 07:24:36 +00:00
sse-last-event-id.ts fix(serve): detect stale SSE cursors across daemon restarts via epoch token; preserve turn attribution and surface compaction failures in replay (#7458) 2026-07-23 07:24:36 +00:00
total-session-admission.test.ts feat(serve): support runtime workspace removal (#6745) 2026-07-13 15:43:38 +00:00
total-session-admission.ts feat(serve): support runtime workspace removal (#6745) 2026-07-13 15:43:38 +00:00
types.ts fix(serve): isolate managed memory by selected workspace (#8056) 2026-07-31 15:06:38 +00:00
validate-server-name.ts feat(browser-ext): revive Chrome extension via daemon-direct architecture (#5777) 2026-06-28 15:57:31 +00:00
validation-limits.ts feat(serve): Add daemon workspace voice and control APIs (#5765) 2026-06-24 23:48:57 +00:00
virtual-subagent-sessions.test.ts fix(serve): Isolate daemon session maintenance writers (#7975) 2026-07-30 14:01:50 +00:00
virtual-subagent-sessions.ts fix(serve): Isolate daemon session maintenance writers (#7975) 2026-07-30 14:01:50 +00:00
web-shell-resolver.ts perf(cli): Optimize serve daemon startup (#5785) 2026-06-24 17:50:31 +08:00
web-shell-static.ts feat(browser-ext): revive Chrome extension via daemon-direct architecture (#5777) 2026-06-28 15:57:31 +00:00
workspace-agents.test.ts feat(serve): Hot-reload workspace trust changes (#7268) 2026-07-25 08:43:07 +00:00
workspace-agents.ts feat(serve): Hot-reload workspace trust changes (#7268) 2026-07-25 08:43:07 +00:00
workspace-generation.test.ts feat(serve): add workspace-level generation (#7552) 2026-07-23 05:17:03 +00:00
workspace-generation.ts feat(serve): add workspace-level generation (#7552) 2026-07-23 05:17:03 +00:00
workspace-git-state.test.ts perf(web-shell): paint the composer git chip before git status completes (#7680) 2026-07-25 07:05:52 +00:00
workspace-git-state.ts perf(web-shell): paint the composer git chip before git status completes (#7680) 2026-07-25 07:05:52 +00:00
workspace-inputs.test.ts feat(cli): Enable multi-workspace session routing (#6511) 2026-07-08 10:06:31 +00:00
workspace-inputs.ts feat(cli): Add runtime daemon channel control (#6741) 2026-07-13 02:53:27 +00:00
workspace-memory-remember-constants.ts feat(serve): add sessionless workspace remember (#5884) 2026-07-01 01:53:50 +00:00
workspace-memory-summaries.ts Add sessionless workspace memory forget and dream (#6227) 2026-07-03 11:00:53 +00:00
workspace-memory.test.ts feat(daemon): add immutable session source metadata (#6932) 2026-07-15 07:35:41 +00:00
workspace-memory.ts feat(serve): Hot-reload workspace trust changes (#7268) 2026-07-25 08:43:07 +00:00
workspace-providers-status.test.ts feat(serve): Hot-reload workspace trust changes (#7268) 2026-07-25 08:43:07 +00:00
workspace-providers-status.ts feat(serve): Hot-reload workspace trust changes (#7268) 2026-07-25 08:43:07 +00:00
workspace-qualified-rest.test.ts fix(serve): isolate managed memory by selected workspace (#8056) 2026-07-31 15:06:38 +00:00
workspace-registration-store.test.ts feat: support workspace display names (#7179) 2026-07-20 15:16:44 +00:00
workspace-registration-store.ts perf(core): Lazy-load first-use dependencies (#7686) 2026-07-26 03:04:33 +00:00
workspace-registry.test.ts feat(serve): Hot-reload workspace trust changes (#7268) 2026-07-25 08:43:07 +00:00
workspace-registry.ts fix(serve): Isolate daemon session maintenance writers (#7975) 2026-07-30 14:01:50 +00:00
workspace-remember-errors.test.ts fix(daemon): surface workspace memory task error details (#6431) 2026-07-09 01:44:48 +00:00
workspace-remember-errors.ts fix(daemon): surface workspace memory task error details (#6431) 2026-07-09 01:44:48 +00:00
workspace-remember.test.ts fix(serve): isolate managed memory by selected workspace (#8056) 2026-07-31 15:06:38 +00:00
workspace-remember.ts fix(serve): isolate managed memory by selected workspace (#8056) 2026-07-31 15:06:38 +00:00
workspace-route-runtime.test.ts feat(web-shell): add git branch picker, commit dialog, and create PR flow (#7731) 2026-07-28 14:25:11 +00:00
workspace-route-runtime.ts feat(web-shell): add git branch picker, commit dialog, and create PR flow (#7731) 2026-07-28 14:25:11 +00:00
workspace-runtime-storage.ts fix(serve): Isolate daemon session maintenance writers (#7975) 2026-07-30 14:01:50 +00:00
workspace-skill-management.test.ts feat(serve): Hot-reload workspace trust changes (#7268) 2026-07-25 08:43:07 +00:00
workspace-skill-management.ts feat(serve): Hot-reload workspace trust changes (#7268) 2026-07-25 08:43:07 +00:00
workspace-skills-mapping.test.ts feat(skills): add overridable default-disabled state (#7357) 2026-07-25 18:29:20 +00:00
workspace-skills-mapping.ts feat(skills): add overridable default-disabled state (#7357) 2026-07-25 18:29:20 +00:00
workspace-skills-status.test.ts feat(skills): add overridable default-disabled state (#7357) 2026-07-25 18:29:20 +00:00
workspace-skills-status.ts feat(skills): add overridable default-disabled state (#7357) 2026-07-25 18:29:20 +00:00
workspace-trust-reconciler.test.ts feat(serve): Hot-reload workspace trust changes (#7268) 2026-07-25 08:43:07 +00:00
workspace-trust-reconciler.ts feat(serve): Hot-reload workspace trust changes (#7268) 2026-07-25 08:43:07 +00:00