Repository navigation
Conversation
…fail the edit A rewrite of the same size keeps config.json's inode and size, and within one tick of a coarse filesystem clock its mtime too. The tests restore the mtime with utimes, so the stat key cannot tell the rewrite apart. A write's save then replaced the other writer's bytes, and an edit that changed nothing (a settings clear's legacy clear) reported success while the file carried a legacy enable. --- _Generated with [`xum`](https://github.com/coder/xum) • Model: `anthropic:claude-opus-5-5` • Thinking: `xhigh`_
assertConfigFileUnchanged checked only config.json's stat key (device, inode, size, mtime) before a save's rename and before an edit that writes nothing returned. It now also reads the file and compares it with the bytes the edit read: one more read per save, and none when both reads found no file. --- _Generated with [`xum`](https://github.com/coder/xum) • Model: `anthropic:claude-opus-5-5` • Thinking: `xhigh`_
Keeps readConfigOrDefault's complexity where it was (CRAP floor), and the service test asserts the outcome and the server state without asymmetric matchers. --- _Generated with [`xum`](https://github.com/coder/xum) • Model: `anthropic:claude-opus-5-5` • Thinking: `xhigh`_
Each edit now reads config.json once more, right before its rename, to compare its bytes. --- _Generated with [`xum`](https://github.com/coder/xum) • Model: `anthropic:claude-opus-5-5` • Thinking: `xhigh`_
…e file stays refuses to save The lenient read hands the transform defaults for ENOENT, and the file's stat did not change, so the stat check alone let the save replace the registry with them. --- _Generated with [`xum`](https://github.com/coder/xum) • Model: `anthropic:claude-opus-5-5` • Thinking: `xhigh`_
Codex Review Summary: ✅ CompletedThis 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. |
|
Codex Review: Didn't find any major issues. 👍 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
🛡️ Codex Security Review · Automatically triggeredSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
🟢 e2e stories (Haiku): 14 passed22 agent steps · 7 replayed from cache · 15 model calls · 47.2k tokens (27% cached) All 14 tests in 9 files
e2e 0.20.0 · 1m 23s · web · run artifacts 🟢 e2e Electron stories (Haiku): 3 passed3 agent steps · 3 model calls · 7.9k tokens (33% cached) All 3 tests in 3 files
e2e 0.20.0 · 24.5s · electron · run artifacts 🟢 e2e agent repros (Haiku): no tests selectedSpend: $0.00 of the $1.00 cap (proxy ledger) e2e 0.20.0 · 7.2s · 2 targets (web, phone) · run artifacts |
…n a rewrite right after the edit's read
|
Codex Review: Didn't find any major issues. What shall we delve into next? Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
🛡️ Codex Security Review · Automatically triggeredSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
Summary
A config edit now refuses to save, and an edit that changes nothing refuses to report success, when config.json no longer holds the bytes that the edit read. Before,
assertConfigFileUnchangedcompared only config.json's stat key (device, inode, size and mtime). Another writer that skips Xum's lock (a manual editor, an older Xum) can rewrite the file in place at the same size: that keeps the inode and the size, and within one tick of a coarse filesystem clock the mtime too. Then a save replaced that writer's bytes, and a settings clear that found no legacy value to clear (#8035) reported success while config.json carried a legacy enable of the server.Background
assertConfigFileUnchangedbefore a save's rename. Its comment said that an in-place rewrite with the same inode, size and mtime still passes, and that a content check would cost a read per save.CONFIG_UNCHANGED) skip its write and run the same check, and its body states this gap. A verifier reproduced it withoututimeson 🤖 perf: an MCP settings save leaves config.json alone when it has no legacy value to clear #8035's head: two back-to-back same-sizewriteFileSyncrewrites kept the stat key on this host's coarse clock in 186 of 200 pairs, and the clear then reported success with the server enabled in 19 of 60 runs.Implementation
ConfigFileRead).readConfigByteshands the bytes over through areadBytesoption.assertConfigFileUnchangedchecks the stat key as before. Then it reads config.json and compares the bytes with the edit's. When both reads found no file, it has nothing to compare. An edit whose read got no bytes while the file exists refuses: the lenient read treats ENOENT as a fresh install and hands the transform defaults, and a save on those defaults would replace the registry.CONFIG_UNCHANGED.Validation
utimes, so they need no timing:config.test.ts, write path: on main the edit saved and replaced the other writer's bytes.config.test.ts,editConfigIfChangedthat returnsCONFIG_UNCHANGED: on main it resolved.workspaceMcpOverridesService.test.ts, a settings clear (🤖 perf: an MCP settings save leaves config.json alone when it has no legacy value to clear #8035's skip path): on main it reported "saved", and a fresh reader sawconsent-sensitiveenabled.workspaceMcpOverridesService.test.ts, a settings write: on main it reported "saved".src/node/config/snapshot.test.ts) now count one more read per edit.config.test.ts314 pass,src/node/config/snapshot.test.ts25 pass,workspaceMcpOverridesService.test.ts191 pass, 0 fail. typecheck, static-check, lint-eslint, fmt-check, crap-check and dry-check pass there.src/reachconfig/index.ts. Run 8 at a time (one load sample: 144), 459 passed. One at a time with a 120 s test limit, 39 of the other 43 passed. Of the last 4:src/node/config/snapshot.test.tscounted the new read (now updated, 25 pass);historyService.statusSuffix.test.tspassed on its own run;src/cli/workflow.test.tsdid not run, since it needsdist/cli/index.js(make build-main), and the same 2 tests fail that way on main.goalAdvancement.test.tsis flaky on main too: an independent verifier saw it fail 5 of 8 runs on b2049e1 and 4 of 8 on main. The 156 suites undertests/run in CI.Read cost of the check, measured on this host (Bun 1.4.3, 1-minute load 67-110 from other jobs): 2,000 reads of config.json plus the byte compare, and 200
editConfigsaves, per size.The save times differ by less than the noise at this load.
Risks
Generated with
xum• Model:anthropic:claude-opus-5-5• Thinking:xhigh• Cost:$356.33