Repository navigation
refactor(chutes): move OAuth refresh into provider plugin - #120840
Conversation
|
Codex review: needs maintainer review before merge. Reviewed August 9, 2026, 12:39 AM ET / 04:39 UTC. ClawSweeper reviewWhat this changesMoves Chutes OAuth token refresh from core auth-profile code into the Chutes provider plugin through the existing generic provider refresh hook. Merge readinessNo blocking code finding remains: the current head addresses the prior lifecycle concern. Keep this maintainer-authored PR open for the explicit disabled/missing-plugin compatibility decision and exact-head CI completion. Priority: P2 Review scores
Verification
How this fits togetherThe auth-profile subsystem refreshes expired stored credentials, dispatching provider-specific protocol work to the provider plugin and then persisting the result. Core retains generic provider ownership and unavailable-state handling, while the Chutes plugin owns its OAuth HTTP exchange. flowchart LR
A[Expired Chutes credential] --> B[Auth profile refresh]
B --> C[Provider ownership lookup]
C --> D[Chutes plugin refresh hook]
D --> E[Chutes token endpoint]
E --> F[Persist refreshed credential]
Decision needed
Why: The implementation is consistent with the existing provider contract, but it deliberately changes the upgrade behavior for profiles whose owner plugin is unavailable. Before merge
Agent review detailsSecurityNone. PR surfaceSource -7, Tests +240. Total +233 across 9 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Adopt the single provider-owned refresh path once its explicit unavailable-owner behavior is accepted and the exact PR head is green. Do we have a high-confidence way to reproduce the issue? Yes, by source: the lifecycle test constructs the prior loading window and verifies the post-fix dispatch and persistence path; this read-only review did not execute it. Is this the best way to solve the issue? Yes: the existing generic provider hook is the narrowest maintainable owner boundary, while restoring a Chutes-specific core fallback would duplicate vendor protocol. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 7f3cc6995bc6. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (2 earlier review cycles) |
|
The P1 production-change recommendation was not applied. Direct source and history verification showed that the old Chutes fallback was already after Provider registration is synchronous from The added real lifecycle test starts an expired Chutes auth-profile refresh inside synchronous Exact proof:
@clawsweeper re-review |
|
🦞👀 Command router queued. I will update this comment with the next step. |
|
The latest ClawSweeper comment still records reviewed head Current head adds Focused proof on the current file is green (2 tests), the requested Chutes/provider acceptance set is green (84 tests), the path-scoped changed gate is green, and fresh autoreview found no P1-or-higher issue after the reentry assertion was hardened. @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Maintainer owner decision: accepted. Chutes OAuth refresh is provider-owned, so an explicitly disabled or removed Chutes plugin must not continue executing Chutes vendor protocol from core. The intended outcome is the generic visible The current-head lifecycle regression also proves that a normally enabled plugin refreshes successfully across synchronous registration, while disabled ownership and absent ownership remain distinct. Exact-head CI run 31294769803 is green, and the current-head ClawSweeper review reports no actionable findings. |
|
Land-ready proof for Root cause: Chutes OAuth refresh protocol had two owners—the generic provider-plugin dispatch and a Chutes-specific core fallback. The Chutes plugin is the architectural owner. The canonical fix registers its existing Production LOC is +68/-75 (net -7); tests are +458/-218 (net +240). Coverage includes the generic provider hook and sibling provider-runtime behavior, synchronous plugin registration followed by refresh persistence, and distinct disabled-owner ( Focused proof:
Blacksmith Testbox The completed current-head ClawSweeper review reports no findings and confirms the earlier lifecycle P1 is addressed (#120840 (comment)). The accepted owner decision is that a disabled or removed Chutes plugin intentionally yields generic configured-unavailable behavior; core must not execute Chutes vendor protocol (#120840 (comment)). Known proof gap: no live Chutes credentials or network were used; token HTTP behavior is mock-backed. |
…20840) * refactor(chutes): move OAuth refresh into provider plugin * test(chutes): prove OAuth refresh load ordering
What Problem This Solves
Chutes OAuth refresh was duplicated and live in core while login was provider-owned. Core hardcoded a Chutes fallback after generic provider dispatch.
Why This Change Was Made
Provider-specific auth belongs to the owner plugin. This registers the existing generic
ProviderPlugin.refreshOAuthhook and removes the core refresh implementation and fallback, without adding a new SDK or provider-named seam.Compatibility decision: retain the shipped deprecated
provider-auth-login.runtimeloginChutesshim plus the core login/token-exchange implementation and its deprecation inventory. The latest stable release shipped it;removeAfteris 2026-10-01, and explicit breaking-release approval is required. This PR does not shorten that window.The maintainer owner decision accepts the generic
configured-unavailableoutcome when the Chutes owner plugin is disabled or removed; core must not continue executing Chutes vendor protocol in that state.User Impact
Installed and enabled Chutes plugins keep existing OAuth profiles auto-refreshing. When the owner plugin is missing or disabled, Chutes now follows the generic configured-unavailable behavior instead of silently running vendor protocol in core.
Evidence
node scripts/run-vitest.mjs extensions/chutes/oauth.test.ts extensions/chutes/implicit-provider.test.ts src/agents/auth-profiles.chutes.test.ts— 24 passed.node scripts/run-vitest.mjs src/agents/chutes-oauth.flow.test.ts src/agents/chutes-oauth.test.ts src/commands/chutes-oauth.test.ts— 15 passed.node scripts/run-vitest.mjs src/agents/auth-profiles.chutes.lifecycle.test.ts— 2 passed, covering synchronous provider registration, persisted refresh, and disabled-versus-absent ownership.node scripts/run-vitest.mjs src/agents/auth-profiles.chutes.test.ts src/plugins/provider-runtime.test.ts extensions/chutes/oauth.test.ts— 84 passed.pnpm check:changedpassed on Blacksmith Testboxtbx_01kzj4jwnda1589cje9gcctsbpafter one test-only lint correction: https://github.com/openclaw/openclaw/actions/runs/31289799926tbx_01kzjbnaesrdb98vtxcb9sghx0: https://github.com/openclaw/openclaw/actions/runs/31294140350a1c0f95295039bc081449f80b996da5da5b2ea20: https://github.com/openclaw/openclaw/actions/runs/31294769803