Skip to content

Conversation

@devin-ai-integration
Copy link
Contributor

@devin-ai-integration devin-ai-integration bot commented Jan 22, 2026

Summary

After signing in to the desktop app, this PR automatically sets transcription and intelligence models to Hyprnote Pro models, while preserving any previous configurations the user had before becoming Pro.

How it works:

  1. On becoming Pro (when isPro transitions from false to true):
    • Save current non-Pro config to pre_pro_* settings (skipped if already using hyprnote provider)
    • Set Pro models (hyprnote provider with cloud/Auto)
  2. On sign-out:
    • If pre_pro_* configs exist → restore them
    • If no saved configs → clear settings
    • Clear pre_pro_* values after restoration

Expected flow: Provider A, Model B → sign in → auto-set to Pro → sign out → restore Provider A, Model B

Files changed:

  • settings.ts: Added 4 new settings values (pre_pro_stt_provider, pre_pro_stt_model, pre_pro_llm_provider, pre_pro_llm_model)
  • account.tsx: On sign-out, restore pre-Pro config if exists, then clear saved values
  • useProModelAutoConfig.ts: On becoming Pro, save current non-Pro config before setting Pro models
  • useProModelAutoConfig.test.ts: Added store-level tests for the Pro model auto-config flow

Review & Testing Checklist for Human

  • Test full flow: Configure OpenAI/Deepgram → sign in (become Pro) → verify Pro models set → sign out → verify original config restored
  • Test fresh install: On fresh install with no config, sign in → verify Pro models are set
  • Test sign-out without pre-Pro config: User who was already on Pro models before sign-in → sign out → verify settings are cleared (not restored to anything)
  • Verify isPro transition timing: The hook only triggers when isPro goes from false to true - verify this works correctly with the billing/auth flow

Notes

  • The pre-Pro settings are stored under the ["ai", "pre_pro_*"] path in the settings store
  • Store-level tests added and passing (483 tests total)
  • TypeScript type checking passes
  • No manual app testing was performed due to pre-existing Rust toolchain environment issue

Link to Devin run: https://app.devin.ai/sessions/4beb976d26874042aba2cc9cb6f1f533
Requested by: @ComputelessComputer

…figs

- Save current STT/LLM configuration before logout to pre_logout_* settings
- On sign-in, restore saved configurations if they exist, otherwise set to Pro models
- Clear saved pre-logout configs after restoration

Co-Authored-By: john@hyprnote.com <john@hyprnote.com>
@netlify
Copy link

netlify bot commented Jan 22, 2026

👷 Deploy Preview for hyprnote-storybook processing.

Name Link
🔨 Latest commit 2adc5dc
🔍 Latest deploy log https://app.netlify.com/projects/hyprnote-storybook/deploys/69723144e8177c0008b18b01

@netlify
Copy link

netlify bot commented Jan 22, 2026

Deploy Preview for hyprnote canceled.

Name Link
🔨 Latest commit 2adc5dc
🔍 Latest deploy log https://app.netlify.com/projects/hyprnote/deploys/69723144c64974000855cc20

@devin-ai-integration
Copy link
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR that start with 'DevinAI' or '@devin'.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@netlify
Copy link

netlify bot commented Jan 22, 2026

Deploy Preview for howto-fix-macos-audio-selection failed.

Name Link
🔨 Latest commit 2adc5dc
🔍 Latest deploy log https://app.netlify.com/projects/howto-fix-macos-audio-selection/deploys/69723144a536ed00080b0d62

- On becoming Pro: save current non-Pro config to pre_pro_* fields, then set Pro models
- On sign-out: restore pre_pro_* config if exists, otherwise clear settings
- Renamed pre_logout_* to pre_pro_* for clearer semantics
- Added store-level tests for the Pro model auto-config flow

Co-Authored-By: john@hyprnote.com <john@hyprnote.com>
Comment on lines +60 to +84
const preProSttProvider = store.getValue("pre_pro_stt_provider");
const preProSttModel = store.getValue("pre_pro_stt_model");
const preProLlmProvider = store.getValue("pre_pro_llm_provider");
const preProLlmModel = store.getValue("pre_pro_llm_model");

if (currentSttProvider === "hyprnote" && currentSttModel === "cloud") {
if (preProSttProvider) {
store.setValue("current_stt_provider", preProSttProvider);
store.setValue("current_stt_model", preProSttModel ?? "");
} else {
store.setValue("current_stt_provider", "");
store.setValue("current_stt_model", "");
}

if (currentLlmProvider === "hyprnote") {
if (preProLlmProvider) {
store.setValue("current_llm_provider", preProLlmProvider);
store.setValue("current_llm_model", preProLlmModel ?? "");
} else {
store.setValue("current_llm_provider", "");
store.setValue("current_llm_model", "");
}

store.setValue("pre_pro_stt_provider", "");
store.setValue("pre_pro_stt_model", "");
store.setValue("pre_pro_llm_provider", "");
store.setValue("pre_pro_llm_model", "");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing Critical Step: The sign-out flow reads and restores pre_pro_* configs but never saves the current Pro configuration before clearing.

What breaks: If a user manually customized their Pro settings (e.g., changed from default hyprnote models to specific models), those customizations are lost on sign-out. The code only restores configs that were saved when first becoming Pro, not the current state at sign-out time.

Impact: User loses any Pro configuration changes they made between sign-in and sign-out.

Fix: Save current config before restoration:

if (store) {
  // Save current Pro settings before clearing
  const currentSttProvider = store.getValue("current_stt_provider");
  const currentSttModel = store.getValue("current_stt_model");
  const currentLlmProvider = store.getValue("current_llm_provider");
  const currentLlmModel = store.getValue("current_llm_model");
  
  if (currentSttProvider === "hyprnote") {
    store.setValue("pre_logout_stt_provider", currentSttProvider);
    store.setValue("pre_logout_stt_model", currentSttModel ?? "");
  }
  if (currentLlmProvider === "hyprnote") {
    store.setValue("pre_logout_llm_provider", currentLlmProvider);
    store.setValue("pre_logout_llm_model", currentLlmModel ?? "");
  }

  // Then restore pre-Pro configs or clear
  const preProSttProvider = store.getValue("pre_pro_stt_provider");
  // ... rest of the logic
}

Note: This requires adding pre_logout_* settings to settings.ts as mentioned in the PR description but missing from implementation.

Suggested change
const preProSttProvider = store.getValue("pre_pro_stt_provider");
const preProSttModel = store.getValue("pre_pro_stt_model");
const preProLlmProvider = store.getValue("pre_pro_llm_provider");
const preProLlmModel = store.getValue("pre_pro_llm_model");
if (currentSttProvider === "hyprnote" && currentSttModel === "cloud") {
if (preProSttProvider) {
store.setValue("current_stt_provider", preProSttProvider);
store.setValue("current_stt_model", preProSttModel ?? "");
} else {
store.setValue("current_stt_provider", "");
store.setValue("current_stt_model", "");
}
if (currentLlmProvider === "hyprnote") {
if (preProLlmProvider) {
store.setValue("current_llm_provider", preProLlmProvider);
store.setValue("current_llm_model", preProLlmModel ?? "");
} else {
store.setValue("current_llm_provider", "");
store.setValue("current_llm_model", "");
}
store.setValue("pre_pro_stt_provider", "");
store.setValue("pre_pro_stt_model", "");
store.setValue("pre_pro_llm_provider", "");
store.setValue("pre_pro_llm_model", "");
// Save current Pro settings before clearing
const currentSttProvider = store.getValue("current_stt_provider");
const currentSttModel = store.getValue("current_stt_model");
const currentLlmProvider = store.getValue("current_llm_provider");
const currentLlmModel = store.getValue("current_llm_model");
if (currentSttProvider === "hyprnote") {
store.setValue("pre_logout_stt_provider", currentSttProvider);
store.setValue("pre_logout_stt_model", currentSttModel ?? "");
}
if (currentLlmProvider === "hyprnote") {
store.setValue("pre_logout_llm_provider", currentLlmProvider);
store.setValue("pre_logout_llm_model", currentLlmModel ?? "");
}
// Then restore pre-Pro configs or clear
const preProSttProvider = store.getValue("pre_pro_stt_provider");
const preProSttModel = store.getValue("pre_pro_stt_model");
const preProLlmProvider = store.getValue("pre_pro_llm_provider");
const preProLlmModel = store.getValue("pre_pro_llm_model");
if (preProSttProvider) {
store.setValue("current_stt_provider", preProSttProvider);
store.setValue("current_stt_model", preProSttModel ?? "");
} else {
store.setValue("current_stt_provider", "");
store.setValue("current_stt_model", "");
}
if (preProLlmProvider) {
store.setValue("current_llm_provider", preProLlmProvider);
store.setValue("current_llm_model", preProLlmModel ?? "");
} else {
store.setValue("current_llm_provider", "");
store.setValue("current_llm_model", "");
}
store.setValue("pre_pro_stt_provider", "");
store.setValue("pre_pro_stt_model", "");
store.setValue("pre_pro_llm_provider", "");
store.setValue("pre_pro_llm_model", "");

Spotted by Graphite Agent

Fix in Graphite


Is this helpful? React 👍 or 👎 to let us know.

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.

2 participants