Repository navigation
🤖 refactor: delete the dead agent, compaction and runtime default keys - #5913
Closed
ibetitsmike wants to merge 7 commits into
Closed
ibetitsmike wants to merge 7 commits into
ibetitsmike wants to merge 7 commits into
Conversation
disableWorkspaceAgents, pinnedAgentId and autoCompaction:enabled had no live writer or reader,
and runtime:{project} was a superseded default whose writer no UI called. /new now uses the
configured default runtime instead. Sends no longer read any localStorage key, so the send
option comments stop saying they do.
Stack-Layer: A4
Also tests that /new applies only a configured local default runtime and drops stale localStorage mentions from the runtime parser and compaction option comments. Merges the updated layer below. Stack-Layer: A4
ibetitsmike
added this pull request to stack #5868
October 8, 2026 21:03
Also tests that /new applies only a configured local default runtime and drops stale localStorage mentions from the runtime parser and compaction option comments. Merges the updated layer below. Stack-Layer: A4
ibetitsmike
marked this pull request as ready for review
October 8, 2026 21:33
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: 58ac1bdb48
ℹ️ 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: A4
/new read only the global default runtime, so a project that overrides it got the global choice. It now uses the project default first, as the creation UI does, and still applies only a local default. Stack-Layer: A4
Stack-Layer: A4
Stack-Layer: A4
ibetitsmike
removed this pull request from stack #5868
October 9, 2026 04:50
Contributor
Author
yermakoffivan
pushed a commit
to yermakoffivan/mux
that referenced
this pull request
Oct 9, 2026
…der#5916) ## Summary Lands the server-side preferences work in one squash merge. Every user preference and every per-workspace AI choice now lives only on the server (`config.json` `userPreferences` and workspace metadata); browsers keep no copies in localStorage. This PR replaces the reviewed stacks coder#5844-coder#5879 (preferences) and coder#5894-coder#5913 (workspace AI picks), so the merge queue runs once. Experiments landed earlier in #5833. ## What changes - **Preferences** (appearance, terminal, review, notifications, AI and provider defaults, compaction thresholds, sidebar, usage and analytics choices, tutorial state, power mode, git status mode) follow the user across browsers and update live. Edits go to the server as per-key merge patches (`config.updateUserPreferences`); `config.saveConfig` no longer accepts `userPreferences`. Old localStorage keys are never read again (`uiTheme` stays as a first-paint cache); formerly browser-local values reset once. - **Workspace AI picks** (model, thinking, reasoning mode, agent, Auto routing) resolve from workspace metadata plus an unsent in-memory pick, which the next send saves. Forks copy the source's AI settings and unsent picks. Retired workspace AI keys are deleted at startup, in the desktop app and the VS Code webview. - No import of old local values and no downgrade handling, by design. ## Review record - Per layer: Codex reviewed the preference layers over 7 rounds and the AI-pick layers over 2 rounds; every finding was fixed or answered on its thread. - On this PR: Codex rounds 1 (3 findings), 2 (5), 3 (3), 4 (4), 5 (none), 6 (4), 7 (none) and 8 (1), plus the 6 AI-pick layer findings still open after their round 2, are fixed here or answered on their threads. Declined with reasons: importing old local preference values, keeping the `userPreferencesInitialized` marker and mapping legacy theme names (the plan rules out migration and downgrade handling and resets legacy themes), clearing cached agent bases during a reload, pruning project-keyed preferences of removed projects (the plan keeps them), a timeout for the startup telemetry event (it can only be sent once connected), having a send wait only for the compaction threshold write (the plan has it wait for all pending preference writes, which share one request), and refusing an initial `/goal` when the creation settings save is rejected (same on main; follow-up below). - Remote UAT: PASS at fed9ae5 (round 1). FAIL at 8cbf748 (round 2): a default model save cut off by a lost connection said "Settings could not be saved" although it landed, and a model pick sent with Auto on never ended, so the next send wrote it back over another window's change. Both fixed in f7db7b4. PASS at f7db7b4 (round 3): both fixes, the startup gate (frozen backend, token prompt) and a regression smoke. FAIL at 453a1e7 (round 4): the round 6 fixes (fork start message, full-width toggle, Auto choices while the experiment is off) passed, but when two windows sent within about 200 ms, the first kept showing its own pick and its next send wrote it back over the other window's choice. Fixed in ed42346. PASS at ed42346 (round 5, the final head): the two-window send race in 19 timed runs, the other pick kinds, the single-window send without races, and a smoke of the earlier fixes. - Pixel / Review snapshots need a human reviewer. ## Testing - `make static-check` on the final head; Bun suites for the touched areas (renderer, workspace and task services, backup and context); Jest UI suites for the composer and plan flows; VS Code extension suite (162 tests). - Red-green for every review fix: removing the fix, or unwiring its call site, fails its test. ## Follow-ups - VS Code webview: forward project and global AI defaults, limited to the projects of the shown workspaces. Until then it falls back to per-agent and app defaults, as on main. - Workspace creation with an initial `/goal`: refuse or recover the goal setup when the creation AI settings save is rejected, instead of letting the kickoff use the previously saved settings (as on main). ## Risks Broad but mostly deletion (+6.2k/-9.8k). Highest-risk areas: first paint before the config snapshot arrives, concurrent edits from two windows (last write per key wins), and the AI pick lifecycle around sends, creation, forks and reloads.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Four more localStorage key families go, with their storage registry entries:
disableWorkspaceAgents:{scope}: its UI toggle was already gone, andAgentContextonly reset a storedtrueback tofalseon mount.AgentContextstops reading it and stops passing it toagents.list; the command palette and the workspace menu passfalse, and the composer's skill suggestions and sends keep only the existing per-draft discovery flag.pinnedAgentId:{workspace}andautoCompaction:enabled:{workspace}: nothing read or wrote them.runtime:{project}: a superseded per-project default. Its only writer,setDefaultRuntimeChoiceinuseDraftWorkspaceSettings, had no UI caller and is deleted with its plumbing throughuseCreationWorkspaceandCreationControls./newreadruntime:{project}when no runtime was given. It now uses the default runtime from Settings, the project's first and then the global one as the creation UI does, when that default islocal, and the backend's worktree default otherwise, because/newcannot ask for the host, image or config path that the other runtimes need. A leftover per-project value no longer applies, and startup cleanup (removeDroppedCacheKeys) now deletes leftoverpinnedAgentId:,autoCompaction:enabled:,disableWorkspaceAgents:andruntime:values.The send option builders already read no localStorage key, so their comments, and the runtime string helpers' comments, stop saying they do.
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 20 of 20.Testing
useDraftWorkspaceSettings.test.tsx): it drove the removed setter. "keeps Coder default even after plain SSH usage" no longer seeds the removed key.workspaceStorage.test.ts) drops the removed key from its list.chatCommands.test.ts): with alocaldefault/newcreates a local workspace, with ansshdefault it sends no runtime, and a project default outranks the global one.legacyLocalStorageCleanup.test.ts) covers the four removed prefixes.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.58ac1bdb48: 1 finding, fixed in 7e19a01. 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./newwith a configured local default runtime. The test above now fails when that code is removed.useDraftWorkspaceSettings; whichever lands second needs a rebase.