qwen-code/docs/design/web-shell/web-shell-session-created-callback.md
Heyang Wang 9223de3517
docs(web-shell): organize design documents by feature area (#8304)
Group the existing Web Shell design materials under a dedicated directory
so related specifications and supporting assets are easier to navigate.

- Move Web Shell design documents into the web-shell directory
- Keep pane header action screenshots alongside their design notes
- Normalize selected filenames to use the web-shell spelling

Co-authored-by: heyang.why <heyang.why@alibaba-inc.com>
2026-08-01 14:32:20 +00:00

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.