Skip to content

[fix] Resolve Mistral api key issue#3969

Merged
bekossy merged 10 commits intorelease/v0.94.4from
fix/mistral-api-key-issue-in-web
Mar 13, 2026
Merged

[fix] Resolve Mistral api key issue#3969
bekossy merged 10 commits intorelease/v0.94.4from
fix/mistral-api-key-issue-in-web

Conversation

@junaway
Copy link
Contributor

@junaway junaway commented Mar 12, 2026

Includes pnpm run format-fix, hence the extra web changes.


Open with Devin

Copilot AI review requested due to automatic review settings March 12, 2026 10:23
@vercel
Copy link

vercel bot commented Mar 12, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
agenta-documentation Ready Ready Preview, Comment Mar 13, 2026 4:59pm

Request Review

@dosubot dosubot bot added the size:XXL This PR changes 1000+ lines, ignoring generated files. label Mar 12, 2026
@junaway junaway changed the base branch from main to release/v0.94.1 March 12, 2026 10:23
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:XXL This PR changes 1000+ lines, ignoring generated files. labels Mar 12, 2026
@dosubot dosubot bot added the documentation Improvements or additions to documentation label Mar 12, 2026

This comment was marked as resolved.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 12, 2026

Railway Preview Environment

Status Destroyed (PR closed)

Updated at 2026-03-13T17:55:09.427Z

@jp-agenta jp-agenta changed the base branch from release/v0.94.1 to release/v0.94.3 March 12, 2026 16:28
Copilot AI review requested due to automatic review settings March 12, 2026 16:36
@jp-agenta jp-agenta requested review from mmabrouk and removed request for Copilot March 12, 2026 16:37
devin-ai-integration[bot]

This comment was marked as resolved.

This comment was marked as resolved.

@bekossy bekossy changed the base branch from release/v0.94.3 to release/v0.94.4 March 13, 2026 16:47
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings March 13, 2026 16:48
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review is ineligible. To be eligible to request a review, you need a paid Copilot license, or your organization must enable Copilot code review.

Copilot AI review requested due to automatic review settings March 13, 2026 16:57
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review is ineligible. To be eligible to request a review, you need a paid Copilot license, or your organization must enable Copilot code review.

Copy link
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

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

Devin Review found 2 new potential issues.

View 14 additional findings in Devin Review.

Open in Devin Review

Copy link
Contributor

Choose a reason for hiding this comment

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

🟡 Custom provider kind matching broken by asymmetric normalization of 'mistralai' alias

In both get_provider_settings and get_provider_settings_from_workflow, request_provider_kind is normalized via _normalize_provider_kind which maps "mistralai""mistral" (via _PROVIDER_KIND_ALIASES at sdk/agenta/sdk/managers/secrets.py:16-18). However, for custom providers, secret_provider_kind is still computed with only .lower().replace(" ", "") — which does NOT apply the alias, leaving it as "mistralai". This causes the comparison request_provider_kind == secret_provider_kind ("mistral" != "mistralai") to fail, so credentials are never extracted and the function returns None.

Before this PR, request_provider_kind used re.sub(r"[\s-]+", "", provider.lower()) which did NOT apply any alias, so both sides would be "mistralai" and would match. This is a regression for any custom provider configured with CustomProviderKind.MISTRALAI (a valid enum value in api/oss/src/core/secrets/enums.py:40). The same issue is duplicated in get_provider_settings_from_workflow at lines 371-372.

(Refers to lines 227-228)

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Copy link
Contributor

Choose a reason for hiding this comment

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

🟡 Same asymmetric custom provider kind normalization in get_provider_settings_from_workflow

Duplicate of the same bug as in get_provider_settings: secret_provider_kind for custom providers uses .lower().replace(" ", "") instead of _normalize_provider_kind, so the "mistralai""mistral" alias is not applied on the secret side while it IS applied on the request side (sdk/agenta/sdk/managers/secrets.py:349). This causes a mismatch and credentials are never matched for custom providers with kind "mistralai".

(Refers to lines 371-372)

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

@bekossy bekossy merged commit d9de6ba into release/v0.94.4 Mar 13, 2026
11 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants