fix: reasoning model does not allow images (#1160)

This commit is contained in:
josh 2025-09-08 11:08:45 +01:00 committed by GitHub
parent 1de811bdfd
commit 7327c9a18a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -323,7 +323,7 @@ function PureMultimodalInput({
/> />
<PromptInputToolbar className="px-3 py-2 !border-t-0 !border-top-0 shadow-none dark:!border-transparent dark:border-0"> <PromptInputToolbar className="px-3 py-2 !border-t-0 !border-top-0 shadow-none dark:!border-transparent dark:border-0">
<PromptInputTools className="gap-2"> <PromptInputTools className="gap-2">
<AttachmentsButton fileInputRef={fileInputRef} status={status} /> <AttachmentsButton fileInputRef={fileInputRef} status={status} selectedModelId={selectedModelId} />
<ModelSelectorCompact selectedModelId={selectedModelId} /> <ModelSelectorCompact selectedModelId={selectedModelId} />
</PromptInputTools> </PromptInputTools>
{status === 'submitted' ? ( {status === 'submitted' ? (
@ -360,10 +360,14 @@ export const MultimodalInput = memo(
function PureAttachmentsButton({ function PureAttachmentsButton({
fileInputRef, fileInputRef,
status, status,
selectedModelId,
}: { }: {
fileInputRef: React.MutableRefObject<HTMLInputElement | null>; fileInputRef: React.MutableRefObject<HTMLInputElement | null>;
status: UseChatHelpers<ChatMessage>['status']; status: UseChatHelpers<ChatMessage>['status'];
selectedModelId: string;
}) { }) {
const isReasoningModel = selectedModelId === 'chat-model-reasoning';
return ( return (
<Button <Button
data-testid="attachments-button" data-testid="attachments-button"
@ -372,7 +376,7 @@ function PureAttachmentsButton({
event.preventDefault(); event.preventDefault();
fileInputRef.current?.click(); fileInputRef.current?.click();
}} }}
disabled={status !== 'ready'} disabled={status !== 'ready' || isReasoningModel}
variant="ghost" variant="ghost"
size="sm" size="sm"
> >