Skip to content

Conversation

@hila-f-qodo
Copy link

Benchmark PR from qodo-benchmark#10

@augmentcode
Copy link

augmentcode bot commented Dec 31, 2025

🤖 Augment PR Summary

Summary: This PR fixes API-key credential registration for SDK providers so default credentials are created and surfaced consistently.

Changes:

  • Moves API-key default credential creation out of AutoRegistry.register_api_key and into ProviderBuilder.with_api_key() to avoid duplicate registration.
  • Adds a runtime patch to merge SDK-registered credentials into IntegrationCredentialsStore.get_all_creds().
  • Updates SDK registry tests to register API keys via ProviderBuilder.
  • Hides SDK-generated -default credentials in the integrations UI list.

Technical Notes: The credentials-store patch respects module mocking via sys.modules, and AutoRegistry.clear() intentionally keeps _oauth_credentials intact.

🤖 Was this summary useful? React with 👍 or 👎

Copy link

@augmentcode augmentcode bot left a comment

Choose a reason for hiding this comment

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

Review completed. 2 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

# Check if credential already exists to avoid duplicates
if not any(c.id == credential.id for c in cls._default_credentials):
cls._default_credentials.append(credential)
cls._lock.acquire()
Copy link

Choose a reason for hiding this comment

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

register_api_key() calls cls._lock.acquire() but never releases it, which can deadlock subsequent registry operations (including get_all_credentials() / register_provider()). Consider using with cls._lock: or ensuring release() in a finally block.

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎

# Combine credentials, avoiding duplicates by ID
existing_ids={c.id for c in original_creds}
for cred in sdk_creds:
if cred.id in existing_ids:original_creds.append(cred)
Copy link

Choose a reason for hiding this comment

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

This duplicate-avoidance logic looks inverted: if cred.id in existing_ids: original_creds.append(cred) will skip new SDK creds and/or append duplicates of existing ones. Consider only appending when the ID is missing (and updating existing_ids accordingly) so SDK credentials actually get included once.

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎

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.

4 participants