Skip to content

[6157] fix(sdk): Resolve custom providers by stable slug - #6278

Open
nightcityblade wants to merge 1 commit into
Agenta-AI:mainfrom
nightcityblade:fix/issue-6157
Open

[6157] fix(sdk): Resolve custom providers by stable slug#6278
nightcityblade wants to merge 1 commit into
Agenta-AI:mainfrom
nightcityblade:fix/issue-6157

Conversation

@nightcityblade

@nightcityblade nightcityblade commented Aug 25, 2026

Copy link
Copy Markdown

Summary

Testing

Verified locally

  • cd sdks/python && uv sync --locked
  • uv run --no-sync pytest -q oss/tests/pytest/unit/test_secrets_manager_connection_slug.py oss/tests/pytest/unit/test_secrets_manager_model_normalization.py oss/tests/pytest/unit/test_secrets_manager_custom_provider_ssrf.py — 112 passed
  • ruff format agenta/sdk/managers/secrets.py oss/tests/pytest/unit/test_secrets_manager_connection_slug.py
  • ruff check --fix agenta/sdk/managers/secrets.py oss/tests/pytest/unit/test_secrets_manager_connection_slug.py — passed

Added or updated tests

  • Updated custom-connection coverage for a stable slug that differs from the display-name-derived provider slug.
  • Added coverage proving an unmatched custom model key fails before a provider call and reports the configured key.

QA follow-up

  • Verify one custom OpenAI-compatible provider whose display name differs from its slug through a real completion flow.

Demo

Focused regression verification for stable-slug resolution and the unmatched-key guard:

Focused pytest verification: four regression cases passed

Checklist

  • I have included a video or screen recording for UI changes, or marked Demo as N/A
  • Relevant tests pass locally
  • Relevant linting and formatting pass locally
  • I have signed the CLA, or I will sign it when the bot prompts me

Contributor Resources

@vercel

vercel Bot commented Aug 25, 2026

Copy link
Copy Markdown

Someone is attempting to deploy a commit to the agenta projects Team on Vercel.

A member of the Team first needs to authorize it.

@dosubot dosubot Bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Aug 25, 2026
@github-actions

github-actions Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

✅ Thanks @nightcityblade! This PR now meets the contribution requirements and has been reopened. A maintainer will review it soon.

@github-actions github-actions Bot added the incomplete-pr PR is missing required template sections or a demo recording label Aug 25, 2026
@dosubot dosubot Bot added python Pull requests that update Python code tests labels Aug 25, 2026
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


nightcityblade seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@github-actions github-actions Bot closed this Aug 25, 2026
@coderabbitai

coderabbitai Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: 80444b6f-b5ce-458d-b3a5-e9ccb37b2cd4

📥 Commits

Reviewing files that changed from the base of the PR and between a09a0f0 and bf13f8a.

📒 Files selected for processing (2)
  • sdks/python/agenta/sdk/managers/secrets.py
  • sdks/python/oss/tests/pytest/unit/test_secrets_manager_connection_slug.py

Disabled knowledge base sources:

  • Linear integration is disabled

You can enable these sources in your CodeRabbit configuration.


📝 Walkthrough

Summary by CodeRabbit

  • Bug Fixes
    • Improved provider identification when display names change, preserving access to saved models.
    • Corrected legacy provider namespaces in saved custom model settings.
    • Custom models without a configured provider now return a clear validation error, including available model details.

Walkthrough

The secrets manager now resolves custom providers by stable slug, rewrites legacy model-key namespaces, and raises InvalidSecretsV0Error for unconfigured custom models. Unit tests cover renamed provider display names and invalid custom model requests.

Changes

Custom provider resolution

Layer / File(s) Summary
Normalize provider slugs and model keys
sdks/python/agenta/sdk/managers/secrets.py
_parse_custom_secrets prefers the stable slug and rewrites legacy model-key prefixes before storing the parsed record.
Reject invalid custom model requests
sdks/python/agenta/sdk/managers/secrets.py, sdks/python/oss/tests/pytest/unit/test_secrets_manager_connection_slug.py
Custom connection and family lookups raise InvalidSecretsV0Error for unmatched custom models. Tests cover renamed display names and error details listing configured models.

Estimated code review effort: 2 (Simple) | ~10 minutes

✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot removed the incomplete-pr PR is missing required template sections or a demo recording label Aug 25, 2026
@github-actions github-actions Bot reopened this Aug 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

python Pull requests that update Python code size:S This PR changes 10-29 lines, ignoring generated files. tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

(bug) Custom provider: slug is derived from the display name, and unmatched model keys pass through verbatim

2 participants