fix: allowlist opusContext1mEnabled in SettingsUpdateSchema#78
Merged
Conversation
Same root cause as the thinkingEffort fix in #73: the schema is .strict(), so unknown keys in PUT /api/settings are rejected with INVALID_INPUT and the toggle never persists. Verified live: pre-fix returned {"errorCode":"INVALID_INPUT"}, post-fix accepts. The frontend has been reading and writing this key for a while (settings-ui.js:336, :1137; session-ui.js:331), so saves were silently failing — users never noticed because the load path falls back to false on missing keys. Co-Authored-By: Claude Opus 4.7 (1M context) <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
opusContext1mEnabled: z.boolean().optional()toSettingsUpdateSchema. Without it,PUT /api/settingsrejects the field (the schema is.strict()) and the toggle's value never persists across reloads.Context
Same root cause as the
thinkingEffortfix in #73. Discovered while reviewing that PR — verified live against the running server:PUT /api/settings {"opusContext1mEnabled":true}→{"success":false,"error":"Invalid settings","errorCode":"INVALID_INPUT"}The frontend has been reading and writing this key for a while (
settings-ui.js:336,:1137;session-ui.js:331), so saves were silently failing — users never noticed because the load path falls back tofalseon missing keys, hiding the bug.Test plan
safeParse({opusContext1mEnabled: true})succeeds; bad type rejectednpm run typecheckpassesnpm run lintpasses🤖 Generated with Claude Code