@@ -7,6 +7,7 @@ import software.aws.toolkits.jetbrains.services.amazonq.auth.AuthNeededState
77import software.aws.toolkits.jetbrains.services.amazonq.messages.MessagePublisher
88import software.aws.toolkits.jetbrains.services.amazonqCodeTest.messages.ProgressField
99import software.aws.toolkits.jetbrains.services.amazonqCodeTest.messages.PromptProgressMessage
10+ import software.aws.toolkits.jetbrains.services.amazonqDoc.NEW_SESSION_FOLLOWUPS
1011import software.aws.toolkits.jetbrains.services.amazonqFeatureDev.session.CodeReferenceGenerated
1112import software.aws.toolkits.jetbrains.services.amazonqFeatureDev.session.DeletedFileInfo
1213import software.aws.toolkits.jetbrains.services.amazonqFeatureDev.session.NewFileZipInfo
@@ -160,36 +161,29 @@ suspend fun MessagePublisher.sendErrorToUser(
160161) {
161162 val conversationIdText = if (conversationId == null ) " " else " \n\n Conversation ID: **$conversationId **"
162163
163- var followUps = listOf (
164- FollowUp (
165- pillText = message(" amazonqDoc.prompt.reject.new_task" ),
166- type = FollowUpTypes .NEW_TASK ,
167- status = FollowUpStatusType .Info
168- ),
169- FollowUp (
170- pillText = message(" amazonqDoc.prompt.reject.close_session" ),
171- type = FollowUpTypes .CLOSE_SESSION ,
172- status = FollowUpStatusType .Info
173- )
174- );
175-
176- this .sendChatInputEnabledMessage(tabId, enabled = isEnableChatInput)
177- if (isEnableChatInput) {
178- this .sendUpdatePlaceholder(tabId, message(" amazonqDoc.edit.placeholder" ))
179- followUps = Collections .emptyList()
180- }
181-
182164 this .sendAnswer(
183165 tabId = tabId,
184166 messageType = DocMessageType .Answer ,
185167 message = errMessage + conversationIdText,
186168 )
187169
188- this .sendAnswer(
189- tabId = tabId,
190- messageType = DocMessageType .SystemPrompt ,
191- followUp = followUps
192- )
170+ if (isEnableChatInput) {
171+ this .sendAnswer(
172+ tabId = tabId,
173+ messageType = DocMessageType .SystemPrompt ,
174+ followUp = Collections .emptyList()
175+ )
176+ this .sendUpdatePlaceholder(tabId, message(" amazonqDoc.edit.placeholder" ))
177+ } else {
178+ this .sendAnswer(
179+ tabId = tabId,
180+ messageType = DocMessageType .SystemPrompt ,
181+ followUp = NEW_SESSION_FOLLOWUPS
182+ )
183+ this .sendUpdatePlaceholder(tabId, message(" amazonqDoc.prompt.placeholder" ))
184+ }
185+
186+ this .sendChatInputEnabledMessage(tabId, enabled = isEnableChatInput)
193187}
194188
195189suspend fun MessagePublisher.sendMonthlyLimitError (tabId : String ) {
0 commit comments