fix: clean up oauthCredentials after migration
Build Nanobot OAuth / build (pull_request) Failing after 7m49s
Build Nanobot OAuth / cleanup (pull_request) Has been skipped

- Remove oauthCredentials dict after extracting api_key to avoid duplication
- Use _ for unused provider_name variable per convention

Addresses review feedback from PR #32.
This commit is contained in:
2026-03-09 12:20:27 +01:00
parent 1b920d7299
commit 153b08f872
+3 -1
View File
@@ -95,7 +95,7 @@ def _migrate_config(data: dict) -> dict:
# Extract api_key from oauthCredentials if present
providers = data.get("providers", {})
for provider_name, provider_config in providers.items():
for _, provider_config in providers.items():
if isinstance(provider_config, dict):
oauth_creds = provider_config.get("oauthCredentials")
if oauth_creds and isinstance(oauth_creds, dict):
@@ -103,5 +103,7 @@ def _migrate_config(data: dict) -> dict:
# Only set api_key if not already set and access_token exists
if access_token and not provider_config.get("api_key"):
provider_config["api_key"] = access_token
# Clean up migrated data to avoid duplication
del provider_config["oauthCredentials"]
return data