qwen-code/docs
sunday e75aec9d5b
feat(channels): stamp daemon sourceId with channel instance name on created sessions (#7078)
* feat(channels): stamp daemon sourceId with channel instance name on created sessions

Channel workers tagged created sessions with sourceType 'channel' (#6991,
refs #6962) but no sourceId, leaving sessions from different channel
instances (e.g. dingtalk-main vs feishu-main) indistinguishable on the
daemon data plane (session lists, transcripts, ?sourceType= filters).
The session-source mechanism already supports a paired sourceId —
scheduled tasks use it for the task id.

Plumb the channel instance name through the creation path:
SessionRouter.createLiveSession → bridge.newSession options
(ChannelAgentBridgeSessionOptions.sourceId) → session-factory request →
createOrAttach. loadSession deliberately never forwards it: loading an
existing session never re-stamps its creation attribution, matching the
issue's 'only newly created channel sessions should be tagged' rule and
the daemon's single-attach source rule.

Tests: channels/base suite (764) and cli daemon-worker suite (66) green.
New cases cover router stamping, bridge new-vs-load forwarding, and the
worker factory create-vs-load behavior.

* fix(channels): declare sourceId in createOrAttach DI type and cover replacement-path stamping

Review feedback on #7078:

- DaemonSessionClientStaticLike.createOrAttach's request type declared
  sourceType but not sourceId; the field type-checked only via object-spread
  excess-property exemption. Declare sourceId?: string so the contract
  documents the request and direct-property edits keep compiling.
- Add a sourceId assertion to the load-failure replacement test so the
  recovery path's per-instance attribution is regression-guarded.

---------

Co-authored-by: 欢伯 <ri.xur@alibaba-inc.com>
2026-07-17 14:57:27 +00:00
..
assets feat(web-shell): support custom Hex session group colors (#6752) 2026-07-12 10:41:17 +00:00
design feat(channels): stamp daemon sourceId with channel instance name on created sessions (#7078) 2026-07-17 14:57:27 +00:00
developers feat(serve): add GET /workspace/:id/session-info for session totals (#7077) 2026-07-17 06:18:49 +00:00
e2e-tests feat(worktree): Phase D — startup --worktree flag + symlinkDirectories + PR refs (#4381) 2026-05-27 17:04:51 +08:00
plans feat(channels): support DingTalk webhook delivery to direct messages (#6891) 2026-07-15 03:07:30 +00:00
superpowers fix(feishu): validate credentials before WebSocket startup (#6780) 2026-07-13 02:10:16 +00:00
users feat(cli): mouse text selection and copy in VP mode (#6937) 2026-07-17 08:04:07 +00:00
verification/abort-controller-refactor fix(core): stop AbortSignal listener leak in long sessions (MaxListenersExceededWarning) (#4366) 2026-05-26 14:21:49 +08:00
_meta.ts feat: refactor docs 2025-12-05 10:51:57 +08:00
index.md fix: lint issues 2025-12-19 15:52:11 +08:00