Repository navigation
fix(qqbot): add 30s request timeout to token endpoint fetch - #102897
Conversation
|
Codex review: needs maintainer review before merge. Reviewed July 10, 2026, 8:34 PM ET / July 11, 2026, 00:34 UTC. Summary PR surface: Source +2, Tests +70. Total +72 across 2 files. Reproducibility: yes. A real loopback HTTP server accepted the request without returning headers, and the unchanged production guard path rejected near the configured deadline after the fix. Review metrics: none identified. Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Refresh the branch, rerun exact-head gates, and merge the focused call-site timeout while keeping it internal and fixed rather than adding new configuration or parallel abort machinery. Do we have a high-confidence way to reproduce the issue? Yes. A real loopback HTTP server accepted the request without returning headers, and the unchanged production guard path rejected near the configured deadline after the fix. Is this the best way to solve the issue? Yes. Passing the existing guard's AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against b7d6291bfd6e. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +2, Tests +70. Total +72 across 2 files. 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
Review history (4 earlier review cycles)
|
|
Supplemented with real-behavior proof and fixed a stale unit assertion:
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
178754a to
03a86a7
Compare
03a86a7 to
af83e02
Compare
12beeba to
7460e92
Compare
7460e92 to
dcc2695
Compare
|
Land-ready proof for What changed:
Validation:
Known gap: no live QQ account traffic was used. The failure is a deterministic stalled-response/singleflight condition covered at the exact production owner boundary. |
dcc2695 to
0453815
Compare
|
Merged via squash.
|
(cherry picked from commit 6b460e5)
What Problem This Solves
TokenManager.doFetchToken()calledfetchWithSsrFGuardwithout a deadline. If the QQBot token endpoint accepted a connection but never returned response headers, the singleflight token request could hang indefinitely and block every caller waiting for the same app token.Why This Change Was Made
The token endpoint now uses the existing guarded-fetch timeout contract with a 30-second deadline. The change stays in the QQBot token owner and reuses the same bounded-fetch mechanism already used elsewhere rather than adding another timer path.
User Impact
A stalled QQBot token request now aborts after 30 seconds. Every caller sharing that in-flight request receives the same timeout failure, the singleflight state is cleared, and a later request can retry normally.
Evidence
TokenManagerthrough the real guarded fetch with two same-app callers.run_3e6b0bdb1f9e:extensions/qqbot/src/engine/api/token.test.ts, 7/7 passed.29132587977: 62 green rollup checks, no failures; native prepare accepted it after the clean rebase.Live QQ platform traffic was not required for this failure class: the regression controls the stalled response at the guarded-fetch boundary while exercising production
TokenManagersingleflight behavior.Root Cause
The token acquisition path was the remaining QQBot fetch path without a bounded deadline. Because
TokenManagerdeduplicates requests per app, one stalled request also stalled every waiter.AI-assisted.