fix(agents): enforce exact profile model identity (#3473)
Co-authored-by: ayattara <alassane.yattara@savoirfairelinux.com> Co-authored-by: Carlos Florencio <carlosmflorencio@gmail.com>
This commit is contained in:
@@ -43,7 +43,7 @@ describe("StatusMessage model selection warnings", () => {
|
||||
expect(screen.getByText("The saved model was not advertised by the executor.")).toBeTruthy();
|
||||
});
|
||||
|
||||
it("explains when the executor applied the only advertised variation", () => {
|
||||
it("renders a retired variation reason from a persisted legacy warning", () => {
|
||||
const comment = modelSelectionWarningMessage();
|
||||
comment.metadata = {
|
||||
...comment.metadata,
|
||||
|
||||
@@ -180,11 +180,15 @@ function modelSelectionReasonLabel(reason: string | undefined): string {
|
||||
const keyByReason: Record<string, string> = {
|
||||
requested_not_advertised: "task:modelSelectionReasonRequestedNotAdvertised",
|
||||
fallback_not_advertised: "task:modelSelectionReasonFallbackNotAdvertised",
|
||||
unique_variation_applied: "task:modelSelectionReasonUniqueVariation",
|
||||
catalog_empty: "task:modelSelectionReasonCatalogEmpty",
|
||||
selection_unsupported: "task:modelSelectionReasonUnsupported",
|
||||
selection_failed_auto_fallback: "task:modelSelectionReasonAutoFallback",
|
||||
};
|
||||
// Old persisted rows can contain this retired reason. Rendering it is a
|
||||
// migration-only compatibility path; no active selection policy uses it.
|
||||
if (reason === "unique_variation_applied") {
|
||||
return t("task:modelSelectionReasonUniqueVariation");
|
||||
}
|
||||
return reason
|
||||
? t(keyByReason[reason] ?? "task:modelSelectionReasonUnknown", { reason })
|
||||
: t(UNKNOWN_TASK_KEY);
|
||||
|
||||
Reference in New Issue
Block a user