Repository navigation
fix(memory): the guarded fetch's deadline covers decoding, and a network refusal names no resolver detail - #280
Conversation
…after the wire closes, a network refusal names no resolver detail, and literal internal addresses are refused in tests
|
Warning Review limit reached
This review includes 3 billable files and costs up to $0.75.
Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing. Or wait 5 minutes for your next included review. View limit details
Comment |
Reviewer's GuideThe PR makes guarded-fetch deadlines and caller aborts cover the full response lifecycle, including post-connection decoding, ensures network refusals expose only a fixed message, and adds regression tests for internal-address literals and cancellation/error-message behavior. Sequence diagram for guarded fetch cancellation during decodingsequenceDiagram
participant Caller
participant guardedFetch
participant readBody
participant Response
participant Decoder
participant failureOf
Caller->>guardedFetch: guardedFetch(address, options)
guardedFetch->>readBody: readBody(response, maxBytes, signal)
readBody->>Response: pipeline(response, decoder)
readBody->>Decoder: decode body
alt deadline or caller signal aborts during decoding
readBody->>Response: destroy()
readBody->>Decoder: destroy()
readBody-->>guardedFetch: aborted read
guardedFetch->>failureOf: failureOf(error, callerSignal, deadline)
failureOf-->>Caller: deadline or caller abort reason
else decoding completes
readBody-->>guardedFetch: Buffer
guardedFetch->>guardedFetch: signal.throwIfAborted()
guardedFetch-->>Caller: response with body
end
Flow diagram for guarded fetch network refusal sanitizationflowchart TD
A[guardedFetch receives address] --> B{Literal internal address}
B -->|yes| C[address refusal]
B -->|no| D[Resolver and connection]
D --> E{Network read fails}
E --> F[network refusal]
C --> G[Caller shows shared refusal message]
F --> G
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
PR Summary by QodoFix guarded-fetch decoding cancellation and sanitize resolver errors
AI Description
Diagram
High-Level Assessment
Files changed (3)
|
Code Review by Qodo🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)
Great, no issues found!Qodo reviewed your code and found no material issues that require reviewTip of the day💡 Did you know, you can tweak Display settings with a live preview to see your comment before it ships |
## [0.13.40](v0.13.39...v0.13.40) (2026-10-11) ### feat * **auth:** OAuth for a web server: a redirect flow, sealed secrets and a sealed token store (#242) ([59a20d1](59a20d1)) * **voice-pipeline:** build a speech-to-text chain from provider entries (#176) ([29046f2](29046f2)) ### fix * **images:** a local A1111 edit reports the checkpoint the server rendered with (#279) ([3744044](3744044)) * **images:** the untrusted image fetch closes six gaps a security review found (#278) ([b99ecbc](b99ecbc)) * **memory:** the guarded fetch's deadline covers decoding, and a network refusal names no resolver detail (#280) ([7d8bc9e](7d8bc9e)) ### docs * eleventh round of audit follow-ups (two pages published, the agent() and gmi() guides aligned) (#264) ([d4d3c6d](d4d3c6d))
Summary
Three follow-ups to the guarded fetch from a cold review of its merged change. The deadline and a caller's abort now end the body's decoding too:
readBodytakes the combined signal, destroys the response and the decoder when it fires, and the success path checks the signal before returning, so a compressed body whose decoding outlives the deadline is refused asdeadlinerather than returned late. Anetworkrefusal carries a fixed sentence instead of the resolver's own message. Four new tests refuse literal internal addresses (loopback, the metadata address, an IPv4-mapped IPv6 literal and a hexadecimal IPv4 spelling) throughguardedFetchitself, before any resolver call or connection, and two hold a gzip body's decoding past the deadline and past a caller's abort.Linked issues
Follow-up to #249.
Verification
CI on this branch. Nothing was run locally.
Checklist
Summary by Sourcery
Ensure guarded fetch cancellation covers decoding and consistently protects internal network details.
Bug Fixes:
Documentation:
Tests: