Skip to content

fix(plugins): report request timeouts for stalled response bodies - #116166

Merged
vincentkoc merged 3 commits into
mainfrom
fix/response-body-deadline-regressions-20260730
Jul 30, 2026
Merged

vincentkoc merged 3 commits into
mainfrom
fix/response-body-deadline-regressions-20260730

Conversation

@vincentkoc

Copy link
Copy Markdown
Member

What Problem This Solves

Fixes an issue where OpenAI device-code login, MS Teams SharePoint uploads, and QQ channel API calls could report a generic response-body stall before the plugin's existing request deadline when response headers arrived but the body stopped streaming.

Why This Change Was Made

Each plugin now passes its existing operation timeout into the bounded response reader, so the owner-level deadline remains authoritative without changing shared HTTP defaults. The OpenAI and Teams regression tests also await timer advancement and rejection together so a failing assertion cannot leak an unhandled rejection.

User Impact

Users now receive the plugin's stable request-timeout result for stalled response bodies, matching the same deadline used before response headers arrive.

Evidence

  • Reproduced all three failures on current main: OpenAI returned error body read stalled for 10000ms, Teams returned a 30000ms body-reader error, and QQBot returned the 10000ms body-reader error.
  • Focused validation on the rebased head: 3 Vitest shards, 55/55 tests passed. The same bundle also passed three consecutive pre-rebase repetitions.
  • git diff --check passed; oxfmt completed on all five changed files.
  • Autoreview: clean, no accepted/actionable findings, overall 0.93.
  • OpenAI/Codex protocol contract inspected directly at openai/codex@9a6668f674d74b35418fa534b3b6285a315d0765: codex-rs/login/src/device_code_auth.rs:62-178 and codex-rs/login/tests/suite/device_code_login.rs:38-87,216-248.

AI-assisted: yes. I reviewed the implementation and validation results.

@vincentkoc vincentkoc self-assigned this Jul 30, 2026
@vincentkoc
vincentkoc marked this pull request as ready for review July 30, 2026 01:37
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. P2 Normal backlog priority with limited blast radius. labels Jul 30, 2026
@clawsweeper

clawsweeper Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed July 29, 2026, 9:42 PM ET / July 30, 2026, 01:42 UTC.

ClawSweeper review

What this changes

The PR passes each plugin’s existing request deadline into the bounded HTTP response-body reader so stalled response streams return the plugin’s established timeout result instead of a generic body-reader stall error.

Merge readiness

⚠️ Ready for maintainer review - 1 item remains

Keep this PR open for normal member/maintainer review. The patch is a focused, owner-level timeout propagation fix across OpenAI device login, MS Teams uploads, and QQ channel API reads; no concrete correctness or security defect is evident from the supplied diff and CI evidence, while the maintainer label and MEMBER authorship require explicit maintainer handling rather than automated cleanup.

Priority: P2
Reviewed head: e747e5f65f041cefa1474fa5ee0679fe2329ac6b

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused patch with matching regression-test updates and successful supplied CI evidence; it needs normal owner review, not a repair cycle.
Proof confidence 🌊 off-meta tidepool Not applicable: The author is a repository MEMBER, so the external-contributor real-behavior-proof gate does not apply; the PR body nevertheless reports current-main reproductions and focused validation.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The author is a repository MEMBER, so the external-contributor real-behavior-proof gate does not apply; the PR body nevertheless reports current-main reproductions and focused validation.
Evidence reviewed 4 items Focused owner-level fix: The supplied PR diff adds the already-resolved upload timeout to the MS Teams response reader, adds the device-code request timeout to the OpenAI response reader, and adds QQBot's existing default timeout to both successful and error body reads; it does not change shared HTTP defaults.
Current-main gap addressed: At the current base revision, the affected response-body reads do not pass a chunk timeout even though their enclosing operations already carry request timeouts. The PR preserves those owner boundaries rather than introducing a global transport policy.
Regression coverage: The OpenAI and MS Teams tests change timer advancement and rejection waiting into one awaited operation, avoiding an unhandled rejection when the assertion fails. The supplied CI state reports the changed-node shards, plugin/channel contracts, lint, production types, dependency checks, security checks, and CI gate as successful.
Findings None None.
Security None None.

How this fits together

These plugin request paths start an operation-level timeout, make an HTTP request, then parse the returned response body. The bounded reader sits after response headers; this change makes it use the same owner-level deadline so timeout reporting remains consistent through request completion.

flowchart LR
  A[Plugin operation] --> B[Owner request deadline]
  B --> C[HTTP request]
  C --> D[Response headers]
  D --> E[Bounded response-body reader]
  B --> E
  E --> F[Stable plugin timeout or parsed result]
Loading

Before merge

  • Complete next step (P2) - No discrete repair is identified; MEMBER authorship and the protected maintainer label require normal plugin-owner review before landing.
Agent review details

Security

None.

PR surface

Source +6, Tests -3. Total +3 across 5 files.

