@@ -35,7 +35,7 @@ import { InputToolbar } from '@/app/workspace/[workspaceId]/home/components/user
3535import type { ModelSelectorOptions } from '@/app/workspace/[workspaceId]/home/components/user-input/components/model-selector'
3636import { usePromptHistory } from '@/app/workspace/[workspaceId]/home/components/user-input/hooks/use-prompt-history'
3737import { handleMothershipAddContextEvent } from '@/app/workspace/[workspaceId]/home/components/user-input/mothership-context-event'
38- import { useChatPlanGate } from '@/app/workspace/[workspaceId]/home/hooks/use-chat-plan-gate '
38+ import { useChatPlanRequired } from '@/app/workspace/[workspaceId]/home/hooks/use-chat-plan-required '
3939import type {
4040 ChatMessage ,
4141 FileAttachmentForApi ,
@@ -316,10 +316,12 @@ const UserInputImpl = forwardRef<UserInputHandle, UserInputProps>(function UserI
316316 } , [ editor . contexts ] )
317317
318318 const hasAdditionalAttachments = Boolean ( attachments )
319+ const chatPlanRequired = useChatPlanRequired ( )
319320 const canSubmit =
320321 ( editor . value . trim ( ) . length > 0 || hasFiles || hasAdditionalAttachments ) &&
321322 ! isSending &&
322- ! hasUploadingFiles
323+ ! hasUploadingFiles &&
324+ ! chatPlanRequired
323325
324326 /**
325327 * Sync the editor when the `defaultValue` prop changes post-mount — e.g.
@@ -508,9 +510,6 @@ const UserInputImpl = forwardRef<UserInputHandle, UserInputProps>(function UserI
508510 textareaRef . current ?. focus ( )
509511 }
510512
511- /** Refuses a send the workspace plan excludes here, before `onSubmit`, so the draft survives. */
512- const stopSendWithoutChatPlan = useChatPlanGate ( )
513-
514513 /** Empties the text, chips, attachments, transcript, and the saved draft in one step. */
515514 const clearComposer = useCallback ( ( ) => {
516515 history . reset ( )
@@ -531,7 +530,7 @@ const UserInputImpl = forwardRef<UserInputHandle, UserInputProps>(function UserI
531530 } , [ resetTranscript , history . reset ] )
532531
533532 const handleSubmit = useCallback ( ( ) => {
534- if ( stopSendWithoutChatPlan ( ) ) return
533+ if ( chatPlanRequired ) return
535534 const currentFiles = filesRef . current
536535 const currentEditor = editorRef . current
537536
@@ -557,7 +556,7 @@ const UserInputImpl = forwardRef<UserInputHandle, UserInputProps>(function UserI
557556 )
558557 if ( accepted === false ) return
559558 clearComposer ( )
560- } , [ stopSendWithoutChatPlan , onSubmit , clearComposer ] )
559+ } , [ chatPlanRequired , onSubmit , clearComposer ] )
561560
562561 /**
563562 * Enter policy for the editor: mirror canSubmit's uploading guard (Enter
0 commit comments