Skip to content

fix(amazonq): remove invisible characters from chat requests - #3064

Draft
laileni-aws wants to merge 3 commits into
Amazon-Q-Developer:feature/laileni-fixesfrom
laileni-aws:fix/chat-invisible-characters
Draft

laileni-aws wants to merge 3 commits into
Amazon-Q-Developer:feature/laileni-fixesfrom
laileni-aws:fix/chat-invisible-characters

Conversation

@laileni-aws

Copy link
Copy Markdown
Collaborator

No description provided.

@codecov-commenter

codecov-commenter commented Nov 16, 2026 •

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 97.11191% with 8 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
server/aws-lsp-codewhisperer/src/shared/utils.ts 96.65% 5 Missing and 3 partials ⚠️

📢 Thoughts on this report? Let us know!

@laileni-aws
laileni-aws force-pushed the fix/chat-invisible-characters branch from b2c7a9f to d557b76 Compare November 17, 2026 04:23
sanitizeInput now also removes the Unicode default ignorable characters, such as the variation
selectors, but keeps a presentation selector that belongs to an emoji. sanitizeRequestInput now
also applies to inline chat, memory bank and chat server requests, and to the keys of objects.

Adds tests.
…hema

The chat request removes invisible characters from object keys, so the
model gets the property names of an MCP tool's input schema without
them. Before the agentic chat controller runs an MCP tool, it now gives
each key of the tool input back the property name of the tool's input
schema, so the tool gets the input that its schema describes.

restorePropertyNames follows properties, additionalProperties, items,
prefixItems, allOf, anyOf, oneOf and $ref pointers within the schema. A
key keeps its name when it stands for no property name or for more
than one, or when another key of the same object already has that
name. The conversation keeps the tool input as the model wrote it.
…ored from

restorePropertyNames looks at no more than 1024 schema entries for one value, repeated and
non-schema entries included, and reads them with an index. sanitizeKeys returns the keys as they
are when none changes. Adds tests of both limits and updates the sanitizeInput comment.
@laileni-aws
laileni-aws changed the base branch from feature/security-fixes-v2 to feature/laileni-fixes November 18, 2026 20:38
@laileni-aws
laileni-aws force-pushed the fix/chat-invisible-characters branch from 80737df to b14552e Compare November 18, 2026 20:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants