Repository navigation
fix(qqbot): add timeout to speech transcription requests - #102028
Conversation
|
Codex review: needs maintainer review before merge. Reviewed July 9, 2026, 8:18 AM ET / 12:18 UTC. Summary PR surface: Source +28, Tests +10, Docs +5. Total +43 across 3 files. Reproducibility: yes. source-level: current main calls the QQBot STT guarded fetch without timeoutMs, and the PR proof describes a no-response loopback server that now rejects at the configured deadline instead of staying pending. Review metrics: 1 noteworthy metric.
Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Maintainer decision needed
Security Review detailsBest possible solution: Land the bounded QQBot STT fetch through existing provider/media timeoutSeconds configuration after maintainers accept the 60-second default as the upgrade behavior. Do we have a high-confidence way to reproduce the issue? Yes, source-level: current main calls the QQBot STT guarded fetch without timeoutMs, and the PR proof describes a no-response loopback server that now rejects at the configured deadline instead of staying pending. Is this the best way to solve the issue? Yes, with a merge-risk caveat. Reusing fetchWithSsrFGuard and existing provider/media timeoutSeconds settings is the narrow owner-boundary fix; adding QQBot-only timeout keys would duplicate the config contract. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against f786efddcd88. Label changesLabel justifications:
Evidence reviewedPR surface: Source +28, Tests +10, Docs +5. Total +43 across 3 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 (7 earlier review cycles)
|
|
Reviewed from the downstream self-hosted STT angle. This is useful for local/private OpenAI-compatible transcription servers such as FunASR/SenseVoice deployments, where a request can connect successfully but then hang during model warmup, GPU queueing, or a stalled backend worker. The current direction looks right to me because the deadline now flows through the existing provider/audio timeout config rather than introducing QQBot-only STT timeout keys. Two compatibility details are worth preserving through the final review:
No FunASR/SenseVoice-specific blocker from my pass; the loopback server test that accepts the POST and never responds is the right regression shape for stalled self-hosted transcription endpoints. |
Co-authored-by: Alix-007 <[email protected]>
2c4a329 to
3a8ab78
Compare
|
Maintainer rewrite and verification complete. The branch is now one focused commit with 46 additions and 3 deletions, replacing the original 265-line timeout harness. The runtime uses the supported Validation:
Proof gap: no credentialed third-party QQ/STT endpoint was used; the network behavior was exercised against a real loopback server through the production request path. |
|
Merged via squash.
|
Co-authored-by: Peter Steinberger <[email protected]>
What Problem This Solves
QQBot voice-message handling could wait indefinitely when an OpenAI-compatible STT endpoint accepted the transcription request but never responded.
Why This Change Was Made
The transcription POST now carries a timer-safe deadline through the existing
fetchWithSsrFGuardboundary. The implementation uses only existing publictimeoutSecondssettings:models.providers.<id>.timeoutSeconds;This avoids a QQBot-only timeout key and removes the earlier duplicated timeout parsing and test harness.
User Impact
A stalled STT provider no longer blocks the QQBot inbound attachment path indefinitely. Slow self-hosted providers can raise an existing provider or media timeout setting. Timeout failures keep the established platform-ASR or transcription-failed fallback behavior.
Evidence
tbx_01kx3bajwrmdeepkwxd0390qnf:pnpm test extensions/qqbot/src/engine/utils/stt.test.ts extensions/qqbot/src/config.test.ts extensions/qqbot/src/manifest-schema.test.tspassed, 27/27 tests.pnpm test ... src/infra/net/fetch-guard.ssrf.test.tspassed the guarded-fetch suite, 91/91 tests.node scripts/test-live.mjs -- extensions/qqbot/src/engine/utils/stt.live.test.tspassed a temporary real HTTP scenario in which the server received the multipart POST and never replied; the request rejected after the configured one-second deadline.pnpm check:changedpassed extension production/test typechecks, lint, docs checks, and architecture guards.git diff --checkpassed.Real behavior proof
The live probe exercised the exported
resolveSTTConfigandtranscribeAudiopath against a real loopback HTTP server that accepted the request and deliberately never sent a response. The rewritten path rejected withTimeoutErrorafter the configured deadline instead of remaining pending.Live QQ platform traffic and a third-party STT account were not used; the provider hang itself was reproduced with the no-response server.