tools: follow_redirects=False causes silent wrong file contents
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 74/100
Research direction
Start in src/entrabot/tools/files.py at _client and the content-handling blocks around L625-L650. Review the existing respx tests, then add coverage for a 302 redirect to a second mocked URL. Done means redirected file content is read correctly and the misleading comment is removed.
Written by the indexing model from the issue text.
Description
File: src/entrabot/tools/files.py
Location: L289, L625-L629, L637-L640, L647-L650
Category: bug
Priority: high
Description
_client() builds httpx.AsyncClient without follow_redirects=True. httpx default is False. Graph /content returns 302 to a pre-signed URL; for raw text reads the code accepts status 302 and decodes the empty redirect body as the file contents, silently returning wrong data. PDF/docx paths only accept 200, so 302 becomes a spurious error. The in-line comment "httpx auto-follows redirects" is wrong. The project's own platform-learnings doc explicitly mandates follow_redirects=True. Tests miss this because they all mock 200 directly.
Suggested fix
Pass follow_redirects=True to httpx.AsyncClient in _client (or per-request on /content GETs). Remove the misleading comment. Add a respx test that returns 302 with a Location to a second mocked URL.
Filed automatically by a thorough code-review pass over src/entrabot/ on 2026-06-13. Internal review id: #16.
- Dominant language
- Python
- Stars
- 9
- Forks
- 6
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoft/entrabot
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 72/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
tools: Previous response not closed before retry — connection pool can leak under sustained 429/5xx Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
All issues in microsoft/entrabot
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100