Skip to content
Merged
Show file tree
Hide file tree
Changes from 25 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
0300fcb
feat(web-shell): persist environment panel state
Aug 31, 2026
9df6b47
Merge remote-tracking branch 'origin/main' into worktree-env-panel-at…
Aug 31, 2026
9d2406c
Merge remote-tracking branch 'origin/main' into worktree-env-panel-at…
Aug 31, 2026
d2ef6a2
Merge remote-tracking branch 'origin/main' into worktree-env-panel-at…
Sep 1, 2026
f97a898
fix(web-shell): address PR review regressions
Sep 1, 2026
a833dab
fix(web-shell): address remaining panel review issues
Sep 1, 2026
dbbfec1
test(web-shell): update system image preview expectation
Sep 1, 2026
918b731
Merge remote-tracking branch 'origin/main' into worktree-env-panel-at…
Sep 1, 2026
c386d84
fix(web-shell): harden restored panel state
Sep 1, 2026
f5ce6ee
Merge remote-tracking branch 'origin/main' into worktree-env-panel-at…
Sep 1, 2026
7a968d1
fix(web-shell): preserve deferred panel tabs
Sep 1, 2026
8a7410a
fix(web-shell): preserve panel state across async restores
Sep 2, 2026
bf4ee29
Merge remote-tracking branch 'origin/main' into worktree-env-panel-at…
Sep 2, 2026
424e657
fix(web-shell): close panel restoration races
Sep 2, 2026
e562610
fix(web-shell): order restored panel requests
Sep 2, 2026
f7bb83a
test(web-shell): pin completed agent polling
Sep 2, 2026
545b089
fix(web-shell): preserve live panel state during restore
Sep 2, 2026
e173d14
chore: merge origin/main
Sep 3, 2026
e3564cb
fix(daemon): refresh live panel snapshots reliably
Sep 3, 2026
f9dd67c
Merge remote-tracking branch 'origin/main' into worktree-env-panel-at…
Sep 3, 2026
e813b92
fix(web-shell): isolate session panel state
Sep 3, 2026
1a870f9
Merge remote-tracking branch 'origin/main' into worktree-env-panel-at…
Sep 3, 2026
ab9f804
fix(web-shell): release detached terminals
Sep 3, 2026
27894da
fix(web-shell): restore cached panel artifacts
Sep 4, 2026
a4abd30
chore: merge origin/main
Sep 4, 2026
a43060b
chore: merge origin/main
Sep 4, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/design/untrusted-persisted-transcript.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Replay is page-transactional at the protocol boundary: updates emitted before a

## Compatibility and limits

The old singular route, persisted cursor key and ACP error mapping remain intact. The new route keeps the existing default page size of 100, maximum of 500, 256 MiB snapshot cap, 32-entry/64 MiB index cache and five-minute cache lifetime. The workspace-qualified route additionally caps each page at 4 MiB of persisted source records, 32 MiB of serialized response JSON and 64 KiB of cursor state. `limit` is therefore a record-count ceiling rather than a promise that every successful page contains that many records. A single aggregate record over the source budget returns `transcript_page_too_large`; an oversized replay cursor terminates the otherwise successful page as partial without issuing a continuation cursor. The first index scan remains linear in the frozen snapshot size.
The old singular route, persisted cursor key and ACP error mapping remain intact. The new route keeps the existing default requested window of 100, maximum requested window of 500, 256 MiB snapshot cap, 32-entry/64 MiB index cache and five-minute cache lifetime. The workspace-qualified route additionally caps each page at 4 MiB of persisted source records, 32 MiB of serialized response JSON and 64 KiB of cursor state. `limit` is a record-count ceiling for forward pages; backward pages may expand to at most `3 * limit` records to preserve turn and tool-call/result boundaries. A single aggregate record over the source budget returns `transcript_page_too_large`; an oversized replay cursor terminates the otherwise successful page as partial without issuing a continuation cursor. The first index scan remains linear in the frozen snapshot size.

The TypeScript SDK exposes the method on `WorkspaceDaemonClient`. It forces native REST transport and has no ACP route mapping. Older daemons can be detected through the new capability and continue returning 404 for the route.

Expand Down
21 changes: 21 additions & 0 deletions docs/design/web-shell-agent-workflow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Web Shell agent workflow

## Goal

Show the complete persisted subagent hierarchy in a restorable right-panel tab while retaining the existing low-cost live agent inventory.

