Skip to content

🤖 refactor: delete the workspace AI key seeding and repair - #5907

Closed
ibetitsmike wants to merge 6 commits into
mike/server-side-ai-by-agent-cachefrom
mike/server-side-ai-seeding
Closed

ibetitsmike wants to merge 6 commits into
mike/server-side-ai-by-agent-cachefrom
mike/server-side-ai-seeding

Conversation

@ibetitsmike

@ibetitsmike ibetitsmike commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The per-workspace model, thinking level and reasoning mode keys have no workspace reader left (creation composers still read their own scoped keys until #5912), so seedWorkspaceLocalStorageFromBackend stops writing them, and the guard that kept a reseed from overwriting an unsent pick (hasPendingAiSelectionIntent) goes away. Backend metadata still reseeds the per-agent cache.

Removing a custom provider no longer rewrites those keys or the per-agent cache for every workspace. The backend already rewrites the provider's models in workspace metadata, and the refreshed metadata reseeds the cache. repairLocalModelPreferencesForRemovedProvider now only drops the provider's unsent model picks and clears the last custom provider.

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

Testing

  • "a pick scoped to Plan does not apply to Exec" (aiSelectionIntent.test.ts): a Plan model pick is pending for Plan only and does not go out with an Exec send. It fails when the pending pick's agent check is dropped.
  • "calls the custom provider remove mutation after confirmation" (ProvidersSection.test.tsx): the repair runs with the removed provider after the mutation. It fails when the repair call in ProvidersSection is dropped.
  • Deleted the tests that covered only the removed code: the metadata key seeding and child reseed cases in WorkspaceContext.test.tsx, and the per-workspace model, per-agent cache and no-change cases in modelPreferenceRepair.test.ts.
  • make static-check and the touched test suites pass at the top of the stack; CI checks each layer on its own.

Review record

Nothing reads the workspace model, thinking level and reasoning mode keys any more, so
metadata seeding stops writing them and the unsent-pick reseed guard goes away. Removing
a custom provider no longer rewrites those keys or the per-agent cache for every
workspace: the refreshed backend metadata reseeds the cache, and the browser repair only
drops the provider's unsent model picks and the last custom provider. Tests that covered
only the deleted code go too.

Stack-Layer: A2h
@ibetitsmike
ibetitsmike marked this pull request as ready for review October 8, 2026 21:33
@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:28:10.734851Z 796727a New commits
🔒 Security Review ✅ Completed 2026-10-09T00:27:01.171413Z 796727a 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: 796727abaf

ℹ️ 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/modelPreferenceRepair.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