Skip to content

Commit 3338cc1

Browse files
authored
fix(amazonq): 500k max input limit in user input box. Align payload prompt with user typed prompt. (#1325)
1 parent 4b18f25 commit 3338cc1

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

chat-client/src/client/mynahUi.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -504,11 +504,12 @@ export const createMynahUi = (
504504
stopGenerating: agenticMode ? uiComponentsTexts.stopGenerating : 'Stop generating',
505505
spinnerText: agenticMode ? uiComponentsTexts.spinnerText : 'Generating your answer...',
506506
},
507-
// RTS max user input is 600k, we need to leave around 500 chars to user to type the question
507+
// Total model context window limit 600k.
508+
// 500k for user input, 100k for context, history, system prompt.
508509
// beside, MynahUI will automatically crop it depending on the available chars left from the prompt field itself by using a 96 chars of threshold
509-
// if we want to max user input as 599500, need to configure the maxUserInput as 599596
510-
maxUserInput: 599596,
511-
userInputLengthWarningThreshold: 550000,
510+
// if we want to max user input as 500000, need to configure the maxUserInput as 500096
511+
maxUserInput: 500096,
512+
userInputLengthWarningThreshold: 450000,
512513
},
513514
}
514515

server/aws-lsp-codewhisperer/src/language-server/agenticChat/constants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
export const genericErrorMsg = 'An unexpected error occurred, check the logs for more information.'
22
export const maxAgentLoopIterations = 100
33
export const loadingThresholdMs = 2000
4-
export const generateAssistantResponseInputLimit = 600_000
4+
export const generateAssistantResponseInputLimit = 500_000
55
export const outputLimitExceedsPartialMsg = 'output exceeds maximum character limit of'
66
export const responseTimeoutMs = 170_000
77
export const responseTimeoutPartialMsg = 'Response processing timed out after'

server/aws-lsp-codewhisperer/src/language-server/agenticChat/context/agenticChatTriggerContext.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,9 @@ export class AgenticChatTriggerContext {
110110

111111
const hasWorkspace = 'context' in params ? params.context?.some(c => c.command === '@workspace') : false
112112

113-
let promptContent = prompt.escapedPrompt ?? prompt.prompt
113+
// prompt.prompt is what user typed in the input, should be sent to backend
114+
// prompt.escapedPrompt is HTML serialized string, which should only be used for UI.
115+
let promptContent = prompt.prompt ?? prompt.escapedPrompt
114116

115117
// When the user adds @sage context, ** gets prepended and appended to the prompt because of markdown.
116118
// This intereferes with routing logic thus we need to remove it

0 commit comments

Comments
 (0)