@@ -4980,6 +4980,16 @@ function ChatViewContent(props: ChatViewProps) {
49804980 draftText : trimmed ,
49814981 planMarkdown : activeProposedPlan . planMarkdown ,
49824982 } ) ;
4983+ const outgoingFollowUpText = formatOutgoingPrompt ( {
4984+ provider : ctxSelectedProvider ,
4985+ model : ctxSelectedModel ,
4986+ models : ctxSelectedProviderModels ,
4987+ effort : ctxSelectedPromptEffort ,
4988+ text : followUp . text . trim ( ) ,
4989+ } ) ;
4990+ if ( composerRef . current ?. validateProviderInput ( outgoingFollowUpText ) === false ) {
4991+ return ;
4992+ }
49834993 promptRef . current = "" ;
49844994 clearComposerDraftContent ( composerDraftTarget ) ;
49854995 composerRef . current ?. resetCursorState ( ) ;
@@ -5049,24 +5059,6 @@ function ChatViewContent(props: ChatViewProps) {
50495059 return ;
50505060 }
50515061
5052- sendInFlightRef . current = true ;
5053- if ( isDraftHeroState && activeThreadKey ) {
5054- let resolveDockStarted : ( ( ) => void ) | undefined ;
5055- const dockStarted = new Promise < void > ( ( resolve ) => {
5056- resolveDockStarted = resolve ;
5057- } ) ;
5058- const dockTransition = runMobileComposerTransition ( ( ) => {
5059- flushSync ( ( ) => {
5060- captureDraftHeroComposerRect ( ) ;
5061- setDockedDraftHeroThreadKey ( activeThreadKey ) ;
5062- } ) ;
5063- resolveDockStarted ?.( ) ;
5064- } ) ;
5065- void dockTransition . catch ( ( ) => resolveDockStarted ?.( ) ) ;
5066- await dockStarted ;
5067- }
5068- beginLocalDispatch ( { preparingWorktree : Boolean ( baseBranchForWorktree ) } ) ;
5069-
50705062 const composerImagesSnapshot = [ ...composerImages ] ;
50715063 const composerTerminalContextsSnapshot = [ ...sendableComposerTerminalContexts ] ;
50725064 const composerElementContextsSnapshot = [ ...composerElementContexts ] ;
@@ -5084,15 +5076,37 @@ function ChatViewContent(props: ChatViewProps) {
50845076 messageTextWithPreviewAnnotations ,
50855077 composerReviewCommentsSnapshot ,
50865078 ) ;
5087- const messageIdForSend = newMessageId ( ) ;
5088- const messageCreatedAt = new Date ( ) . toISOString ( ) ;
50895079 const outgoingMessageText = formatOutgoingPrompt ( {
50905080 provider : ctxSelectedProvider ,
50915081 model : ctxSelectedModel ,
50925082 models : ctxSelectedProviderModels ,
50935083 effort : ctxSelectedPromptEffort ,
50945084 text : messageTextForSend || IMAGE_ONLY_BOOTSTRAP_PROMPT ,
50955085 } ) ;
5086+ if ( composerRef . current ?. validateProviderInput ( outgoingMessageText ) === false ) {
5087+ return ;
5088+ }
5089+
5090+ sendInFlightRef . current = true ;
5091+ if ( isDraftHeroState && activeThreadKey ) {
5092+ let resolveDockStarted : ( ( ) => void ) | undefined ;
5093+ const dockStarted = new Promise < void > ( ( resolve ) => {
5094+ resolveDockStarted = resolve ;
5095+ } ) ;
5096+ const dockTransition = runMobileComposerTransition ( ( ) => {
5097+ flushSync ( ( ) => {
5098+ captureDraftHeroComposerRect ( ) ;
5099+ setDockedDraftHeroThreadKey ( activeThreadKey ) ;
5100+ } ) ;
5101+ resolveDockStarted ?.( ) ;
5102+ } ) ;
5103+ void dockTransition . catch ( ( ) => resolveDockStarted ?.( ) ) ;
5104+ await dockStarted ;
5105+ }
5106+ beginLocalDispatch ( { preparingWorktree : Boolean ( baseBranchForWorktree ) } ) ;
5107+
5108+ const messageIdForSend = newMessageId ( ) ;
5109+ const messageCreatedAt = new Date ( ) . toISOString ( ) ;
50965110 const turnAttachmentsPromise = Promise . all (
50975111 composerImagesSnapshot . map ( async ( image ) => ( {
50985112 type : "image" as const ,
@@ -5709,6 +5723,9 @@ function ChatViewContent(props: ChatViewProps) {
57095723 effort : ctxSelectedPromptEffort ,
57105724 text : implementationPrompt ,
57115725 } ) ;
5726+ if ( composerRef . current ?. validateProviderInput ( outgoingImplementationPrompt ) === false ) {
5727+ return ;
5728+ }
57125729 const nextThreadTitle = truncate ( buildPlanImplementationThreadTitle ( planMarkdown ) ) ;
57135730 const nextThreadModelSelection : ModelSelection = ctxSelectedModelSelection ;
57145731
0 commit comments