Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Unexpected Model Deletion in POST /key/update When Updating Team ID #2091

Closed
lucebert opened this issue Feb 20, 2024 · 1 comment · Fixed by #2104
Closed

[Bug]: Unexpected Model Deletion in POST /key/update When Updating Team ID #2091

lucebert opened this issue Feb 20, 2024 · 1 comment · Fixed by #2104
Assignees
Labels
bug Something isn't working

Comments

@lucebert
Copy link
Contributor

What happened?

Issue Summary:

When attempting to update the team_id associated with a key using the POST /key/update endpoint, all models previously associated with the key are unexpectedly deleted. This behavior occurs without any errors being returned by the API, leading to the loss of model associations.

Steps to Reproduce:

Sent a POST request to /key/update with the following payload to update the team_id for an existing key:

{
  "team_id": "new_team_id",
  "key": "sk-..."
}

Received the response confirming the update but indicating that the models array is now empty, implying all models have been disassociated from the key:

{
  "key": "sk-...",
  "models": [],
  "team_id": "new_team_id",
  "allowed_cache_controls": [],
  "aliases": {},
  "config": {},
  "permissions": {},
  "model_max_budget": {}
}

Expected Behavior:

The team_id for the key is updated without affecting the association of models to the key. The models array should retain all previously associated models unless explicitly modified.

Actual Behavior:

The models array is returned empty, indicating that all model associations have been removed following the team_id update, which was not the intended action.

Relevant log output

No response

Twitter / LinkedIn details

No response

@ishaan-jaff
Copy link
Contributor

PR here @lucebert

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants