Skip to content

fix: Handle image-only messages in retrieve_customer_context#299

Open
grahamburgsma wants to merge 1 commit intoaws:mainfrom
grahamburgsma:main
Open

fix: Handle image-only messages in retrieve_customer_context#299
grahamburgsma wants to merge 1 commit intoaws:mainfrom
grahamburgsma:main

Conversation

@grahamburgsma
Copy link

Description of changes:

retrieve_customer_context crashed with KeyError: 'text' when a message contained no text content (e.g. an image-only message), because it unconditionally accessed content[0]["text"].

The fix updates the early-return guard to check "text" not in content[0] instead of "toolResult" in content[0], skipping LTM retrieval for any message whose first content block is not text.

@grahamburgsma grahamburgsma requested a review from a team March 6, 2026 18:35
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.

1 participant