Skip to content

🤖 refactor: resolve the workspace model from metadata and an unsent pick - #5901

Closed
ibetitsmike wants to merge 7 commits into
mike/server-side-ai-model-seedsfrom
mike/server-side-ai-model
Closed

ibetitsmike wants to merge 7 commits into
mike/server-side-ai-model-seedsfrom
mike/server-side-ai-model

Conversation

@ibetitsmike

@ibetitsmike ibetitsmike commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Summary

A workspace's model now comes from the resolver added in #5895 instead of the model:{workspace} key. The readers that switch are the desktop composer and its sends (useSendMessageOptions), getSendOptionsFromStorage (compaction, resume and the plan handoff), the command palette, the title bar, the streaming barrier, the Tasks settings section, useWorkspaceFallbackModel and the VS Code composer.

A model pick in a workspace now stays in memory as an unsent pick until a send saves it to workspace metadata, so it no longer survives a reload. A send marks its picks sent, and a sent pick ends only once the agent's saved settings hold its value, so a failed best-effort save keeps it; the plan handoff ends the picks it sends the same way. The VS Code webview drops unsent picks and cached AI metadata when it switches to another server, which can reuse workspace IDs, and keeps them across a reconnect to the same server. Project, global and draft scopes keep writing their scoped default. Agent switches in WorkspaceModeAISync and the plan handoff no longer copy a model into the key, since each agent resolves its own; the sync only records the explicit change for the context-switch warning. Workspace creation stops copying the project model into the new workspace's key. Removing a custom provider also drops that provider's unsent model picks, which would otherwise outrank the repaired settings. Metadata seeding and provider repair of the old key stay until #5907.

Stack

Milestone M4 of the server-side settings stack, on top of M3 (#5869 to #5879): per-workspace AI picks (model, thinking level, reasoning mode, agent and Auto routing) are stored in workspace metadata in config.json instead of per-browser localStorage keys, so every browser shows the same picks. An unsent picker change stays in memory in its tab until a send saves it, and a reload before sending drops it, as the plan accepts. Layer 8 of 20.

Testing

Review record

The composer, sends, palette, plan handoff, title bar and VS Code composer read the model
through the resolver, and a model pick stays in memory until the next send saves it. Agent
switches no longer copy a model into the model key, since each agent resolves its own, and
removing a provider drops its unsent model picks. Seeding and repair of the old key stay until
a later commit deletes them.

Stack-Layer: A2c3
The composer's model now resolves from the in-memory unsent picks, and the Storybook
test-runner renders all stories of a file in one page, so one story's unsent pick leaked
into the next story (App/Astra Pro Desktop started with Pro mode on once the reasoning
mode resolves the same way). Reset the picks with the other per-story state.

Stack-Layer: A2c3
@ibetitsmike
ibetitsmike marked this pull request as ready for review October 8, 2026 21:32
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-09T00:27:08.838357Z 8abc63e New commits
🔒 Security Review ✅ Completed 2026-10-09T00:27:36.803819Z 8abc63e New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 23cfbe5a57

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/browser/utils/messages/sendOptions.ts
Comment thread src/browser/features/ChatInput/useCreationWorkspace.ts
Comment thread vscode/src/webview/ChatComposer.tsx
A successful send consumed its picks at once, so when the saved settings arrived later
(the VS Code metadata pump) or not at all (a failed best-effort save), the composer
reverted to the old value. A sent pick now ends when the agent's saved bucket holds it;
an unsent pick stays the composer's value even when it equals the saved one. The plan
handoff consumes the picks it sends, like a composer send. Legacy workspace ids that
start with "__" record model picks as unsent picks.

Stack-Layer: A2c3
Unsent picks and cached AI metadata outlived a switch to another server, and another server
can reuse a workspace ID, so a pick made on the first server applied to the second one's
workspace and its next send saved it there. A switch to another server now clears them
before that server's workspaces arrive; a reconnect to the same server keeps them.

Stack-Layer: A2c3
resetAiSelectionIntentForTests became an alias of clearAiSelectionState, which the VS Code
webview calls on a server switch, so its test-seam comment is gone and check-test-seam-comments
flagged the entry as stale.

Stack-Layer: A2c3
@ibetitsmike
ibetitsmike removed this pull request from stack #5868 October 9, 2026 04:49
@ibetitsmike

Copy link
Copy Markdown
Contributor Author

Landed in #5916 (7b9899d), which collapsed this stack into one squash merge.

@ibetitsmike ibetitsmike closed this Oct 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant