Repository navigation
feat(daemon): merge daemon-mode feature batch into main #4490
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
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 6b281d1
refactor(acp-bridge): F1 test split — lift bridge.test.ts (6861 LOC) …
doudouOUC 67216f0
fix(core): F2 cleanup PR B — self-heal observability (W133-a + W134) …
doudouOUC e5f786a
feat(sdk/daemon-ui): unified completeness follow-up to #4328 (#4353)
chiga0 a3c8986
docs(serve): v0.16-alpha known limits + SDK QWEN_SERVER_TOKEN env fal…
doudouOUC 73954b9
docs(deploy): local launch templates for v0.16-alpha (PR 30a) (#4483)
doudouOUC 3ba614b
feat(daemon+sdk): cross-client real-time sync completeness (#4484)
chiga0 36c497b
feat(serve): add POST /session/:id/recap (#4504)
doudouOUC cd4335a
feat(daemon): add voterClientId to permission_resolved (A4) (#4539)
chiga0 39826f0
feat(serve): --allow-origin <pattern> CORS allowlist (T2.4 #4514) (#4…
doudouOUC f39dc98
feat(daemon): in-session model switch reaches the bus (A1) (#4546)
chiga0 28a8778
feat(serve): prompt absolute deadline + SSE writer idle timeout (#451…
doudouOUC ea8bdee
Feat/daemon react cli (#4380)
ytahdn 1ca0572
chore: remove stale files superseded by main refactors
doudouOUC e45d9b4
feat(serve): add daemon file logger (#4548) (#4559)
doudouOUC 014e198
feat(daemon): ACP Streamable HTTP transport at /acp [RFD #721] (#4472)
chiga0 e3d5307
refactor(daemon): drop dead try/catch around model_switched publish (…
chiga0 8a2cdb3
feat(daemon): server-pushed followup_suggestion event for the webui (…
doudouOUC 83765c9
fix(daemon): cross-client sync follow-up cleanup (epoch-reset resync,…
chiga0 50a0c26
feat(daemon): server-side shell command execution for ! (bang) prefix…
doudouOUC 4701e6b
feat(daemon): add session tasks snapshot endpoint (#4578)
doudouOUC 6e381d3
feat(daemon): non-blocking POST /prompt — return 202 with promptId (#…
chiga0 1f34c18
feat(web-shell,webui,sdk): context-usage API + daemon-react-sdk refac…
ytahdn d1b0d29
feat(sdk): add serve-bridge MCP server & rename mcp → daemon-mcp (#4555)
jifeng 99017f6
feat(telemetry): trace daemon prompt lifecycle (#4556)
doudouOUC 117c9b2
feat(daemon): add request-level logging for serve routes (#4606)
doudouOUC efc86e0
feat(web-shell): add /delete command with batch delete support (#4603)
ytahdn a9e982b
feat(serve): runtime MCP server add/remove (T2.8 #4514) (#4552)
doudouOUC 2e99210
feat(daemon): add POST /session/:id/btw endpoint for side questions (…
doudouOUC 3dd1362
feat(telemetry): add client_id attribute and permission route spans t…
doudouOUC 0a1f91e
feat(telemetry): add tool spans and session.id to daemon/ACP path (#4…
doudouOUC 8e3e983
feat(daemon): clamp oversized inline media on the prompt path (#4646)
doudouOUC c18385e
feat(web-shell): UI improvements, subagent rendering, and scroll-foll…
ytahdn ff7dfdd
fix(infra): enforce SDK/server MCP-restart timeout coupling (#4330) (…
doudouOUC 4b3d384
feat(telemetry): per-prompt traceId for bounded, renderable traces (#…
doudouOUC 7910216
fix(daemon): btw cross-session leak + timeout + input cap + permissio…
doudouOUC ab400eb
feat(telemetry): expand daemon telemetry route coverage (#4682)
doudouOUC 47e217f
fix(daemon): auto-recover transcript on ring_evicted resync (#4702)
doudouOUC 5271499
fix(core): explicitly set stream: false in non-streaming requests (#4…
doudouOUC f55be70
fix(daemon): compacted session replay for long-session recovery (#4694)
doudouOUC 03b3968
feat(web-shell): complete inline terminal command UI (#4710)
ytahdn 4b9a7b3
chore: resolve merge conflicts between daemon_mode_b_main and main
doudouOUC 89122ca
feat(telemetry): enrich llm_request span with response metadata and e…
doudouOUC 2e7483d
fix: add missing TelemetryRuntimeConfig methods and remove obsolete t…
doudouOUC 42a01bc
fix: add missing isForkSubagentEnabled from main merge (#4731)
doudouOUC 79b94ce
fix(daemon): isolate parallel subAgent text streams in transcript red…
doudouOUC c97d1b9
feat(web-shell): polish embedded terminal interactions (#4759)
ytahdn 1d46dba
fix(web-shell): 修复 ring-eviction 重连逻辑 (#4752)
ytahdn 9b16bdc
fix(daemon): preserve parentToolCallId in compaction engine for paral…
doudouOUC 92b97b8
feat(daemon): optimize ACP child lifecycle — skip relaunch, preheat, …
doudouOUC d9d6867
chore: remove redundant and dead comments across codebase (#4776)
qqqys 1f7c18f
refactor(daemon): simplify code and strip PR/commit references from c…
doudouOUC 5164547
feat(telemetry): add daemon OTel metrics and structured log records (…
doudouOUC 97e2a0a
feat(web-shell): organize slash command completion (#4792)
ytahdn 95f6ff3
refactor(serve): extract DaemonWorkspaceService from AcpSessionBridge…
doudouOUC fd84dfc
feat(web-shell): add daemon dev launcher (#4799)
ytahdn 15794aa
feat(cli): enable /remember, /forget, /dream in ACP mode (#4819)
doudouOUC 885f7a0
feat(serve): add HTTP rewind endpoints for daemon/web-shell (issue #4…
doudouOUC 8749ecf
feat(cli): enable /directory command in ACP mode (#4826)
doudouOUC 3b310db
feat(serve): add hooks diagnostic HTTP/ACP surface (issue #4514 T3.9)…
doudouOUC 4d2a4b4
feat(serve): add extensions diagnostic HTTP/ACP surface (issue #4514 …
doudouOUC b107586
feat(serve): add /settings slash command for web-shell (#4816)
doudouOUC d9025d0
fix(daemon): enable auto-title generation for ACP (daemon) sessions (…
chiga0 18e848f
feat(webui): expose focused daemon hooks (#4834)
ytahdn 82879b3
feat(serve): add POST /session/:id/branch for session forking (#4812)
doudouOUC ba0e4fd
feat(daemon): add POST /session/:id/language for runtime language swi…
chiga0 a666f90
feat(daemon): keep model & approval-mode state consistent across clie…
chiga0 613e818
feat(serve): add per-tier HTTP rate limiting for daemon (issue #4514 …
doudouOUC a680b4d
feat(test): add daemon connection stress test + refactor perf harness…
doudouOUC 0259c1a
fix(daemon): stamp serverTimestamp at EventBus and fix streaming stat…
ytahdn 5624e3e
feat(web-shell): make bottom-left mode indicator mouse-selectable (#4…
wenshao e237972
feat(web-shell): improve UX with double-ESC clear, thinking collapse,…
ytahdn b4dd701
docs(config): clean permission policy schema copy (#4900)
qqqys f73175e
feat(web-shell): make bottom-right model indicator mouse-selectable (…
wenshao 44b936b
merge: resolve conflicts with origin/main
doudouOUC de9d19c
feat(web-shell): render /settings as inline panel matching native CLI…
wenshao 4fd5fc0
feat(daemon): add POST /workspace/reload-env for hot-reloading env va…
doudouOUC f9f976d
feat(daemon): session idle reaper for automatic cleanup (#4833)
chiga0 89921cc
feat(web-shell): make context usage mouse-reachable and survive reloa…
wenshao 71e91e5
feat(web-shell): make /settings mouse-reachable via a status-bar gear…
wenshao 5f55d58
fix(web-shell): merge adjacent tool calls into one tool_group like na…
wenshao a517072
feat(web-shell): collapse thinking output to a 5-line window (#4977)
wenshao 7a2814a
feat(serve): ACP/REST parity — 29 new _qwen/* methods + production ha…
chiga0 0f86ff1
fix(web-shell,webui): SSE reconnection stability, error routing, and …
ytahdn 70f07bf
fix(serve): isolate per-session stats in daemon mode (#4954)
doudouOUC 22327b9
feat(web-shell): add task auth and goal workflows (#4856)
ytahdn bc93915
fix(daemon): bind QWEN_CODE_SESSION_ID to the current session via Asy…
yiliang114 38f5121
fix(daemon): language switch writes to wrong output-language.md path …
chiga0 74fe668
chore: merge main into daemon_mode_b_main
doudouOUC 295a279
chore: merge latest daemon_mode_b_main
doudouOUC d15e8a9
feat(daemon): Support image upload and echo in WebShell (#4922)
yuanyuanAli fac4d31
feat(daemon): add POST /workspace/reload for unified settings hot-rel…
doudouOUC 4f5290c
feat(serve): add cursor-based pagination for session list (#4902)
chiga0 5a28dcc
feat(serve): ACP WebSocket transport (RFD Streamable HTTP phase 2) (#…
chiga0 a1f40ba
feat(web-shell): add expand toggle to shell tool output (#4984)
wenshao 26619e0
fix(ci): Raise daemon SDK browser bundle budget
doudouOUC 912d91e
fix(ci): Build web shell during root build
doudouOUC 7f2f6d3
fix(test): Update MCP client mocks for instructions
doudouOUC 5805440
fix(test): Align CLI test expectations with daemon changes
doudouOUC 62f846a
fix(test): Stabilize daemon serve tests in CI
doudouOUC e2fae27
fix(cli): Sanitize daemon shell command logs
doudouOUC File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
There are no files selected for viewing
Empty file.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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. |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.