View PR surface stats
Area Files Added Removed Net
Source 3 12 6 +6
Tests 2 5 8 -3
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 5 17 14 +3

Review metrics

None.

Technical review

Best possible solution:

Retain the owner-level timeout propagation approach, land it only after the relevant plugin owners confirm the expected timeout wording and behavior for stalled body reads, and keep shared HTTP defaults unchanged.

Do we have a high-confidence way to reproduce the issue?

Yes, source reproduction is reasonably clear: each affected operation has an existing request deadline while its response-body reader previously lacked that deadline. The PR body also reports focused reproductions on current main, but this review did not independently execute them.

Is this the best way to solve the issue?

Yes. Passing the already-established owner timeout into the bounded reader is the narrowest maintainable fix because it preserves plugin-specific timeout policy without changing shared HTTP behavior.

AGENTS.md: unclear because the file could not be read completely.

Codex review notes: model internal, reasoning high; reviewed against 21db50efc72e.

Labels

Label changes:

  • add P2: This is a bounded reliability fix for timeout reporting in three plugin request paths, with no evidence of a current release-blocking outage.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The author is a repository MEMBER, so the external-contributor real-behavior-proof gate does not apply; the PR body nevertheless reports current-main reproductions and focused validation.

Label justifications:

  • P2: This is a bounded reliability fix for timeout reporting in three plugin request paths, with no evidence of a current release-blocking outage.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The author is a repository MEMBER, so the external-contributor real-behavior-proof gate does not apply; the PR body nevertheless reports current-main reproductions and focused validation.

Evidence

What I checked:

  • Focused owner-level fix: The supplied PR diff adds the already-resolved upload timeout to the MS Teams response reader, adds the device-code request timeout to the OpenAI response reader, and adds QQBot's existing default timeout to both successful and error body reads; it does not change shared HTTP defaults. (extensions/msteams/src/graph-upload.ts:104, e747e5f65f04)
  • Current-main gap addressed: At the current base revision, the affected response-body reads do not pass a chunk timeout even though their enclosing operations already carry request timeouts. The PR preserves those owner boundaries rather than introducing a global transport policy. (extensions/openai/openai-chatgpt-device-code.ts:185, 21db50efc72e)
  • Regression coverage: The OpenAI and MS Teams tests change timer advancement and rejection waiting into one awaited operation, avoiding an unhandled rejection when the assertion fails. The supplied CI state reports the changed-node shards, plugin/channel contracts, lint, production types, dependency checks, security checks, and CI gate as successful. (extensions/openai/openai-chatgpt-device-code.test.ts:123, e747e5f65f04)
  • Protected review route: This PR is authored by a repository MEMBER and carries the maintainer label, so repository review policy requires it to remain open for explicit maintainer handling rather than automated close/cleanup.

Likely related people:

  • vincentkoc: The current three-commit PR covers the OpenAI device-code, MS Teams upload, and QQBot API timeout paths and is authored by a repository MEMBER; main-history provenance could not be independently completed in this read-only environment. (role: member contributor for the affected plugin timeout paths; confidence: low; commits: 304ebb77ed36, c63977d3c003, e747e5f65f04; files: extensions/openai/openai-chatgpt-device-code.ts, extensions/msteams/src/graph-upload.ts, extensions/qqbot/src/engine/tools/channel-api.ts)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
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.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@vincentkoc
vincentkoc force-pushed the fix/response-body-deadline-regressions-20260730 branch from e747e5f to b23391c Compare July 30, 2026 01:59
@vincentkoc
vincentkoc merged commit 18e107f into main Jul 30, 2026
88 checks passed
@vincentkoc
vincentkoc deleted the fix/response-body-deadline-regressions-20260730 branch July 30, 2026 02:03
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash.

vincentkoc added a commit to zhangguiping-xydt/openclaw that referenced this pull request Jul 30, 2026
* origin/main:
  fix(macos): stop canceled voice wake timers (openclaw#116189)
  fix(macos): coalesce location permission requests (openclaw#116183)
  fix(macos): guard remote tunnel restart ownership (openclaw#116172)
  fix(agents): throw CompactionError when summarization fails (openclaw#115500)
  fix(test): isolate ACP startup output stream (openclaw#116076)
  fix(agents): deny all tools when scheduled authority names a removed account (openclaw#115932)
  fix(test): stop collecting Vydra test helpers (openclaw#116139)
  fix(discord): preserve webhook deadline errors (openclaw#116155)
  fix(test): isolate Google embedding batch timeout (openclaw#116161)
  fix(cron): stop replaying old schedule slots after a cron job is edited (openclaw#115779)
  fix(plugins): report request timeouts for stalled response bodies (openclaw#116166)
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 30, 2026
…enclaw#116166)

* fix(openai): preserve device-code request timeouts

* fix(msteams): preserve SharePoint upload timeouts

* fix(qqbot): preserve channel API request timeouts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: msteams Channel integration: msteams channel: qqbot extensions: openai maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant