Skip to content

Conversation

Weves
Copy link
Contributor

@Weves Weves commented Apr 27, 2025

Description

Fixes a few things:

  1. Model configurations were getting wiped on every update (set to empty list).
  2. You could not edit an LLM provider easily. If you tried to re-submit, it would try and use the "masked key" and fail.
  3. We ran the "test" call on every update, even if nothing had changed.

Fixes https://linear.app/danswer/issue/DAN-1912/fix-misc-model-configuration-stuff

How Has This Been Tested?

Tested locally. In the future, might want to add e2e tests for these.

Backporting (check the box to trigger backport action)

Note: You have to check that the action passes, otherwise resolve the conflicts manually and tag the patches.

  • This PR should be backported (make sure to check that the backport attempt succeeds)
  • [Optional] Override Linear Check

@Weves Weves requested a review from a team as a code owner April 27, 2025 21:04
Copy link

vercel bot commented Apr 27, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
internal-search ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 27, 2025 10:20pm

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

This PR fixes critical issues with LLM provider configuration management, focusing on API key handling, model configuration persistence, and test call optimization.

  • Added api_key_changed flag in TestLLMRequest to prevent masked API keys from being used incorrectly during updates
  • Modified API key handling in /backend/onyx/server/manage/llm/api.py to only use existing provider's key when not explicitly changed
  • Added isEqual check in forms to prevent unnecessary test API calls when no changes are made
  • Fixed model configurations persistence by properly handling the configurations array and max_input_tokens values
  • Improved type safety with proper Yup validation and consistent null handling for optional fields

4 file(s) reviewed, 2 comment(s)
Edit PR Review Bot Settings | Greptile

Copy link
Contributor

@raunakab raunakab left a comment

Choose a reason for hiding this comment

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

I think there's one small Greptile change that I think is important. Other than that, seems good to me.

Seems as if some of the misc mistakes in here are due to weird default initialization values that I set.

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
@Weves Weves added this pull request to the merge queue Apr 27, 2025
Merged via the queue into main with commit ea0664e Apr 28, 2025
10 of 11 checks passed
@Weves Weves deleted the fix-llm-api-key branch April 28, 2025 00:05
AnkitTukatek pushed a commit to TukaTek/onyx that referenced this pull request Sep 23, 2025
* Fix LLM API key

* Remove unused import

* Update web/src/app/admin/configuration/llm/LLMProviderUpdateForm.tsx

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>

---------

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
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