Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
101 commits
Select commit Hold shift + click to select a range
d2fdeb8
perf(core): F2 cleanup PR A — R9/W11/W12/R10 (post-merge follow-ups) …
doudouOUC May 23, 2026
6b281d1
refactor(acp-bridge): F1 test split — lift bridge.test.ts (6861 LOC) …
doudouOUC May 23, 2026
67216f0
fix(core): F2 cleanup PR B — self-heal observability (W133-a + W134) …
doudouOUC May 23, 2026
e5f786a
feat(sdk/daemon-ui): unified completeness follow-up to #4328 (#4353)
chiga0 May 24, 2026
a3c8986
docs(serve): v0.16-alpha known limits + SDK QWEN_SERVER_TOKEN env fal…
doudouOUC May 24, 2026
73954b9
docs(deploy): local launch templates for v0.16-alpha (PR 30a) (#4483)
doudouOUC May 25, 2026
3ba614b
feat(daemon+sdk): cross-client real-time sync completeness (#4484)
chiga0 May 25, 2026
36c497b
feat(serve): add POST /session/:id/recap (#4504)
doudouOUC May 26, 2026
cd4335a
feat(daemon): add voterClientId to permission_resolved (A4) (#4539)
chiga0 May 26, 2026
39826f0
feat(serve): --allow-origin <pattern> CORS allowlist (T2.4 #4514) (#4…
doudouOUC May 26, 2026
f39dc98
feat(daemon): in-session model switch reaches the bus (A1) (#4546)
chiga0 May 26, 2026
28a8778
feat(serve): prompt absolute deadline + SSE writer idle timeout (#451…
doudouOUC May 26, 2026
ea8bdee
Feat/daemon react cli (#4380)
ytahdn May 27, 2026
1ca0572
chore: remove stale files superseded by main refactors
doudouOUC May 27, 2026
e45d9b4
feat(serve): add daemon file logger (#4548) (#4559)
doudouOUC May 27, 2026
014e198
feat(daemon): ACP Streamable HTTP transport at /acp [RFD #721] (#4472)
chiga0 May 27, 2026
e3d5307
refactor(daemon): drop dead try/catch around model_switched publish (…
chiga0 May 27, 2026
8a2cdb3
feat(daemon): server-pushed followup_suggestion event for the webui (…
doudouOUC May 27, 2026
83765c9
fix(daemon): cross-client sync follow-up cleanup (epoch-reset resync,…
chiga0 May 28, 2026
50a0c26
feat(daemon): server-side shell command execution for ! (bang) prefix…
doudouOUC May 28, 2026
4701e6b
feat(daemon): add session tasks snapshot endpoint (#4578)
doudouOUC May 28, 2026
6e381d3
feat(daemon): non-blocking POST /prompt — return 202 with promptId (#…
chiga0 May 28, 2026
1f34c18
feat(web-shell,webui,sdk): context-usage API + daemon-react-sdk refac…
ytahdn May 28, 2026
d1b0d29
feat(sdk): add serve-bridge MCP server & rename mcp → daemon-mcp (#4555)
jifeng May 28, 2026
99017f6
feat(telemetry): trace daemon prompt lifecycle (#4556)
doudouOUC May 29, 2026
117c9b2
feat(daemon): add request-level logging for serve routes (#4606)
doudouOUC May 29, 2026
efc86e0
feat(web-shell): add /delete command with batch delete support (#4603)
ytahdn May 30, 2026
a9e982b
feat(serve): runtime MCP server add/remove (T2.8 #4514) (#4552)
doudouOUC May 30, 2026
2e99210
feat(daemon): add POST /session/:id/btw endpoint for side questions (…
doudouOUC May 30, 2026
3dd1362
feat(telemetry): add client_id attribute and permission route spans t…
doudouOUC May 30, 2026
0a1f91e
feat(telemetry): add tool spans and session.id to daemon/ACP path (#4…
doudouOUC May 30, 2026
8e3e983
feat(daemon): clamp oversized inline media on the prompt path (#4646)
doudouOUC May 31, 2026
c18385e
feat(web-shell): UI improvements, subagent rendering, and scroll-foll…
ytahdn Jun 1, 2026
ff7dfdd
fix(infra): enforce SDK/server MCP-restart timeout coupling (#4330) (…
doudouOUC Jun 1, 2026
4b3d384
feat(telemetry): per-prompt traceId for bounded, renderable traces (#…
doudouOUC Jun 1, 2026
7910216
fix(daemon): btw cross-session leak + timeout + input cap + permissio…
doudouOUC Jun 1, 2026
ab400eb
feat(telemetry): expand daemon telemetry route coverage (#4682)
doudouOUC Jun 2, 2026
47e217f
fix(daemon): auto-recover transcript on ring_evicted resync (#4702)
doudouOUC Jun 2, 2026
5271499
fix(core): explicitly set stream: false in non-streaming requests (#4…
doudouOUC Jun 2, 2026
f55be70
fix(daemon): compacted session replay for long-session recovery (#4694)
doudouOUC Jun 3, 2026
03b3968
feat(web-shell): complete inline terminal command UI (#4710)
ytahdn Jun 3, 2026
4b9a7b3
chore: resolve merge conflicts between daemon_mode_b_main and main
doudouOUC Jun 3, 2026
89122ca
feat(telemetry): enrich llm_request span with response metadata and e…
doudouOUC Jun 3, 2026
2e7483d
fix: add missing TelemetryRuntimeConfig methods and remove obsolete t…
doudouOUC Jun 3, 2026
42a01bc
fix: add missing isForkSubagentEnabled from main merge (#4731)
doudouOUC Jun 3, 2026
79b94ce
fix(daemon): isolate parallel subAgent text streams in transcript red…
doudouOUC Jun 3, 2026
c97d1b9
feat(web-shell): polish embedded terminal interactions (#4759)
ytahdn Jun 4, 2026
1d46dba
fix(web-shell): 修复 ring-eviction 重连逻辑 (#4752)
ytahdn Jun 4, 2026
9b16bdc
fix(daemon): preserve parentToolCallId in compaction engine for paral…
doudouOUC Jun 4, 2026
92b97b8
feat(daemon): optimize ACP child lifecycle — skip relaunch, preheat, …
doudouOUC Jun 5, 2026
d9d6867
chore: remove redundant and dead comments across codebase (#4776)
qqqys Jun 5, 2026
1f7c18f
refactor(daemon): simplify code and strip PR/commit references from c…
doudouOUC Jun 5, 2026
5164547
feat(telemetry): add daemon OTel metrics and structured log records (…
doudouOUC Jun 5, 2026
97e2a0a
feat(web-shell): organize slash command completion (#4792)
ytahdn Jun 5, 2026
95f6ff3
refactor(serve): extract DaemonWorkspaceService from AcpSessionBridge…
doudouOUC Jun 6, 2026
fd84dfc
feat(web-shell): add daemon dev launcher (#4799)
ytahdn Jun 6, 2026
15794aa
feat(cli): enable /remember, /forget, /dream in ACP mode (#4819)
doudouOUC Jun 6, 2026
885f7a0
feat(serve): add HTTP rewind endpoints for daemon/web-shell (issue #4…
doudouOUC Jun 7, 2026
8749ecf
feat(cli): enable /directory command in ACP mode (#4826)
doudouOUC Jun 7, 2026
3b310db
feat(serve): add hooks diagnostic HTTP/ACP surface (issue #4514 T3.9)…
doudouOUC Jun 7, 2026
4d2a4b4
feat(serve): add extensions diagnostic HTTP/ACP surface (issue #4514 …
doudouOUC Jun 8, 2026
b107586
feat(serve): add /settings slash command for web-shell (#4816)
doudouOUC Jun 8, 2026
d9025d0
fix(daemon): enable auto-title generation for ACP (daemon) sessions (…
chiga0 Jun 8, 2026
18e848f
feat(webui): expose focused daemon hooks (#4834)
ytahdn Jun 8, 2026
82879b3
feat(serve): add POST /session/:id/branch for session forking (#4812)
doudouOUC Jun 8, 2026
ba0e4fd
feat(daemon): add POST /session/:id/language for runtime language swi…
chiga0 Jun 8, 2026
a666f90
feat(daemon): keep model & approval-mode state consistent across clie…
chiga0 Jun 8, 2026
613e818
feat(serve): add per-tier HTTP rate limiting for daemon (issue #4514 …
doudouOUC Jun 8, 2026
a680b4d
feat(test): add daemon connection stress test + refactor perf harness…
doudouOUC Jun 8, 2026
0259c1a
fix(daemon): stamp serverTimestamp at EventBus and fix streaming stat…
ytahdn Jun 9, 2026
5624e3e
feat(web-shell): make bottom-left mode indicator mouse-selectable (#4…
wenshao Jun 9, 2026
e237972
feat(web-shell): improve UX with double-ESC clear, thinking collapse,…
ytahdn Jun 9, 2026
b4dd701
docs(config): clean permission policy schema copy (#4900)
qqqys Jun 10, 2026
f73175e
feat(web-shell): make bottom-right model indicator mouse-selectable (…
wenshao Jun 10, 2026
44b936b
merge: resolve conflicts with origin/main
doudouOUC Jun 10, 2026
de9d19c
feat(web-shell): render /settings as inline panel matching native CLI…
wenshao Jun 10, 2026
4fd5fc0
feat(daemon): add POST /workspace/reload-env for hot-reloading env va…
doudouOUC Jun 10, 2026
f9f976d
feat(daemon): session idle reaper for automatic cleanup (#4833)
chiga0 Jun 10, 2026
89921cc
feat(web-shell): make context usage mouse-reachable and survive reloa…
wenshao Jun 10, 2026
71e91e5
feat(web-shell): make /settings mouse-reachable via a status-bar gear…
wenshao Jun 10, 2026
5f55d58
fix(web-shell): merge adjacent tool calls into one tool_group like na…
wenshao Jun 11, 2026
a517072
feat(web-shell): collapse thinking output to a 5-line window (#4977)
wenshao Jun 11, 2026
7a2814a
feat(serve): ACP/REST parity — 29 new _qwen/* methods + production ha…
chiga0 Jun 11, 2026
0f86ff1
fix(web-shell,webui): SSE reconnection stability, error routing, and …
ytahdn Jun 11, 2026
70f07bf
fix(serve): isolate per-session stats in daemon mode (#4954)
doudouOUC Jun 11, 2026
22327b9
feat(web-shell): add task auth and goal workflows (#4856)
ytahdn Jun 11, 2026
bc93915
fix(daemon): bind QWEN_CODE_SESSION_ID to the current session via Asy…
yiliang114 Jun 11, 2026
38f5121
fix(daemon): language switch writes to wrong output-language.md path …
chiga0 Jun 11, 2026
74fe668
chore: merge main into daemon_mode_b_main
doudouOUC Jun 11, 2026
295a279
chore: merge latest daemon_mode_b_main
doudouOUC Jun 11, 2026
d15e8a9
feat(daemon): Support image upload and echo in WebShell (#4922)
yuanyuanAli Jun 11, 2026
fac4d31
feat(daemon): add POST /workspace/reload for unified settings hot-rel…
doudouOUC Jun 11, 2026
4f5290c
feat(serve): add cursor-based pagination for session list (#4902)
chiga0 Jun 11, 2026
5a28dcc
feat(serve): ACP WebSocket transport (RFD Streamable HTTP phase 2) (#…
chiga0 Jun 11, 2026
a1f40ba
feat(web-shell): add expand toggle to shell tool output (#4984)
wenshao Jun 11, 2026
26619e0
fix(ci): Raise daemon SDK browser bundle budget
doudouOUC Jun 11, 2026
912d91e
fix(ci): Build web shell during root build
doudouOUC Jun 11, 2026
7f2f6d3
fix(test): Update MCP client mocks for instructions
doudouOUC Jun 11, 2026
5805440
fix(test): Align CLI test expectations with daemon changes
doudouOUC Jun 11, 2026
62f846a
fix(test): Stabilize daemon serve tests in CI
doudouOUC Jun 11, 2026
e2fae27
fix(cli): Sanitize daemon shell command logs
doudouOUC Jun 11, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Empty file modified .qwen/skills/memory-leak-debug/scripts/find-leaf-node.sh
100755 → 100644
Empty file.
568 changes: 568 additions & 0 deletions docs/design/daemon-acp-http/README.md

Large diffs are not rendered by default.

1,457 changes: 1,457 additions & 0 deletions docs/design/f2-mcp-transport-pool.md

Large diffs are not rendered by default.

434 changes: 434 additions & 0 deletions docs/design/session-idle-reaper/README.md

Large diffs are not rendered by default.

46 changes: 36 additions & 10 deletions docs/design/session-recap/session-recap-design.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,42 @@ returns:

## Triggers

| Trigger | Conditions | Implementation |
| ---------- | -------------------------------------------------------------------------------------------- | ----------------------------------------------------------------- |
| **Manual** | User runs `/recap` | `recapCommand.ts` calls the same underlying service |
| **Auto** | Terminal blurred (DECSET 1004 focus protocol) for ≥ 5 min + focus returns + stream is `Idle` | `useAwaySummary.ts` — 5min blur timer + `useFocus` event listener |

Both paths funnel into a single function — `generateSessionRecap()` — to
guarantee identical behavior. The auto-trigger is gated by
`general.showSessionRecap` (default: off — explicit opt-in, so ambient
LLM calls are never silently added to a user's bill); the manual
command ignores that setting.
| Trigger | Conditions | Implementation |
Comment thread
doudouOUC marked this conversation as resolved.
Resolved
| --------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Manual** | User runs `/recap` | `recapCommand.ts` calls the same underlying service |
| **Auto** | Terminal blurred (DECSET 1004 focus protocol) for ≥ 5 min + focus returns + stream is `Idle` | `useAwaySummary.ts` — 5min blur timer + `useFocus` event listener |
| **Daemon HTTP** | Remote client calls `POST /session/:id/recap` | `server.ts` route → `bridge.generateSessionRecap` (ext-method roundtrip) → `acpAgent.ts` calls `generateSessionRecap(session.getConfig(), signal)` |

All three paths funnel into the same `generateSessionRecap()` function
in `core/services/sessionRecap.ts` to guarantee identical behavior. The
auto-trigger is gated by `general.showSessionRecap` (default: off —
explicit opt-in, so ambient LLM calls are never silently added to a
user's bill); the manual command and daemon HTTP route ignore that
setting (the caller is making an explicit request).

### Daemon access path

The daemon route is non-strict-gated (mirrors `/session/:id/prompt`'s
posture — recap costs tokens but mutates no state). Capability tag
`session_recap` advertises the route on `/capabilities.features`. SDK
helpers: `DaemonClient.recapSession(sessionId, opts)` and
`DaemonSessionClient.recap(opts)`. See
`docs/developers/qwen-serve-protocol.md` § `POST /session/:id/recap`
for the wire contract and error envelope.

Cancellation is **absent in v1**. The route does not listen for HTTP
client disconnect, no `AbortSignal` is threaded into
`bridge.generateSessionRecap`, and the ACP child handler passes a
never-aborting `AbortController().signal` to the core helper (no
cross-process abort plumbing yet). The only ceilings are the bridge's
60s `SESSION_RECAP_TIMEOUT_MS` backstop and the transport-closed race
against ACP channel death. Wiring an HTTP-side AbortController in
isolation would be cosmetic — the child-side LLM call would still run
to completion, so e2e cancel is not achievable without the cross-
process abort piece. This is acceptable for v1 because recap is short
(single-attempt side-query, `maxOutputTokens: 300`, ~1–5s typical).
A future request-id-based cancel ext-method can plumb full end-to-end
cancellation if/when the bandwidth cost justifies it.

## Architecture

Expand Down
118 changes: 118 additions & 0 deletions docs/developers/daemon-client-adapters/web-ui.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
# Daemon Web UI Adapter

## Goal

Web chat and web terminal clients should consume `qwen serve` through the
daemon HTTP/SSE APIs and render a client-side transcript. Native local TUI,
channel, and IDE integrations keep their existing default paths for now.

## Shared UI Contract

Use the TypeScript SDK daemon UI exports as the common boundary:

```ts
import {
DaemonClient,
DaemonSessionClient,
createDaemonTranscriptStore,
normalizeDaemonEvent,
} from '@qwen-code/sdk/daemon';
```

The split is:

- `DaemonClient` handles daemon HTTP routes.
- `DaemonSessionClient` owns session creation/attachment and SSE replay.
- `normalizeDaemonEvent()` converts daemon wire events into UI events.
- `createDaemonTranscriptStore()` reduces UI events into transcript blocks.

React clients can use the optional `@qwen-code/webui` binding:

```tsx
import {
DaemonSessionProvider,
useDaemonActions,
useDaemonConnection,
useDaemonPendingPermissions,
useDaemonTranscriptBlocks,
} from '@qwen-code/webui';
```

Minimal React shape:

```tsx
function App() {
return (
<DaemonSessionProvider baseUrl="http://127.0.0.1:4170">
<Transcript />
<PromptBox />
</DaemonSessionProvider>
);
}

function Transcript() {
const blocks = useDaemonTranscriptBlocks();
return blocks.map((block) => <RenderBlock key={block.id} block={block} />);
}
```

The provider creates or attaches a daemon session, subscribes to SSE, keeps the
last event id on `DaemonSessionClient`, and reconnects the stream by default.
Callers can disable that with `autoReconnect={false}` for tests or custom
connection management.

## Browser Deployment Shapes

### Same-Origin Local POC

A daemon-served page can call the daemon directly because the page and API share
one origin. This is the preferred early POC shape for local web chat and web
terminal validation.

### Remote Web Chat / Web Terminal

A production remote web app should normally talk to a backend-for-frontend. The
BFF owns daemon URL, token, workspace routing, and session metadata, then
forwards browser-safe app events to the browser. This keeps bearer tokens out of
browser storage and lets the deployment decide which daemon/workspace a user is
allowed to reach.

### Local Browser Against Local Daemon

A separate local dev server is cross-origin from `qwen serve`; it must either
proxy daemon routes through the same origin or be served by the daemon. The
daemon intentionally rejects arbitrary browser `Origin` requests.

## Rendering Responsibilities

The shared transcript model is semantic, not visual. UI clients decide how to
render:

- user and assistant message blocks
- collapsed thought blocks
- tool status cards
- shell output blocks
- permission request controls
- status/error/debug blocks

The web terminal is a browser-native semantic renderer. It should look and feel
terminal-like with monospace layout, scrollback, prompt input, shortcuts, and
streaming blocks, but it is not a raw PTY proxy and does not require server-side
Ink rendering.

## Merge Safety

- The native `qwen` TUI remains direct and unchanged.
- `--acp`, channel, and IDE paths remain unchanged by default.
- The SDK UI core is additive.
- The WebUI React binding is optional and only runs in clients that import it.
- Removed daemon TUI spike code should not be treated as a product migration.

## Follow-Ups

- Add a daemon-served local `/web` POC or equivalent same-origin web app.
- Build first-class chat and terminal renderers on top of transcript blocks.
- Add richer typed events only where existing daemon events are too low-level
for stable browser UI behavior.
- Consider a dedicated `@qwen-code/daemon-ui-core` package if non-SDK consumers
need the UI core as an independent dependency.
Loading
Loading