docs/developers/daemon-client-adapters/ide.md
Let the VS Code companion extension dogfood Mode B by connecting from the
extension host to qwen serve through DaemonSessionClient.
The webview must not call the daemon directly. The extension host owns daemon URL, token, session id, and SSE replay state, then forwards sanitized app events to the webview.
VS Code settings:
{
"qwen-code.experimentalDaemon.enabled": true,
"qwen-code.experimentalDaemon.url": "http://127.0.0.1:4170",
"qwen-code.experimentalDaemon.token": ""
}
Environment fallback for local dogfood:
QWEN_IDE_DAEMON_URL=http://127.0.0.1:4170 code .
DaemonClient./capabilities and verify workspace compatibility.DaemonSessionClient.createOrAttach().session.events() in the extension host.session.prompt().session.cancel() and
session.setModel().session.respondToPermission().The first implementation introduces a sibling connection path, not replace
AcpConnection:
QwenAgentManager
current default -> AcpConnection -> qwen --acp child
experimental -> DaemonIdeConnection -> qwen serve HTTP/SSE
Both paths should feed the same higher-level webview callbacks where practical. If an event cannot be faithfully mapped yet, the daemon path should surface a clear unsupported-state warning rather than silently pretending parity.
This PR adds DaemonIdeConnection as the locally verifiable extension-host
adapter spike. It is not wired into the default QwenAgentManager path yet, so
existing VS Code behavior remains ACP subprocess based.
| Daemon event | IDE handling |
|---|---|
session_update / agent_message_chunk | Existing assistant stream callback |
session_update / agent_thought_chunk | Existing thinking stream callback |
session_update / tool_call | Existing tool-call update callback |
permission_request | Existing approval UI callback |
permission_resolved | Close/update approval UI |
model_switched | Existing model-state callback where possible |
session_died | Disconnect UI + reconnect affordance |
Unknown events must be ignored or logged as debug metadata.
The extension must make daemon locality visible:
Do not imply that local VS Code extensions, local browser profile, local localhost services, or local SSH/kube credentials are automatically available to the daemon.
AcpConnection.qwen serve:
Last-Event-ID