Skip to content

🤖 feat: add a resolver for workspace model, thinking and reasoning picks - #5895

Closed
ibetitsmike wants to merge 3 commits into
mike/server-side-ai-backendfrom
mike/server-side-ai-resolver
Closed

ibetitsmike wants to merge 3 commits into
mike/server-side-ai-backendfrom
mike/server-side-ai-resolver

Conversation

@ibetitsmike

@ibetitsmike ibetitsmike commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds the renderer resolver that the next layers switch to: getWorkspaceAiSelection (plain reader) and useWorkspaceAiSelection (hook) in workspaceAiSettingsSync.ts. For a workspace and agent it resolves each field from, in order, the unsent pick, the workspace's saved settings for that agent (aiSettingsByAgent, falling back to aiSettings), the agent's configured defaults, then the project default and the global default. A saved per-agent entry owns the reasoning mode, so an entry without one means standard. Creation composers (the reserved global, project, pending and draft scope IDs, isNonWorkspaceScopeId) keep resolving from their own project, global or draft defaults, in both readers; a legacy workspace whose ID starts with __ resolves as a workspace.

The pick store in aiSelectionIntent.ts gains what the resolver needs: a per-workspace copy of the AI metadata (setWorkspaceAiMetadata, fed by metadata loads in the desktop app and the VS Code webview), a reader for one pending pick, change notifications for the hook, and dropPendingModelPicks for provider removal. Nothing reads the resolver yet, so no behavior changes.

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 2 of 20.

Testing

  • "each field falls through the unsent pick, saved settings, agent and project defaults" (workspaceAiSettingsSync.test.ts): each tier, including an unsent reasoning pick, wins over the ones below it for model, thinking level and reasoning mode.
  • "the hook follows a default model that loads after it rendered" (same file): the hook picks up a global default that arrives after its first render.
  • "a creation scope resolves its own defaults in the hook and the plain reader" (same file): a creation scope reads its scoped defaults, not the agent's configured model. It fails when either the hook's or the plain reader's creation-scope branch is removed.
  • "a legacy workspace id that starts with __ resolves its saved settings" (same file): a legacy __<project>-<branch> workspace reads its saved settings, not creation defaults.
  • The metadata seeding test in WorkspaceContext.test.tsx also checks that a non-archived metadata event reaches the resolver's store.
  • make static-check and the touched test suites pass at the top of the stack; CI checks each layer on its own.

Review record

The resolver reads, per field, the unsent pick, the workspace's saved settings for the agent,
the agent's configured defaults, then project and global defaults. Creation scopes keep their
own scoped defaults in both the hook and the plain reader. Workspace metadata loads (desktop and
webview) now feed its store, but nothing reads the resolver yet.

Stack-Layer: A2a
…late

Merges the updated layer below.

Stack-Layer: A2a
@ibetitsmike
ibetitsmike added this pull request to stack #5868 October 8, 2026 21:03
@ibetitsmike ibetitsmike changed the title mike/server side ai resolver 🤖 feat: add a resolver for workspace model, thinking and reasoning picks Oct 8, 2026
@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:57.558956Z 86e280c New commits
🔒 Security Review ✅ Completed 2026-10-09T00:26:32.644110Z 86e280c 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: a97db95b3f

ℹ️ 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/workspaceAiSettingsSync.ts Outdated
Comment thread src/browser/utils/workspaceAiSettingsSync.ts
The resolver treated every id starting with "__" as a creation scope, so a legacy
`<project basename>-<branch>` workspace read creation defaults instead of its saved
settings. Only the global, project, pending and draft scopes count as creation scopes.

Stack-Layer: A2a

@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: 86e280c72b

ℹ️ 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/aiSelectionIntent.ts
@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