fix(mcp): correctly read chunked responses from official registry - #2224
fix(mcp): correctly read chunked responses from official registry#2224ChickenisLegit wants to merge 2 commits into
Conversation
7c748f2 to
f4680a6
Compare
GPT 5.6 Review (fork) — ✅ no blocking findingsReviewed Review detailsFINDING -- src/kiro_crew/dashboard/handlers/hooks.py:412 -- |
Opus 4.8 Review (fork) — ✅ no blocking findingsReviewed Review detailsThis is a small refactor extracting a bounded-read helper (
No AUTOSDE rule violations and no residual-class defect on the changed lines. No findings. [OPUS-REVIEWED] 5f3f1ac |
Design Review (Fable 5, fork) — ✅ PASSAdvisory design-level review of Design-Verdict: PASS Root-cause fix: Suggestions
[DESIGN-REVIEWED] 5f3f1ac |
|
I've fixed the test failures and import errors that caused the CI to fail. Sorry about that! |
c54925d to
055c718
Compare
055c718 to
3f44e46
Compare
|
I've investigated and pushed the fixes for the flake8 CI linting errors (unused imports and whitespace). |
|
I also just wanted to take a moment to say that this is a great repository! You all have built an amazing project, and I would love to work more with you and contribute as much as I can in the future! 🚀 |
|
Duplicate-fix cluster: #2232 and #2224 both fix the partial-read bug in After comparing both against current
Thanks to both authors — two independent reports of the same field bug is exactly the signal that made the second instance in |
|
🤖 Kiro Crew [operator: bolichen97]: This PR has been inactive for 7+ days. I reviewed the blockers but they require your input:
Options for you:
When you've addressed these, the pipeline will re-assess on its next cycle. |
|
Closing this in favor of #4986 which cleanly extracts the \updates.py\ chunked response fix as requested! |
Fixes #2222
Description
When discovering servers from the official registry, KiroCrew fetches data using
aiohttp.StreamReader.read(). Previously, it only calledread()once, which only retrieves the first HTTP chunk available (often limited to TCP payload sizes, e.g. ~12KB). For queries that return many servers, the JSON document exceeds this size, resulting in a partial string and a subsequentJSONDecodeError(which surfaced as a 0-result search due to error isolation).This PR updates the fetching logic to correctly read from the stream in chunks until EOF, appending them to a
bytearray, while preserving the safety limit of_MAX_RESPONSE_BYTES.Changes
_HTTP_READ_CHUNK_BYTES = 65536._fetch_jsoninofficial.pyto loop overresp.content.read(chunk_size)untilchunkis empty.Checklist
feat|fix|docs|refactor|perf|test|chore|ci|build|revert: ...)