From cd6e6cd8e90ba676c3daab7f885af14ae478aaba Mon Sep 17 00:00:00 2001 From: Fabricio Aguiar Date: Wed, 29 Jul 2026 17:17:56 +0100 Subject: [PATCH] CONSOLE-5118: Improve AI assessment prompts and update irreversibility notice Standardize TL;DR sections across all prompt templates by moving Data Completeness near the top, simplifying its format, and enforcing terminal fields (Recommendation/Next Steps). Update the AI Assessment card icon and split the irreversibility warning into a title and body for better readability. Co-Authored-By: Claude Opus 4.6 Signed-off-by: Fabricio Aguiar --- .../cluster-updates/prompts/precheck-no-updates.ts | 2 +- .../cluster-updates/prompts/precheck-specific.ts | 3 ++- .../components/cluster-updates/prompts/precheck.ts | 3 ++- .../components/cluster-updates/prompts/progress.ts | 2 +- .../cluster-updates/prompts/troubleshoot.ts | 5 +++-- .../cluster-settings/cluster-settings.tsx | 13 ++++++++----- .../components/modals/cluster-update-modal.tsx | 10 ++++++---- frontend/public/locales/en/public.json | 3 ++- 8 files changed, 25 insertions(+), 16 deletions(-) diff --git a/frontend/packages/console-shared/src/components/cluster-updates/prompts/precheck-no-updates.ts b/frontend/packages/console-shared/src/components/cluster-updates/prompts/precheck-no-updates.ts index e9c7d44b2da..d34ad28dbba 100644 --- a/frontend/packages/console-shared/src/components/cluster-updates/prompts/precheck-no-updates.ts +++ b/frontend/packages/console-shared/src/components/cluster-updates/prompts/precheck-no-updates.ts @@ -141,13 +141,13 @@ Conditions have TWO important fields you MUST check: ## TL;DR - **Overall Status**: [Healthy | Minor issues | Attention needed] +- **Data Completeness**: [High | Moderate | Limited] confidence - **System Health**: [Count of healthy vs degraded operators] - **Core Platform**: [Status of essential operators: console, authentication, ingress, etc.] - **Degraded Components**: [Count and names of any unhealthy operators] - **User Impact**: [Any operator issues affecting workloads] - **Action Items**: [Count of items needing administrator attention] - **Update Readiness**: [Ready | Operator issues need resolution] -- **Data Completeness**: [Full | Partial — list missing sources | Limited — list missing essential sources] → [High | Moderate | Limited] confidence - **Next Review**: [Recommended reassessment timeframe] `; }; diff --git a/frontend/packages/console-shared/src/components/cluster-updates/prompts/precheck-specific.ts b/frontend/packages/console-shared/src/components/cluster-updates/prompts/precheck-specific.ts index 8c067f422fb..77045fdf474 100644 --- a/frontend/packages/console-shared/src/components/cluster-updates/prompts/precheck-specific.ts +++ b/frontend/packages/console-shared/src/components/cluster-updates/prompts/precheck-specific.ts @@ -77,6 +77,7 @@ ${languageConstraint} - NEVER use placeholder or dummy data - only reference real data from tool calls - ONLY report issues that are actually present in the data - ONLY OUTPUT the Summary and TL;DR sections +- CRITICAL: The TL;DR section MUST end with the **Recommendation** field. NEVER omit it. - Be specific about the source of any issues identified ${securityConstraint} ${confidenceQualifiers} @@ -320,6 +321,7 @@ If ${targetVersion} is not available, recommend the closest available version an ## TL;DR - **Current Version**: ${currentVersion} - **Target Version**: ${targetVersion} +- **Data Completeness**: [High | Moderate | Limited] confidence - **Target Available**: [Yes in availableUpdates / Yes in conditionalUpdates with risks / No] - **Upgrade Path**: [${currentVersion} → ${targetVersion}, list intermediate versions if applicable] - **Conditional Risks in Upgrade Path**: [Total count of risk conditions across ALL versions from ${currentVersion} to ${targetVersion}, or "None"] @@ -338,7 +340,6 @@ If ${targetVersion} is not available, recommend the closest available version an - **Resource Pressure**: [nodes with >90% CPU or memory usage] - **Recent Events**: [count of error/warning events in last 30 min, user-friendly summary] - **Active Alerts**: [count of critical/warning alerts, skip if tool unavailable] -- **Data Completeness**: [Full | Partial — list missing sources | Limited — list missing essential sources] → [High | Moderate | Limited] confidence - **Recommendation**: [Proceed with upgrade to ${targetVersion} | Address risks/warnings first | Blocked - resolve issues | Target not available - use X.X.X instead] `; }; diff --git a/frontend/packages/console-shared/src/components/cluster-updates/prompts/precheck.ts b/frontend/packages/console-shared/src/components/cluster-updates/prompts/precheck.ts index 65e417435c8..5eb0875d34c 100644 --- a/frontend/packages/console-shared/src/components/cluster-updates/prompts/precheck.ts +++ b/frontend/packages/console-shared/src/components/cluster-updates/prompts/precheck.ts @@ -34,6 +34,7 @@ ${languageConstraint} - NEVER use placeholder or dummy data - only reference real data from tool calls. - ONLY report issues that are actually present in the data. - ONLY OUTPUT the Summary and TL;DR sections. +- CRITICAL: The TL;DR section MUST end with the **Recommendation** field. NEVER omit it. - Be specific about the source of any issues identified. - CRITICAL: When counting available updates, count ALL array elements in status.availableUpdates AND status.conditionalUpdates separately. ${securityConstraint} @@ -464,6 +465,7 @@ A "hard blocker" means at least one of: - Deprecated API in active use that is removed in target minor ## TL;DR - **Current Version**: ${currentVersion} +- **Data Completeness**: [High | Moderate | Limited] confidence - **Available Updates**: [count from status.availableUpdates] - **Latest Recommended Update**: [version with channels] - **Conditional Updates**: [count] ([N with Recommended=False risks applying to this cluster]) @@ -489,7 +491,6 @@ A "hard blocker" means at least one of: - **Recent Events**: [count of upgrade-relevant errors/warnings in last 30 min] - **Active Alerts**: [count of critical/warning, skip if unavailable] - **Configuration Issues**: [overrides or capability concerns] -- **Data Completeness**: [Full | Partial — list missing sources | Limited — list missing essential sources] → [High | Moderate | Limited] confidence - **Recommendation**: [Proceed with upgrade | Address warnings first | Blocked — resolve listed issues] `; }; diff --git a/frontend/packages/console-shared/src/components/cluster-updates/prompts/progress.ts b/frontend/packages/console-shared/src/components/cluster-updates/prompts/progress.ts index 2c2a068b8a7..ca609987985 100644 --- a/frontend/packages/console-shared/src/components/cluster-updates/prompts/progress.ts +++ b/frontend/packages/console-shared/src/components/cluster-updates/prompts/progress.ts @@ -208,6 +208,7 @@ Conditions have TWO important fields you MUST check: ## TL;DR - **Progress**: [X% complete - (${operatorCounts.updated} Updated Operators / ${operatorCounts.total} Total Operators) * 100] +- **Data Completeness**: [High | Moderate | Limited] confidence - **Target Version**: [${desiredVersion} with release info if available] - **Target Channels**: [Available channels for target release] - **Upgrade Duration**: [Elapsed time from upgrade start] @@ -221,7 +222,6 @@ Conditions have TWO important fields you MUST check: - **Recent Events**: [Count of warning events in last 30 min, user-friendly summary] - **Alerts**: [Warning/critical alerts during upgrade, if available] - **ETA**: [Estimated time remaining based on current progress rate] -- **Data Completeness**: [Full | Partial — list missing sources | Limited — list missing essential sources] → [High | Moderate | Limited] confidence - **Action Required**: [Continue monitoring | Investigate delays | Address operator issues] `; }; diff --git a/frontend/packages/console-shared/src/components/cluster-updates/prompts/troubleshoot.ts b/frontend/packages/console-shared/src/components/cluster-updates/prompts/troubleshoot.ts index 34e9afe91c6..c59f4411b3f 100644 --- a/frontend/packages/console-shared/src/components/cluster-updates/prompts/troubleshoot.ts +++ b/frontend/packages/console-shared/src/components/cluster-updates/prompts/troubleshoot.ts @@ -79,6 +79,7 @@ export const createTroubleshootPrompt = (currentVersion: string, desiredVersion: - Provide conservative, investigation-focused remediation - Focus on root cause identification using real error messages, not aggressive fixes - ONLY OUTPUT the Summary and TL;DR sections +- CRITICAL: The TL;DR section MUST end with the **Next Steps** field. NEVER omit it. ${securityConstraint} ${confidenceQualifiers} ${languageConstraint} @@ -259,6 +260,7 @@ Based on the ClusterVersion data: ## TL;DR - **Failure Type**: [Specific failure reason from conditions] +- **Data Completeness**: [High | Moderate | Limited] confidence - **Target Version**: [Failed upgrade target with release info] - **Root Cause**: [Primary component or process failing - with actual error from logs] - **Failed Components**: [Count and names of failed ClusterOperators] @@ -271,9 +273,8 @@ Based on the ClusterVersion data: - **Node Issues**: [Count of NotReady nodes if any] - **Infrastructure Problems**: [Any detected infrastructure issues] - **MCP Issues**: [Count of degraded MachineConfigPools if any] -- **Next Steps**: [Conservative investigation approach based on actual errors found] - **Escalation**: [When to contact Red Hat support] -- **Data Completeness**: [Full | Partial — list missing sources | Limited — list missing essential sources] → [High | Moderate | Limited] confidence - **Recovery Time**: [Realistic estimate based on failure type] +- **Next Steps**: [Conservative investigation approach based on actual errors found] `; }; diff --git a/frontend/public/components/cluster-settings/cluster-settings.tsx b/frontend/public/components/cluster-settings/cluster-settings.tsx index d9686433314..03be920f222 100644 --- a/frontend/public/components/cluster-settings/cluster-settings.tsx +++ b/frontend/public/components/cluster-settings/cluster-settings.tsx @@ -36,6 +36,7 @@ import { RhUiAddCircleIcon, RhUiPauseCircleIcon, RhUiEditIcon, + RhUiAiInfoIcon, RhUiInProgressIcon, } from '@patternfly/react-icons'; @@ -1504,7 +1505,7 @@ const UpdateAssessmentCard: FC<{ } + customIcon={} isInline title={alertTitle} actionLinks={ @@ -1553,12 +1554,14 @@ const UpdateAssessmentCard: FC<{ variant="warning" isInline isPlain - title={t( - 'public~Cluster updates are irreversible. After an update begins, it cannot be rolled back to the previous version. Verify your cluster is ready before you proceed.', - )} + title={t('public~Cluster updates are irreversible')} className="pf-v6-u-mt-sm" data-test="update-assessment-irreversibility-notice" - /> + > + {t( + 'public~After an update begins, it cannot be rolled back to the previous version. Verify your cluster is ready before you proceed.', + )} + diff --git a/frontend/public/components/modals/cluster-update-modal.tsx b/frontend/public/components/modals/cluster-update-modal.tsx index d70ed56ca41..677642846b9 100644 --- a/frontend/public/components/modals/cluster-update-modal.tsx +++ b/frontend/public/components/modals/cluster-update-modal.tsx @@ -384,11 +384,13 @@ const ClusterUpdateModal = (props: ClusterUpdateModalProps) => { variant="warning" isInline isPlain - title={t( - 'Cluster updates are irreversible. After an update begins, it cannot be rolled back to the previous version. Verify your cluster is ready before you proceed.', - )} + title={t('Cluster updates are irreversible')} data-test="update-cluster-modal-irreversibility-notice" - /> + > + {t( + 'After an update begins, it cannot be rolled back to the previous version. Verify your cluster is ready before you proceed.', + )} + diff --git a/frontend/public/locales/en/public.json b/frontend/public/locales/en/public.json index 7f146fcfc2d..80da76a4f80 100644 --- a/frontend/public/locales/en/public.json +++ b/frontend/public/locales/en/public.json @@ -168,6 +168,7 @@ "Affects pods that do not have resource limits set. These pods have a best effort quality of service.": "Affects pods that do not have resource limits set. These pods have a best effort quality of service.", "Affects pods that have an active deadline. These pods usually include builds, deployers, and jobs.": "Affects pods that have an active deadline. These pods usually include builds, deployers, and jobs.", "Affects pods that have at least one resource limit set. These pods do not have a best effort quality of service.": "Affects pods that have at least one resource limit set. These pods do not have a best effort quality of service.", + "After an update begins, it cannot be rolled back to the previous version. Verify your cluster is ready before you proceed.": "After an update begins, it cannot be rolled back to the previous version. Verify your cluster is ready before you proceed.", "AI Assessment": "AI Assessment", "Alert routing": "Alert routing", "Alerting": "Alerting", @@ -349,7 +350,7 @@ "Cluster update available. <2>Update cluster": "Cluster update available. <2>Update cluster", "Cluster update conditions need attention": "Cluster update conditions need attention", "Cluster update is in progress": "Cluster update is in progress", - "Cluster updates are irreversible. After an update begins, it cannot be rolled back to the previous version. Verify your cluster is ready before you proceed.": "Cluster updates are irreversible. After an update begins, it cannot be rolled back to the previous version. Verify your cluster is ready before you proceed.", + "Cluster updates are irreversible": "Cluster updates are irreversible", "Cluster updating": "Cluster updating", "Cluster utilization": "Cluster utilization", "Cluster version configuration": "Cluster version configuration",