Repository navigation
Conversation
When fetchChatCerts receives a non-OK response from the Google Chat cert endpoint, it throws without cancelling the response body. Cancel the body before throwing, matching the pattern established in reef guard adapters (openclaw#109196) and fetchOpenRouterModels.
|
Codex review: needs real behavior proof before merge. Reviewed July 16, 2026, 10:01 PM ET / July 17, 2026, 02:01 UTC. Summary PR surface: Source +1. Total +1 across 1 file. Reproducibility: yes. at source level: a partial or stalled non-OK certificate response reaches the throw without consuming or cancelling its body. A real loopback reproduction was not supplied in the PR. Review metrics: none identified. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Keep cancellation in the Google Chat caller, add focused coverage for the non-OK body path, and merge after a redacted loopback run shows the server observes prompt peer closure. Do we have a high-confidence way to reproduce the issue? Yes at source level: a partial or stalled non-OK certificate response reaches the throw without consuming or cancelling its body. A real loopback reproduction was not supplied in the PR. Is this the best way to solve the issue? Yes. The caller owns consuming or cancelling the response body, while the guarded-fetch release callback separately owns dispatcher cleanup, so cancelling before preserving the existing HTTP error is the narrowest fix. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 2e3b4ab586fb. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +1. Total +1 across 1 file. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
Co-authored-by: 毛宇豪0668001457 <[email protected]>
Co-authored-by: 毛宇豪0668001457 <[email protected]>
|
Merged via squash.
|
…ng (openclaw#109519) * fix(googlechat): cancel non-OK cert fetch response body before throwing When fetchChatCerts receives a non-OK response from the Google Chat cert endpoint, it throws without cancelling the response body. Cancel the body before throwing, matching the pattern established in reef guard adapters (openclaw#109196) and fetchOpenRouterModels. * test(googlechat): cover cert response cancellation Co-authored-by: 毛宇豪0668001457 <[email protected]> * test(googlechat): satisfy strict call-order types Co-authored-by: 毛宇豪0668001457 <[email protected]> --------- Co-authored-by: Peter Steinberger <[email protected]>
…ng (openclaw#109519) * fix(googlechat): cancel non-OK cert fetch response body before throwing When fetchChatCerts receives a non-OK response from the Google Chat cert endpoint, it throws without cancelling the response body. Cancel the body before throwing, matching the pattern established in reef guard adapters (openclaw#109196) and fetchOpenRouterModels. * test(googlechat): cover cert response cancellation Co-authored-by: 毛宇豪0668001457 <[email protected]> * test(googlechat): satisfy strict call-order types Co-authored-by: 毛宇豪0668001457 <[email protected]> --------- Co-authored-by: Peter Steinberger <[email protected]>
What Problem This Solves
When
fetchChatCertsin the Google Chat extension receives a non-OK response from the cert endpoint (https://chat.googleapis.com/service_accounts/v1/metadata/x509/[email protected]), it throws immediately without cancelling the response body. This leaves the underlying HTTP connection open until the response body is garbage-collected.Why This Change Was Made
Other parts of the codebase already cancel non-OK response bodies before throwing — see
fetchOpenRouterModelsinmodel-scan.ts(finally block withres.body?.cancel()) andguard-adapters.ts(#109196,response.body?.cancel().catch(() => undefined)). This change applies the same pattern tofetchChatCerts.The
release()call infinallycleans up the dispatcher but does not cancel the unconsumed response body.User Impact
No visible user impact. The fix ensures HTTP connections are released promptly when the Google Chat cert endpoint returns an error, which can improve responsiveness during API degradation.
Evidence
All existing Google Chat tests continue to pass (205/206, the one failure in
setup.test.tsis a pre-existing environment issue unrelated to this change):The auth-specific test passes:
Risk checklist
Did user-visible behavior change? (
No)Did config, environment, or migration behavior change? (
No)Did security, auth, secrets, network, or tool execution behavior change? (
No)What is the highest-risk area? - Minimal: one-line addition of body cancel before throw, pattern already used in 30+ locations across the codebase.
How is that risk mitigated? - Existing test suite verifies the function still works correctly.