feat: add retired-provider warning banner in chat view

This commit is contained in:
Hannes Rudolph 2026-02-07 21:42:22 -07:00
parent aebcaa263e
commit dd593e1056

View file

@ -13,6 +13,7 @@ import { appendImages } from "@src/utils/imageUtils"
import { getCostBreakdownIfNeeded } from "@src/utils/costFormatting"
import type { ClineAsk, ClineSayTool, ClineMessage, ExtensionMessage, AudioType } from "@roo-code/types"
import { isRetiredProvider } from "@roo-code/types"
import { findLast } from "@roo/array"
import { SuggestionItem } from "@roo-code/types"
@ -226,6 +227,11 @@ const ChatViewComponent: React.ForwardRefRenderFunction<ChatViewRef, ChatViewPro
[apiConfiguration, organizationAllowList],
)
const isRetiredProviderActive = useMemo(
() => !!apiConfiguration?.apiProvider && isRetiredProvider(apiConfiguration.apiProvider),
[apiConfiguration?.apiProvider],
)
// UI layout depends on the last 2 messages (since it relies on the content
// of these messages, we are deep comparing) i.e. the button state after
// hitting button sets enableButtons to false, and this effect otherwise
@ -1515,7 +1521,7 @@ const ChatViewComponent: React.ForwardRefRenderFunction<ChatViewRef, ChatViewPro
if (enableButtons && primaryButtonText) {
handlePrimaryButtonClick(inputValue, selectedImages)
} else if (!sendingDisabled && !isProfileDisabled && hasInput) {
} else if (!sendingDisabled && !isProfileDisabled && !isRetiredProviderActive && hasInput) {
handleSendMessage(inputValue, selectedImages)
}
},
@ -1596,6 +1602,12 @@ const ChatViewComponent: React.ForwardRefRenderFunction<ChatViewRef, ChatViewPro
<CheckpointWarning warning={checkpointWarning} />
</div>
)}
{isRetiredProviderActive && (
<div className="px-3">
<RetiredProviderWarning />
</div>
)}
</>
) : (
<div className="flex flex-col h-full justify-center p-6 min-h-0 overflow-y-auto gap-4 relative">
@ -1757,7 +1769,7 @@ const ChatViewComponent: React.ForwardRefRenderFunction<ChatViewRef, ChatViewPro
ref={textAreaRef}
inputValue={inputValue}
setInputValue={setInputValue}
sendingDisabled={sendingDisabled || isProfileDisabled}
sendingDisabled={sendingDisabled || isProfileDisabled || isRetiredProviderActive}
selectApiConfigDisabled={sendingDisabled && clineAsk !== "api_req_failed"}
placeholderText={placeholderText}
selectedImages={selectedImages}
@ -1780,9 +1792,11 @@ const ChatViewComponent: React.ForwardRefRenderFunction<ChatViewRef, ChatViewPro
onEnqueueMessage={handleEnqueueCurrentMessage}
/>
<div className="px-3">
<RetiredProviderWarning />
</div>
{isRetiredProviderActive && !task && (
<div className="px-3">
<RetiredProviderWarning />
</div>
)}
{isProfileDisabled && (
<div className="px-3">