fix: case selection not persisting across page refresh#49
Merged
Ark0N merged 1 commit intoArk0N:masterfrom Mar 25, 2026
Merged
Conversation
saveLastUsedCase() was GET-ing the full settings object and PUT-ing it back. The settings contained `modelConfig` which is not in the strict SettingsUpdateSchema, causing a 400 rejection. Now sends only the `lastUsedCase` field — the backend already merges partial updates.
Owner
|
Thank you for this fix! Great root cause analysis — the strict Zod schema rejecting |
Ark0N
added a commit
that referenced
this pull request
Mar 25, 2026
…rejection Tests that partial PUT /api/settings with just lastUsedCase works correctly and that including modelConfig triggers strict Zod schema rejection (the bug fixed in #49). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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
saveLastUsedCase()was silently failing with HTTP 400 because it sent the full settings object (includingmodelConfig) back toPUT /api/settings, which uses.strict()Zod validation{ lastUsedCase: caseName }— the backend already merges partial updates via{ ...existing, ...settings }Root Cause
SettingsUpdateSchemahas.strict()mode, rejecting any fields not explicitly defined.modelConfigexists in the settings file but is not part ofSettingsUpdateSchema(it has its own dedicated API at/api/execution/model-config). The GET-then-PUT pattern sent all fields includingmodelConfig, triggering the 400 error.Test plan
🤖 Generated with Claude Code