fix(gateway): fix semantic search invoke.py response parsing - #1953
Merged
EashanKaushik merged 1 commit intoAug 24, 2026
Merged
Conversation
The semantic search tool returns results in `result.content[0].text` (JSON string containing a tools array), not in `result.structuredContent.tools`. The old parsing path silently returned empty results. Also adds missing `import json` needed for `json.loads()`. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Latest scan for commit: Security Scan ResultsScan Metadata
SummaryScanner ResultsThe table below shows findings by scanner, with status based on severity thresholds and dependencies: Column Explanations: Severity Levels (S/C/H/M/L/I):
Other Columns:
Scanner Results:
Severity Thresholds (Thresh Column):
Threshold Source: Values in parentheses indicate where the threshold is configured:
Statistics calculation:
|
EashanKaushik
approved these changes
Aug 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
scripts/semantic-search/invoke.pyparses the wrong response path for thex_amz_bedrock_agentcore_searchtoolresult.get("result", {}).get("structuredContent", {}).get("tools", [])— always returns[]json.loads(result.get("result", {}).get("content", [])[0]["text"]).get("tools", [])— returns actual resultsimport jsonRoot cause
The semantic search tool returns results as a JSON string inside
result.content[0].text, not inresult.structuredContent. The script silently returned empty tool lists.Test plan
{"result": {"content": [{"type": "text", "text": "{\"tools\": [...]}"}]}}🤖 Generated with Claude Code