[WRONG BRANCH] fix(claude): rebase hand-edit guard after desktop apply - #217
[WRONG BRANCH] fix(claude): rebase hand-edit guard after desktop apply#217luvs01 wants to merge 1 commit into
Conversation
|
Warning Review limit reached
Next review available in: 49 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
Comment |
|
✅ Deterministic PR hygiene checks passed. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b8850f822d
ℹ️ 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".
| config: OcxConfig, | ||
| persistedClaudeCode: OcxConfig["claudeCode"], | ||
| ): void { | ||
| config.claudeCode = structuredClone(persistedClaudeCode); |
There was a problem hiding this comment.
Preserve pending live Claude settings while rebasing
When a concurrent PUT /api/claude-code has assigned its validated settings to the shared config.claudeCode and yielded at the dynamic import before saving, a Desktop apply can reach this assignment and replace that pending subtree with the disk snapshot. The settings request then resumes, saves the replacement, and returns success even though its changes were discarded. Reconcile the persisted subtree against the existing baseline and live value (or update only desktopProfile while rebasing the baseline) instead of replacing the entire live subtree.
Useful? React with 👍 / 👎.
⏳ DRAFT
What to do
Its title has been prefixed with |
Motivation
claudeCode.desktopProfileto disk but did not refresh the in-memory Claude baseline, which could cause later whole-config saves to silently overwrite operator hand-edited security/routing fields underclaudeCode.Description
adoptPersistedClaudeCode(config, persistedClaudeCode)insrc/config.tsto mirror the exact committedclaudeCodesubtree into the long-lived in-memory snapshot and rebase the hand-edit baseline.persistDesktopProfileFieldinsrc/server/management/agent-settings-routes.tsto capture the committedclaudeCodereturned bymutatePersistedConfig()and calladoptPersistedClaudeCode()only after the durable write succeeds.tests/native-claude-desktop-toggle.test.tsthat exercises apply → hand-edit on-diskclaudeCode→ unrelatedsaveConfigPreservingClaudeCode()and asserts the hand edit is preserved.Testing
node_modules/@oven/bun-linux-x64-baseline/bin/bun test tests/native-claude-desktop-toggle.test.tswas run and the focused test file passed.bun run typecheckwas run and completed successfully.bun run privacy:scanwas run and completed successfully.bun test tests/native-claude-desktop-toggle.test.tswith the environment-provided Bun initially failed due to an environment mismatch (node:zlibexportzstdDecompressSyncmissing), which is an execution-platform issue and not a code regression; the repository-provided baseline Bun binary passed the focused tests, and the broader test run encountered unrelated existing timeouts/auth failures in other integration tests when executing the whole suite.Codex Task