Skip to content

Commit 6afea39

Browse files
authored
Remove feature dev plan generation phase (#4844)
Us (QSDA) team is launching a new code generation agent. We have conducted experiments wIth the new code generation agent, we observed: Removing planning phase produces higher quality code Removing planning phase has general better user experience and remove the inconsistency of code gen & plan gen We have discussed with product that the rollout of new code generation agent should also include planning phase removal as a whole, without an A/B testing mechanism nor backward compatible implementation. The endpoint for plan generation will still exist to support older toolkit versions. We plan to release the new code generation agent experience in the week of September 9th.
1 parent 1c7052d commit 6afea39

File tree

28 files changed

+87
-787
lines changed

28 files changed

+87
-787
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"type" : "removal",
3+
"description" : "Amazon Q Feature dev: Improve quality and UX by removing approach generation flow"
4+
}

plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonqFeatureDev/FeatureDevConstants.kt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,7 @@ const val FEATURE_EVALUATION_PRODUCT_NAME = "FeatureDev"
77

88
const val FEATURE_NAME = "Amazon Q Developer Agent for software development"
99

10-
// Max number of times a user can attempt to retry an approach request if it fails
11-
const val APPROACH_RETRY_LIMIT = 3
12-
13-
// Max number of times a user can attempt to retry a codegeneration request if it fails
10+
// Max number of times a user can attempt to retry a code generation request if it fails
1411
const val CODE_GENERATION_RETRY_LIMIT = 3
1512

1613
// The default retry limit used when the session could not be found

plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonqFeatureDev/FeatureDevExceptions.kt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ class ContentLengthError(override val message: String, override val cause: Throw
1212

1313
class ZipFileError(override val message: String, override val cause: Throwable?) : RuntimeException()
1414

15-
class PlanIterationLimitError(override val message: String, override val cause: Throwable?) : RuntimeException()
16-
1715
class CodeIterationLimitError(override val message: String, override val cause: Throwable?) : RuntimeException()
1816

1917
class MonthlyConversationLimitError(override val message: String, override val cause: Throwable?) : RuntimeException()
@@ -27,9 +25,6 @@ internal fun codeGenerationFailedError(): Nothing =
2725
internal fun uploadCodeError(): Nothing =
2826
throw FeatureDevException(message("amazonqFeatureDev.exception.upload_code"))
2927

30-
internal fun userMessageNotFound(): Nothing =
31-
throw FeatureDevException(message("amazonqFeatureDev.exception.message_not_found"))
32-
3328
internal fun conversationIdNotFound(): Nothing =
3429
throw FeatureDevException(message("amazonqFeatureDev.exception.conversation_not_found"))
3530

plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonqFeatureDev/clients/FeatureDevClient.kt

Lines changed: 1 addition & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import com.intellij.openapi.components.Service
77
import com.intellij.openapi.components.service
88
import com.intellij.openapi.project.Project
99
import com.intellij.openapi.util.SystemInfo
10-
import kotlinx.coroutines.future.await
1110
import software.amazon.awssdk.services.codewhispererruntime.CodeWhispererRuntimeClient
1211
import software.amazon.awssdk.services.codewhispererruntime.model.ArtifactType
1312
import software.amazon.awssdk.services.codewhispererruntime.model.ContentChecksumType
@@ -24,16 +23,7 @@ import software.amazon.awssdk.services.codewhispererruntime.model.TaskAssistPlan
2423
import software.amazon.awssdk.services.codewhispererruntime.model.UploadContext
2524
import software.amazon.awssdk.services.codewhispererruntime.model.UploadIntent
2625
import software.amazon.awssdk.services.codewhispererruntime.model.UserContext
27-
import software.amazon.awssdk.services.codewhispererstreaming.CodeWhispererStreamingAsyncClient
28-
import software.amazon.awssdk.services.codewhispererstreaming.model.ChatMessage
29-
import software.amazon.awssdk.services.codewhispererstreaming.model.ChatTriggerType
30-
import software.amazon.awssdk.services.codewhispererstreaming.model.ConversationState
3126
import software.amazon.awssdk.services.codewhispererstreaming.model.ExportIntent
32-
import software.amazon.awssdk.services.codewhispererstreaming.model.GenerateTaskAssistPlanRequest
33-
import software.amazon.awssdk.services.codewhispererstreaming.model.GenerateTaskAssistPlanResponseHandler
34-
import software.amazon.awssdk.services.codewhispererstreaming.model.ProgrammingLanguage
35-
import software.amazon.awssdk.services.codewhispererstreaming.model.UserInputMessage
36-
import software.amazon.awssdk.services.codewhispererstreaming.model.WorkspaceState
3727
import software.aws.toolkits.core.utils.error
3828
import software.aws.toolkits.core.utils.getLogger
3929
import software.aws.toolkits.core.utils.info
@@ -62,7 +52,7 @@ class FeatureDevClient(private val project: Project) {
6252
when {
6353
SystemInfo.isWindows -> OperatingSystem.WINDOWS
6454
SystemInfo.isMac -> OperatingSystem.MAC
65-
// For now, categorize everything else as "Linux" (Linux/FreeBSD/Solaris/etc)
55+
// For now, categorize everything else as "Linux" (Linux/FreeBSD/Solaris/etc.)
6656
else -> OperatingSystem.LINUX
6757
}
6858

@@ -80,8 +70,6 @@ class FeatureDevClient(private val project: Project) {
8070

8171
private fun bearerClient() = connection().getConnectionSettings().awsClient<CodeWhispererRuntimeClient>()
8272

83-
private fun streamingBearerClient() = connection().getConnectionSettings().awsClient<CodeWhispererStreamingAsyncClient>()
84-
8573
private val amazonQStreamingClient
8674
get() = AmazonQStreamingClient.getInstance(project)
8775

@@ -117,54 +105,6 @@ class FeatureDevClient(private val project: Project) {
117105
)
118106
}
119107

120-
suspend fun generateTaskAssistPlan(conversationId: String, uploadId: String, userMessage: String): GenerateTaskAssistPlanResult {
121-
val assistantResponse = mutableListOf<String>()
122-
var succeededPlanning = true
123-
124-
val result = streamingBearerClient().generateTaskAssistPlan(
125-
GenerateTaskAssistPlanRequest.builder()
126-
.conversationState(
127-
ConversationState.builder()
128-
.currentMessage(
129-
ChatMessage.fromUserInputMessage(
130-
UserInputMessage.builder()
131-
.content(userMessage)
132-
.build()
133-
)
134-
)
135-
.chatTriggerType(ChatTriggerType.MANUAL)
136-
.conversationId(conversationId)
137-
.build()
138-
)
139-
.workspaceState(
140-
WorkspaceState.builder()
141-
.programmingLanguage(
142-
ProgrammingLanguage.builder()
143-
.languageName("javascript")
144-
.build()
145-
)
146-
.uploadId(uploadId)
147-
.build()
148-
)
149-
.build(),
150-
GenerateTaskAssistPlanResponseHandler.builder().subscriber(
151-
GenerateTaskAssistPlanResponseHandler.Visitor.builder()
152-
.onAssistantResponseEvent {
153-
assistantResponse.add(it.content())
154-
}.onInvalidStateEvent {
155-
assistantResponse.clear()
156-
assistantResponse.add(it.message())
157-
succeededPlanning = false
158-
}
159-
.build()
160-
)
161-
.build()
162-
)
163-
164-
result.await()
165-
return GenerateTaskAssistPlanResult(approach = assistantResponse.joinToString(" "), succeededPlanning = succeededPlanning)
166-
}
167-
168108
fun startTaskAssistCodeGeneration(conversationId: String, uploadId: String, userMessage: String): StartTaskAssistCodeGenerationResponse = bearerClient()
169109
.startTaskAssistCodeGeneration {
170110
request ->

plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonqFeatureDev/clients/GenerateTaskAssistPlanResult.kt

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)