Personal Case.dev key takes priority over shared demo key
The CaseMark fork's demo mode previously gave the shared demo key unconditional priority, making it impossible for users to save their own Case.dev key within Demo Mode. kveton inverted that logic so the personal key wins when present, with the shared demo key as fallback.
The fix is a two-line swap in getEffectiveCaseApiKey(). The old resolution order was: check for demo key, return early if found, check user key if not. The new order checks the user key first. Because the demo key check was also happening before the user key lookup in getCaseCredentialStatus(), that logic was reorganized to match.
Two error guards were removed from saveCaseApiKey() and clearCaseApiKey(). Both previously threw "Demo mode uses the shared Case.dev demo key" when called in demo mode. Removing these guards lets users save or clear a personal key normally in demo mode, with clear reverting to the shared demo key as expected.
The Account > Models page was updated to reflect the new model: a banner explains the demo key is the default, and a standard ApiKeyField is now rendered alongside the banner rather than replacing it when demo mode is active. Anthropic and Gemini direct-provider BYOK fields remain disabled in the hosted demo UI - this PR is narrowly about the Case.dev path.
kveton verified against the production API endpoint: a fresh user shows source: "demo" and the live Case model catalog, confirming the change works end-to-end before merging.
Spotted something wrong? Or know the PR text has fresher detail than the writeup above?