## Data flow

- `GET /session/:id/agent-trace` is a live-session-owner read. It scans at most 2,000 metadata sidecars asynchronously, validates their session identity, and returns parent/root relationships plus lineage health.
- `GET /session/:id/agents` remains the bounded live inventory and polling source.
- The Workflow tab uses the trace as topology and overlays matching live agents by ID for current status and timing.

The trace is requested only after transcript loading completes and only while a Workflow tab is open. Agent inventory activity changes trigger a trace refresh; there is no second fixed polling loop.

## Persistence

Local storage contains only the Workflow tab ID, title, kind, and session ID. Trace content is fetched after load. The first fetch shows a skeleton; later refreshes retain the prior graph.

## Compatibility

The route is advertised by the dedicated `session_agent_trace` capability. Older daemons continue to expose the existing agent inventory without the Workflow entry.
17 changes: 17 additions & 0 deletions docs/design/web-shell-right-panel-restoration.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Web Shell right-panel restoration

## Goal

Restore each session's right-panel open state, tab order, and active tab after a page reload without storing content payloads in browser storage.

## Design

`localStorage` stores one entry per logical session. Each tab is reduced to stable lookup fields such as attachment ID, source session ID, workspace path, artifact ID, task ID, tool-call ID, side-task session ID, or terminal ID and working directory. Runtime objects, transcript content, terminal output, diffs, blobs, data URLs, and live action objects are never persisted.

The panel shell is restored before paint, without an opening animation, and shows a skeleton while the session transcript or artifacts are loading. Tab metadata and content are restored only after both loads complete. Reloads and session switches use the same key-only restore path. Only the active attachment or cross-session task tab fetches its content immediately; inactive tabs fetch when selected. Workspace files, artifacts, and side tasks continue to use their existing lazy data sources.

The environment panel lists attachment metadata and session artifacts in separate, expanded sections. Both sections show skeletons while their APIs load. Attachment content is fetched only when its name is selected; no thumbnails or content payloads are loaded for the list.

Subagents come from a session-scoped agent snapshot rather than transcript pagination. The daemon merges persisted agent sidecars with the live task registry by agent ID, with live state winning. Web Shell fetches the snapshot after session load when the environment panel opens and polls every three seconds only while an agent is running; older daemons fall back to the existing task/transcript view.

Unsent composer previews have no durable session identity and are intentionally not restored.
2 changes: 1 addition & 1 deletion docs/developers/daemon/00-index.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ Use these anchors when moving from the docs into the latest `main` code:
| ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- |
| HTTP routes | The route catalog lives in `qwen-serve-protocol.md`; this daemon set only references it and explains implementation ownership. | [`../qwen-serve-protocol.md`](../qwen-serve-protocol.md), [`20`](./20-quickstart-operations.md) |
| Event schema | `EVENT_SCHEMA_VERSION = 1`; 53 known event types; id-less subscriber synthetic frames; `_meta.serverTimestamp` stamped by `EventBus.publish()` (with `formatSseFrame()` fallback for synthetic frames). | [`09`](./09-event-schema.md), [`10`](./10-event-bus.md) |
| Capabilities | `SERVE_PROTOCOL_VERSION = 'v1'`; 152 registered tags; 44 conditional tags. | [`11`](./11-capabilities-versioning.md) |
| Capabilities | `SERVE_PROTOCOL_VERSION = 'v1'`; 156 registered tags; 44 conditional tags. | [`11`](./11-capabilities-versioning.md) |
| Session shell | `POST /session/:id/shell` exists behind `--enable-session-shell`, bearer or trusted-loopback authority, and session-bound `X-Qwen-Client-Id`; capability tag is conditional. | [`11`](./11-capabilities-versioning.md), [`17`](./17-configuration.md), [`20`](./20-quickstart-operations.md) |
| Rate limiting | Optional per-tier HTTP rate limit is exposed by CLI flags/env and conditional capability tag. | [`11`](./11-capabilities-versioning.md), [`17`](./17-configuration.md) |

Expand Down
16 changes: 9 additions & 7 deletions docs/developers/qwen-serve-protocol.md
Original file line number Diff line number Diff line change
Expand Up @@ -2314,10 +2314,12 @@ Return one page of id-less `session_update` replay frames reconstructed from the

Query parameters:

