Repository navigation
fix(web-shell): Load models for fresh standalone sessions #10719
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 1 commit
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
99736ac
fix(web-shell): load models for fresh standalone sessions
doudouOUC 41d74d8
docs(serve): document standalone_session_options_v1 capability
doudouOUC e4b558e
Merge 314b035f6302b68e6e6428b63106a8ae14619816 into fix/standalone-in…
doudouOUC 2ddb0d3
Merge remote-tracking branch 'origin/main' into fix/standalone-initia…
doudouOUC 040ce21
fix(sdk): complete the standalone session-options surface
doudouOUC 998d2e0
fix(cli): harden the standalone options catalog edge cases
doudouOUC c748e0b
fix(web-shell): keep late standalone hydration from clobbering in-fli…
doudouOUC 60ce939
test(cli): expect standalone_session_options_v1 in the capabilities e…
doudouOUC 4ad7810
fix(serve): surface the spawn-time model apply outcome as modelApplied
doudouOUC File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
31 changes: 31 additions & 0 deletions
31
docs/design/2026-09-01-standalone-initial-model-options.md
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,31 @@ | ||
| # Standalone Initial Model Options | ||
|
|
||
| ## Problem | ||
|
|
||
| Web Shell defers standalone session creation until the first prompt. During that pending state the session provider intentionally clears session-scoped model data, so a fresh standalone page renders an empty model picker. Once the first session is created, the attached session supplies the model list and the picker starts working. | ||
|
|
||
| The initial selection also cannot be treated as a post-create preference. Standalone creation already accepts `modelServiceId`; applying the selection with a later best-effort `setModel` can silently run the first prompt with the daemon default when the switch fails. | ||
|
|
||
| ## Design | ||
|
|
||
| The daemon exposes a capability-gated, read-only `GET /standalone/session-options` route. The route is owned by the internal Conversations runtime used for standalone sessions. It acquires that exact runtime, participates in its activity lease, verifies the internal root and runtime generation, and reads the runtime's provider status. The response omits the internal workspace path and ACP-channel state. | ||
|
|
||
| The TypeScript SDK validates the response at runtime and exposes it only when `standalone_session_options_v1` is advertised. Older daemons therefore keep their existing behavior without receiving an unsupported request. | ||
|
|
||
| While Web Shell is connected in a pending standalone context, the session provider reads the standalone options and maps them into the existing `models`, `currentModel`, `currentMode`, and `contextWindow` connection fields. This reuses the existing model picker and reasoning controls without introducing a second application-level model state machine. A failed or unsupported catalog read leaves those fields empty and does not block the first prompt. | ||
|
|
||
| When the first standalone prompt creates a session, Web Shell passes the selected `modelServiceId` in the create request and skips the post-attach model switch. A selected reasoning effort is still applied after attach because it is session configuration, but it is not persisted into the internal Conversations workspace settings. Workspace session creation remains unchanged. | ||
|
|
||
| ## Boundaries | ||
|
|
||
| - The route never accepts `cwd` or `workspaceCwd` and never falls back to the primary workspace. | ||
| - Reading options must not create a standalone session or a per-session directory. | ||
| - The response must not expose the internal Conversations workspace path. | ||
| - Runtime replacement, quarantine, or generation changes fail closed. | ||
| - A missing capability or failed options request does not block prompt submission; the daemon default is used when no model is selected. | ||
| - Standalone create keeps its existing stable UUID, outcome-unknown recovery, and no-automatic-retry behavior. | ||
| - Workspace, Live, Recents, lifecycle menus, uploads, and daemon lifecycle behavior are out of scope. | ||
|
|
||
| ## Verification | ||
|
|
||
| Unit tests cover runtime ownership and redaction, route behavior, capability advertisement, SDK validation, deferred Web Shell hydration, stale/failing option reads, and atomic standalone creation. Browser E2E verifies that a fresh standalone page shows models before creating a session, opening the picker does not create a session, and the selected model is sent in the first standalone create request. |
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
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
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
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
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.