Skip to content

fix: allowlist opusContext1mEnabled in SettingsUpdateSchema#78

Merged
Ark0N merged 1 commit intomasterfrom
fix/opus-context-1m-schema
Apr 28, 2026
Merged

fix: allowlist opusContext1mEnabled in SettingsUpdateSchema#78
Ark0N merged 1 commit intomasterfrom
fix/opus-context-1m-schema

Conversation

@Ark0N
Copy link
Copy Markdown
Owner

@Ark0N Ark0N commented Apr 28, 2026

Summary

  • Adds opusContext1mEnabled: z.boolean().optional() to SettingsUpdateSchema. Without it, PUT /api/settings rejects the field (the schema is .strict()) and the toggle's value never persists across reloads.

Context

Same root cause as the thinkingEffort fix in #73. Discovered while reviewing that PR — verified live against the running server:

  • Pre-fix: PUT /api/settings {"opusContext1mEnabled":true}{"success":false,"error":"Invalid settings","errorCode":"INVALID_INPUT"}
  • Post-fix: accepts and persists.

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, hiding the bug.

Test plan

  • Schema unit-test: safeParse({opusContext1mEnabled: true}) succeeds; bad type rejected
  • npm run typecheck passes
  • npm run lint passes
  • After deploy: verify toggle persists across page reloads

🤖 Generated with Claude Code

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>
@Ark0N Ark0N merged commit 8006cc5 into master Apr 28, 2026
1 check passed
@Ark0N Ark0N deleted the fix/opus-context-1m-schema branch April 28, 2026 01:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant