Skip to content

fix(chutes): add timeouts to OAuth HTTP requests - #102026

Merged
steipete merged 4 commits into
openclaw:mainfrom
Alix-007:alix/chutes-oauth-fetch-timeout
Jul 10, 2026
Merged

steipete merged 4 commits into
openclaw:mainfrom
Alix-007:alix/chutes-oauth-fetch-timeout

Conversation

@Alix-007

@Alix-007 Alix-007 commented Jul 8, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Chutes OAuth login and token refresh could remain pending indefinitely when a provider endpoint accepted the HTTP request but never completed it.

Why This Change Was Made

The callback deadline did not bound the token, userinfo, or refresh HTTP requests themselves. This change applies one fixed 30 second request deadline to authorization-code exchange, optional userinfo enrichment, provider-owned refresh, and the retained core refresh compatibility path. Optional userinfo failure no longer discards valid issued tokens, and no new config or public timeout API is introduced.

User Impact

Users now receive a bounded OAuth failure when required Chutes token work stalls. If only optional profile enrichment stalls, login completes with the valid tokens and omits unavailable profile metadata.

Evidence

Exact head: c21fb87f448e41c0297fc0ebe7fe74042f0b39a0

The focused tests use a real loopback HTTP server that accepts requests without responding. They prove bounded token exchange and refresh, best-effort userinfo timeout handling, and the fixed production deadline contract.

Full credentialed Chutes login was not tested because CHUTES_CLIENT_ID and CHUTES_CLIENT_SECRET are absent from the approved environment.

@openclaw-barnacle openclaw-barnacle Bot added extensions: chutes size: M triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. and removed triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. labels Jul 8, 2026
@clawsweeper

clawsweeper Bot commented Jul 8, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed July 9, 2026, 2:39 AM ET / 06:39 UTC.

Summary
Adds a 30s request-level timeout to Chutes OAuth token exchange and userinfo fetches, with loopback tests for hung HTTP responses.

PR surface: Source +16, Tests +260. Total +276 across 2 files.

Reproducibility: yes. from source and PR proof: current main sends Chutes token and userinfo fetches without a request signal, and the PR adds loopback tests for accepted-but-hung HTTP requests. I did not execute tests in this read-only review.

Review metrics: 1 noteworthy metric.

  • Auth request default: 1 added: 30_000 ms. The PR introduces a new Chutes OAuth token/userinfo HTTP deadline, which maintainers should notice as an auth setup compatibility change.

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🦞 diamond lobster
Patch quality: 🐚 platinum hermit
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • none.

Risk before merge

  • [P1] Merging changes existing Chutes OAuth token and userinfo requests from unbounded waits to a default 30s fail-closed deadline; this likely improves reliability, but unusually slow auth responses that previously waited indefinitely will now reject.

Maintainer options:

  1. Accept the bounded login behavior (recommended)
    Maintainers can accept the 30s fail-closed Chutes OAuth request deadline as the reliability tradeoff once exact-head checks finish.
  2. Adjust the timeout before merge
    If Chutes needs a different operational window, change the default while preserving the shared helper and timeout tests.
  3. Pause for live latency proof
    If the timeout value is uncertain, wait for live Chutes OAuth evidence before landing.

Next step before merge

  • [P2] No automated code repair is identified; the remaining action is maintainer acceptance or tuning of the new default Chutes OAuth request deadline.

Maintainer decision needed

  • Question: Should Chutes plugin OAuth token and userinfo HTTP requests fail after the new 30s request deadline by default?
  • Rationale: The code repair is narrow, but the default changes existing Chutes auth behavior from unbounded network waits to fail-closed provider-auth requests for very slow token or userinfo responses.
  • Likely owner: vincentkoc — Recent Chutes OAuth and shared OAuth helper history makes this the best available routing owner for the auth-boundary tradeoff.
  • Options:
    • Accept bounded auth requests (recommended): Land the 30s default because it prevents indefinite Chutes login hangs and follows the shared OAuth request-signal pattern.
    • Tune the deadline first: Ask for a different Chutes-specific timeout while keeping the same helper and regression tests.
    • Pause for live provider evidence: Hold the PR until maintainers see provider-specific Chutes OAuth latency evidence for the chosen deadline.

Security
Cleared: No concrete security or supply-chain concern was found; the diff changes Chutes OAuth request cancellation and tests without new dependencies, workflows, permissions, lockfiles, or secret handling.

Review details

Best possible solution:

Land the Chutes plugin timeout after maintainers accept or tune the 30s auth deadline, keeping the shared OAuth request-signal helper and loopback regression coverage.

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

Yes from source and PR proof: current main sends Chutes token and userinfo fetches without a request signal, and the PR adds loopback tests for accepted-but-hung HTTP requests. I did not execute tests in this read-only review.

Is this the best way to solve the issue?

Yes for the active Chutes plugin login path: the fix is narrow and reuses the shared OAuth request signal helper instead of duplicating timeout logic. A deprecated SDK compatibility login path remains separate and unbounded, but no current internal production caller uses it, so it is not a blocker for this plugin fix.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 20f355f2368c.

Label changes

Label justifications:

  • P2: This is a focused Chutes provider-auth reliability fix with limited plugin scope.
  • merge-risk: 🚨 compatibility: Existing slow Chutes token or userinfo responses that previously waited indefinitely will now fail at the new deadline.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR body provides after-fix live output from focused tests against a real local node:http server that accepts and hangs token/userinfo requests, plus mutation-check notes; no contributor action is needed for proof.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body provides after-fix live output from focused tests against a real local node:http server that accepts and hangs token/userinfo requests, plus mutation-check notes; no contributor action is needed for proof.