| Field | Required | Notes |
| -------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `cursor` | no | Opaque base64url cursor returned by the previous page. Omit for the first page. The cursor is daemon-issued and tamper-checked; modifying it returns `400 invalid_transcript_cursor`. It binds to the transcript file identity and frozen first-page byte size; deleting, truncating, replacing, or archiving the file invalidates it and returns `409`. |
| `limit` | no | Number of active `ChatRecord`s to include in the page. Defaults to `100`, maximum `500`. One record can produce multiple replay frames, so `events.length` may be larger than `limit`. Invalid values return `400 invalid_transcript_limit`. |
| Field | Required | Notes |
| ---------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `cursor` | no | Opaque base64url cursor returned by the previous page. Omit for the first page. The cursor is daemon-issued and tamper-checked; modifying it returns `400 invalid_transcript_cursor`. It binds to the transcript file identity and frozen first-page byte size; deleting, truncating, replacing, or archiving the file invalidates it and returns `409`. |
| `limit` | no | Target number of active `ChatRecord`s in a page. Defaults to `100`, maximum `500`. A backward page may expand to at most `3 * limit` records to preserve turn and tool-call/result boundaries. One record can produce multiple replay frames, so `events.length` may be larger still. Invalid values return `400 invalid_transcript_limit`. |
| `direction` | no | `forward` (default) or `backward`. A backward first page starts at the newest records. |
| `beforeRecordId` | no | Start before this record id. It cannot be combined with `cursor`, and requires `direction=backward`. |

Response:

Expand Down Expand Up @@ -2352,7 +2354,7 @@ To protect daemon memory and latency, snapshots above the transcript indexing ca

**Errors:**

- `400` — invalid `limit`, `cursor`, or session id shape.
- `400` — invalid `limit`, `cursor`, `direction`, `beforeRecordId`, or session id shape; `cursor` and `beforeRecordId` are mutually exclusive.
- `404` — active persisted session id does not exist on the first page request.
- `409` — `session_archived`, `session_archiving`, or `session_conflict` from the same loadability checks as `/load`.
- `409` — transcript snapshot is unavailable because the file was deleted, truncated, replaced, or archived after the cursor was issued; this also applies when preflight can no longer find the active file for a cursor request.
Expand All @@ -2365,9 +2367,9 @@ Return the same `DaemonSessionTranscriptPage` projection as the singular route f

The selector and query parameters follow the existing plural workspace and transcript rules. Trusted primary and secondary runtimes and untrusted secondary runtimes may read. An untrusted primary returns `403 untrusted_workspace`. Archived content is not returned.

For this workspace-qualified route, `limit` is the maximum record count. A page may stop earlier at the 4 MiB persisted-source budget and return a continuation cursor. Serialized responses are capped at 32 MiB and cursors at 64 KiB. If replay state would exceed the cursor cap, the page returns its successfully converted events with `partial: true`, `hasMore: false`, and no `nextCursor`.
For this workspace-qualified route, `limit` is the maximum record count for forward pages. A backward page may expand to at most `3 * limit` records so turns and tool-call/result pairs stay intact. A page may stop earlier at the 4 MiB persisted-source budget and return a continuation cursor. Serialized responses are capped at 32 MiB and cursors at 64 KiB. If replay state would exceed the cursor cap, the page returns its successfully converted events with `partial: true`, `hasMore: false`, and no `nextCursor`.

Unlike the legacy singular route, this path is implemented entirely inside the daemon process. It does not call the workspace bridge, start ACP, load settings, parse project-defined agents or skills, or create/repair `session-transcript-cursor-key`. Tool frames use persisted tool names and descriptions without consulting the runtime tool registry. Its HMAC cursor key exists only in daemon memory, is isolated per workspace, and rotates on restart; a cursor from a previous daemon process returns `400 invalid_transcript_cursor`.
Forward pages and cursor pages are implemented entirely inside the daemon process. A backward first page for a live session first crosses a one-record workspace-bridge flush barrier so the persisted tail is current; that barrier may start ACP and load workspace settings. The persisted page read itself does not parse project-defined agents or skills or create/repair `session-transcript-cursor-key`. Tool frames use persisted tool names and descriptions without consulting the runtime tool registry. Its HMAC cursor key exists only in daemon memory, is isolated per workspace, and rotates on restart; a cursor from a previous daemon process returns `400 invalid_transcript_cursor`.

### `GET /workspaces/:workspace/session/:id/export`

Expand Down
Loading
Loading