mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-07-28 10:24:45 +00:00
* feat(web-shell): add session created callback * fix(web-shell): bound session callback setup * fix(web-shell): serialize session preparation * fix(web-shell): clarify session preparation diagnostics * fix(web-shell): handle session preparation races --------- Co-authored-by: ytahdn <ytahdn@gmail.com> Co-authored-by: qwen-code-dev-bot <qwen-code-dev-bot@users.noreply.github.com> Co-authored-by: Shaojin Wen <shaojin.wensj@alibaba-inc.com>
749 B
749 B
Web Shell session-created callback
Goal
Let an embedding host run asynchronous work with a newly created session ID before Web Shell continues session initialization or submits the first prompt.
Design
Add an optional onSessionCreated(sessionId) prop to WebShell. The lazy
session-creation path awaits it immediately after createSession succeeds and
before attaching the session. A rejected callback aborts the first prompt and
uses the existing unattached-session cleanup path. The callback times out after
30 seconds so a host cannot permanently block setup or leak the unattached
session.
Existing sessions loaded through the sessionId prop or session picker do not
invoke the callback because Web Shell did not create them.