Evidence reviewed

PR surface:

Source +16, Tests +260. Total +276 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 18 2 +16
Tests 1 260 0 +260
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 278 2 +276

What I checked:

  • Repository policy read: Root AGENTS.md and scoped extensions/AGENTS.md were read; plugin-boundary and compatibility guidance affected the review. (AGENTS.md:1)
  • Scoped extension policy read: extensions/AGENTS.md says bundled plugin production code should use plugin SDK subpaths and keep provider-specific auth behavior local to the plugin. (extensions/AGENTS.md:1)
  • Current main has unbounded userinfo fetch: Current main's Chutes userinfo fetch passes only the Authorization header and no request signal. (extensions/chutes/oauth.ts:122, 20f355f2368c)
  • Current main has unbounded token exchange fetch: Current main's token exchange fetch posts the authorization-code body without a request signal. (extensions/chutes/oauth.ts:154, 20f355f2368c)
  • Active Chutes auth entry point: The Chutes provider OAuth method calls the extension-local loginChutes path that this PR changes. (extensions/chutes/index.ts:71, 20f355f2368c)
  • PR head timeout wiring: The PR head resolves a 30s Chutes OAuth fetch timeout and wires buildOAuthRequestSignal into both userinfo and token exchange fetch calls. (extensions/chutes/oauth.ts:132, 8011942953b2)

Likely related people:

  • vincentkoc: Current blame on the Chutes OAuth file and shared OAuth helper points to Vincent Koc, and recent commits changed Chutes OAuth response handling and provider OAuth helper surfaces. (role: recent Chutes auth and OAuth helper contributor; confidence: high; commits: c0d99ed26ea2, 6fc0303ec04b, 75de853c3791; files: extensions/chutes/oauth.ts, extensions/chutes/oauth.test.ts, src/plugin-sdk/provider-oauth-runtime.ts)
  • steipete: Commit history shows Peter Steinberger authored the bundled Chutes extension addition that established the current plugin-owned auth surface. (role: introduced bundled Chutes extension; confidence: medium; commits: a724bbce1a63; files: extensions/chutes/oauth.ts, extensions/chutes/index.ts, docs/providers/chutes.md)
  • wangmiao0668000666: Recent merged history changed the same Chutes OAuth file and tests to bound JSON response reads, making this person useful for adjacent regression context. (role: recent Chutes OAuth test and hardening contributor; confidence: medium; commits: 5723222bbb3c; files: extensions/chutes/oauth.ts, extensions/chutes/oauth.test.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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
  • 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.
Review history (3 earlier review cycles)
  • reviewed 2026-07-08T04:55:24.237Z sha bbd77c71b7c0fb32d4fa5d4e330323bd11fa43f0 :: needs changes before merge. :: [P1] Reuse the shared OAuth request signal helper
  • reviewed 2026-07-08T05:31:10.864Z sha 8a474ad63b8ceb845329982d4a105c0296e4f37c :: needs maintainer review before merge. :: none
  • reviewed 2026-07-08T05:39:47.696Z sha 8a474ad63b8ceb845329982d4a105c0296e4f37c :: needs maintainer review before merge. :: none

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. 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. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Jul 8, 2026
@steipete steipete self-assigned this Jul 10, 2026
@steipete
steipete force-pushed the alix/chutes-oauth-fetch-timeout branch from 18b8f18 to 3d77a72 Compare July 10, 2026 08:45
@steipete
steipete requested a review from a team as a code owner July 10, 2026 08:45
@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling size: S size: M and removed size: M size: S labels Jul 10, 2026
@steipete
steipete force-pushed the alix/chutes-oauth-fetch-timeout branch from 737178d to c21fb87 Compare July 10, 2026 09:13
@steipete

Copy link
Copy Markdown
Contributor

Land-ready at c21fb87f448e41c0297fc0ebe7fe74042f0b39a0.

Maintainer fixups now apply one fixed 30-second request deadline to Chutes authorization-code exchange, optional userinfo, provider refresh, and the retained core compatibility refresh path. Optional userinfo failure preserves issued tokens; the test-only timeout surface was removed. Fresh autoreview completed with no accepted/actionable findings.

Exact-head proof:

Proof gap: a full credentialed Chutes login was unavailable because the approved environment has no Chutes OAuth client credentials. Live unauthenticated discovery, userinfo, and malformed-token probes all returned promptly.

@steipete
steipete merged commit f35b6e5 into openclaw:main Jul 10, 2026
103 checks passed
@steipete

Copy link
Copy Markdown
Contributor

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 11, 2026
* fix(chutes): add timeouts to OAuth HTTP requests

* fixup: reuse OAuth request signal helper for Chutes

* fix(chutes): bound OAuth requests

* test(chutes): normalize abort rejections

---------

Co-authored-by: Peter Steinberger <[email protected]>
Monkey-wusky added a commit to Monkey-wusky/openclaw that referenced this pull request Jul 14, 2026
Google Chat auth requests made through createGoogleAuthFetch() had no
request deadline, which could leave token refresh and cert fetch
operations waiting indefinitely when a Google auth endpoint accepted
the HTTP connection but never responded.

Add a 30s request timeout (GOOGLE_AUTH_REQUEST_TIMEOUT_MS) to the
guarded fetch call inside createGoogleAuthFetch(), matching the
deadline used by Vertex ADC (openclaw#102050), Chutes OAuth (openclaw#102026),
and the sibling googlechat cert fetch path (openclaw#102924).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling extensions: chutes merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M 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.

2 participants