qwen-code/docs/developers/daemon
jinye f16975ee56
feat(serve): Add workspace session live-state endpoint and catalog version (#9261)
* docs(serve): Design workspace session live-state protocol

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

* docs(serve): Refine workspace session live-state design

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

* feat(serve): Add workspace session live-state endpoint and catalog version

Add GET /workspaces/:workspace/sessions/live-state: a memory-only
volatile snapshot (clientCount, hasActivePrompt, waiting flags) plus an
in-memory catalog version (generation+revision equality token), so
clients stop polling the persisted catalog for volatile state.

The bridge owns the clock: registration/removal marks flow through the
emitSessionLifecycle choke point; rename, automatic title, worktree,
and persisted branch commits mark at exact points; serve-layer REST/ACP
mutations share an invalidate-then-mark helper with exact no-op
semantics (deleted:false group deletes, removeSession:false cleanups,
no-op renames). The route exposes a new version only after
invalidating both persisted catalog scopes, enabling the client
live-A -> full catalog -> live-B reconciliation handshake.

Wire-additive: new unconditional capability
workspace_session_live_state, TypeScript SDK types and
DaemonClient/WorkspaceDaemonClient methods (native REST, no per-poll
capability preflight), telemetry label, and protocol/capability/SDK
docs. Required clock methods on AcpSessionBridge are a source-level
contract change for external structural implementations; in-repo fakes
updated.

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

* test(serve): Cover workspace_session_live_state in the serve integration baseline

The capabilities envelope E2E asserts the exact advertised feature list;
the new unconditional live-state capability must appear after the
archived-export tag, matching registry declaration order.

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

* docs(serve): Close the handshake-vs-single-request argument gap

Separate the two claims the earlier paragraph conflated: the catalog
path cost is irrelevant to carrying a version (it runs anyway on a full
reload), but stamp placement decides consistency. Stamp-after-scan can
silently accept a bundle missing a mid-scan mutation; stamp-first is
safe and self-heals within one poll cycle, which a client may
legitimately choose. The A/B handshake buys provable consistency for
one extra cheap live-state read; the server supports both and the
Web Shell PR picks per product tolerance.

* fix(serve): Mark catalog version on persisted session renames

The metadata route's SessionNotFoundError fallback renamed persisted
sessions without advancing the catalog revision, so version-watching
clients kept the stale display name. Mark after a successful persisted
rename (parity with the live path, which marks on an actual change).

Also reconcile the design doc summary with its Implementation
Boundaries (the implementation ships in this PR, not a follow-up) and
spell out the child-recording persistence mechanism behind the
auto-title catalog mark.

* test(serve): Pin catalog-mark and live-state behaviors from the review round

- Assert markSessionCatalogChanged in the scheduled-task rollback
  (including the no-op-removal negative case), the sub-session and
  Live coordinator rollback paths, and the never-live orphan
  deletion; previously each mark could regress with suites green.
- Cover the live-state route's ?? false projection for both wait
  flags, and its first-exposure invalidation arm (revision
  unchanged, both organized scopes refilled).
- Cover the side-task generation-closed rollback arm (kill, remove,
  catalog mark).
- Compile the SDK live-state type fence via tsconfig.test-fence.json
  so shape assertions really pin the wire contract; the default
  tsconfig excludes test/.
- Align the design doc's cache-consistency goal with the cache
  mechanics (waiters joined before an invalidation may resolve, but
  cannot install).

---------

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-08-17 15:01:50 +00:00
..
00-index.md chore(serve): remove the /demo debug page (#8805) 2026-08-10 13:31:15 +00:00
01-architecture.md feat(cli): Enable multi-workspace session routing (#6511) 2026-07-08 10:06:31 +00:00
02-serve-runtime.md feat(daemon): Isolate the Conversations runtime boundary (#9181) 2026-08-16 17:32:45 +00:00
03-acp-bridge.md fix(acp-bridge): bound live journal replay chunks (#8801) 2026-08-10 09:52:17 +00:00
04-permission-mediation.md docs(daemon): refresh daemon docs for recent PRs (wave 2) (#5954) 2026-06-28 08:36:30 +00:00
05-mcp-transport-pool.md docs(serve): Close multi-workspace hardening gaps (#7019) 2026-07-16 17:33:53 +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(web-shell): support workspace file uploads (#8874) 2026-08-13 06:42:07 +00:00
08-session-lifecycle.md chore(serve): Log session continuation admissions (#8932) 2026-08-11 14:34:08 +00:00
09-event-schema.md feat(daemon): attach skill-toggle mutation metadata to settings_changed (#9051) 2026-08-17 05:01:41 +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): Add workspace session live-state endpoint and catalog version (#9261) 2026-08-17 15:01:50 +00:00
12-auth-security.md chore(serve): remove the /demo debug page (#8805) 2026-08-10 13:31:15 +00:00
13-sdk-daemon-client.md feat(serve): Add workspace session live-state endpoint and catalog version (#9261) 2026-08-17 15:01:50 +00:00
14-cli-tui-adapter.md fix: Make chat recording failures durable and visible (#6743) 2026-07-12 10:52:26 +00:00
15-channel-adapters.md feat(web-shell): redesign Channel policy and workspace management (#8848) 2026-08-14 07:41:44 +00:00
16-vscode-ide-adapter.md feat(cli): Enable multi-workspace session routing (#6511) 2026-07-08 10:06:31 +00:00
17-configuration.md feat(serve): adaptively grow live-journal caps before truncating mid-turn replay (#8905) 2026-08-13 11:35:39 +00:00
18-error-taxonomy.md fix: add structured error code to SessionNotFoundError for session-closing retry (#8884) 2026-08-11 13:01:25 +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(daemon): Isolate the Conversations runtime boundary (#9181) 2026-08-16 17:32:45 +00:00
_meta.ts docs(daemon): Refresh daemon docs in English (#5144) 2026-06-15 22:38:01 +08:00