Repository navigation
🤖 refactor: resolve the workspace agent from metadata and an unsent pick - #5908
ibetitsmike wants to merge 7 commits into
Conversation
The agent pick lived in a per-browser agentId key seeded from metadata, so two browsers could disagree. Workspace metadata is now the stored agent and an unsent picker change stays in memory, read through the same resolver as model. Stack-Layer: A3a
A fork now also copies the source composer's unsent agent pick. Startup cleanup removes the retired agentId and workspaceAiSettingsByAgent keys. Adds tests for the project default agent tier and for an unsent agent pick lasting until the saved agent matches it. Merges the updated layer below. Stack-Layer: A3a
A fork now also copies the source composer's unsent agent pick. Startup cleanup removes the retired agentId and workspaceAiSettingsByAgent keys. Adds tests for the project default agent tier and for an unsent agent pick lasting until the saved agent matches it. Merges the updated layer below. Stack-Layer: A3a
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ce56cef278
ℹ️ 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".
Stack-Layer: A3a
Picking the saved agent dropped the pick, so re-picking it while a send of another agent was in flight lost the choice once that send's metadata arrived. The agent pick now follows the field picks' token lifecycle: a send attaches it, and it ends once the saved agent holds it. A workspace without a saved agent also follows project and global default changes, and Auto routing reads a legacy workspace's single settings bucket, like the composer does. Stack-Layer: A3a
Stack-Layer: A3a
Stack-Layer: A3a
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c9a7f22a28
ℹ️ 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".
Summary
A workspace's agent lived in a per-browser
agentId:{scope}key, so two browsers could show different agents for one workspace. It is now read from workspace metadata (a child's locked agent type first, thenagentId). A picker change stays in memory with the field picks' lifecycle: a send carries it, and it ends only once metadata reports that agent, so re-picking an agent while a send is in flight survives that send. Without a saved agent the workspace falls back to the project default agent, then the global default (before: Exec), and follows later changes to those defaults. The picker,AgentContext, the plan handoff, the VS Code webview and the pick store read it this way.seedWorkspaceLocalStorageFromBackendis deleted: metadata loads and updates feed the resolver's store directly. The per-agent settings cache (workspaceAiSettingsByAgent:{workspace}) goes with it; the Auto routing sync reads saved per-agent settings from metadata, falling back to a legacy workspace's singleaiSettingsbucket (getSavedAiSettings). Both keys leave the storage registry, and startup cleanup (removeDroppedCacheKeys) now deletes leftoveragentId:andworkspaceAiSettingsByAgent:values. A fork also copies the source's unsent agent pick. Creation stops writing the new workspace's agent key; its first send carries the agent.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.jsoninstead 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 15 of 20.Testing
WorkspaceContext.test.tsx): a pick survives unrelated metadata updates, and a child's agent type wins over its stored id. TheAgentContext,ProposePlanToolCalland VS Code sub-agent tests use picks and metadata instead of the key.aiSelectionIntent.test.ts).AgentContext.test.tsx), and "mount sync applies configured Auto only when the agent has no workspace bucket" (WorkspaceModeAISync.test.tsx) also covers a legacy workspace's singleaiSettingsbucket.legacyLocalStorageCleanup.test.ts) checks that no registered key is deleted.chatCommands.fork.test.ts) also checks the agent pick.useCreationWorkspace.test.tsx, "sends the global default agent when the project agent is unset" (renamed from "syncs ... to workspace ...") checks the first send's agent; the other creation tests drop their checks of the removed key.make static-checkand the touched test suites pass at the top of the stack; CI checks each layer on its own.Review record
efe7e29096, because a fork without a message dropped the source's unsent picks (fixed by 🤖 feat: fork a workspace with the source composer's unsent AI picks #5897, 🤖 refactor: resolve the workspace agent from metadata and an unsent pick #5908 and 🤖 refactor: resolve auto routing from the unsent pick, saved flags and agent defaults #5909); everything else passed. Round 2: PASS on80f2b5379e: forks from all five entry points keep the unsent picks, startup removes the retired keys, and the round 1 checks still pass; the plan handoff was not exercised because the mock model cannot propose a plan. The Codex round 1 fixes made since then have no remote UAT yet; that is left to the next UAT round on 🤖 refactor: keep preferences and workspace AI picks on the server #5916.ce56cef278: 3 findings, all fixed in 3b01beb. Mike asked to land the stack as one PR, so further review runs on 🤖 refactor: keep preferences and workspace AI picks on the server #5916.