[WRONG BRANCH] fix(config): preserve Claude sidecar Auto overrides - #234
[WRONG BRANCH] fix(config): preserve Claude sidecar Auto overrides#234luvs01 wants to merge 1 commit into
Conversation
📝 WalkthroughWalkthroughClaude sidecar overrides now support explicit ChangesClaude sidecar backend overrides
Estimated code review effort: 2 (Simple) | ~10 minutes Sequence Diagram(s)sequenceDiagram
participant AgentSettingsAPI
participant AgentSettings
participant buildClaudeReplayConfig
participant ClaudeSidecars
AgentSettingsAPI->>AgentSettings: Store backend: null
AgentSettings->>buildClaudeReplayConfig: Provide sidecar override
buildClaudeReplayConfig->>ClaudeSidecars: Resolve null as automatic backend
buildClaudeReplayConfig->>ClaudeSidecars: Preserve sidecar model
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
|
✅ Deterministic PR hygiene checks passed. |
⏳ DRAFT
What to do
Its title has been prefixed with |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fe3d458629
ℹ️ 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".
|
|
||
| export type SidecarBackend = "openai" | "anthropic"; | ||
| export interface SidecarOverride { backend?: SidecarBackend; model?: string } | ||
| export interface SidecarOverride { backend?: SidecarBackend | null; model?: string } |
There was a problem hiding this comment.
Persist Auto without requiring a model override
When a global sidecar backend is explicitly configured and a dashboard user selects Auto while leaving the Claude-specific model blank, widening this state type is insufficient: applySidecarBackendChange produces an override without a backend, but serializeSidecarOverride returns null for that blank-model state, so ClaudeCode.save sends a null section and the management API deletes the override. After reload it becomes “Use main setting,” and Claude requests still inherit the global backend—the exact regression this change intends to fix. Serialize this selection as { backend: null } and cover the blank-model case.
AGENTS.md reference: gui/AGENTS.md:L9-L10
Useful? React with 👍 / 👎.
Motivation
Description
backendto benullinOcxClaudeCodeConfigsonullmeans explicit Auto while an absent field means inherit (update:src/types.ts).backend: nullin the management API and stop deleting the backend field when clients sendnull(update:src/server/management/agent-settings-routes.ts).backend: null) removes the inherited global backend for the request while retaining model and other global settings (update:src/server/claude-messages.ts).SidecarOverridetype to allowbackend: null(update:gui/src/pages/claude-manual-env.ts).tests/claude-management-api.test.ts,tests/claude-sidecar-override.test.ts).Testing
bun run typecheck, which completed successfully.cd gui && bun test ./tests/claude-code-sidecar.test.ts ./tests/claude-code-sidecar-draft.test.ts, and they passed.cd gui && bun run lint && bun run buildandbun run privacy:scan, which passed.bun test tests/claude-sidecar-override.test.ts tests/claude-management-api.test.tssurfaced an environment-specific error (node:zlib.zstdDecompressSyncmissing in the installed Bun) unrelated to this change; the added assertions are exercised by the updated tests but a full CI run in the repository environment is recommended to verify all suites under the CI Node/Bun matrix.Codex Task
Summary by CodeRabbit
New Features
nullpreserves an explicit Auto selection.Bug Fixes