Skip to content

refactor(auth): one owner for provider sign-in failures, paste and recovery - #203394

Merged
obviyus merged 21 commits into
mainfrom
openclaw/tender-barnacle-f1d158
Nov 22, 2026
Merged

obviyus merged 21 commits into
mainfrom
openclaw/tender-barnacle-f1d158

Conversation

@obviyus

@obviyus obviyus commented Nov 22, 2026 •

Copy link
Copy Markdown
Collaborator

What Problem This Solves

Fixes: provider sign-in failures end the attempt with the wrong reason, raw provider errors, or a terminal command, when consent is denied, a wrong or unrelated address is pasted, the callback port is busy, a device code expires or is denied, the network drops during the token exchange, or a saved sign-in is rejected later.

Each provider plugin, the Control UI wizard, the chat /login flow and the CLI decided and worded these failures separately. The same failure looked different on every surface, and most of them told Control UI and chat users to run a CLI command.

User Impact

User impact: a failed sign-in now names the cause in one plain sentence and offers one recovery action on every surface.

  • Recoverable mistakes keep the attempt open. Consent denied (Gateway-origin and loopback callbacks), a wrong-state paste, a pasted sign-in page and a pasted error= redirect show the reason under the field. The user fixes it without starting over.
  • Terminal failures offer Start sign-in again. Code expired, code denied, network failure and invalid_grant end with Close and Start sign-in again, instead of only Close.
  • Paste is visible by default. The paste field is open when the browser step starts. A busy callback port says so (The sign-in callback could not start because its port is in use.).
  • OpenAI Codex login is one method. It starts with a device code (works on local and remote Gateways). When the device-code endpoint is not available (404), it falls back to browser sign-in by itself, instead of failing with "use ChatGPT OAuth instead". This replaces the separate browser-first and device-code choices.
  • No terminal commands in Control UI or chat text. The CLI keeps its own renderer, which prints openclaw models auth login ….
  • A rejected saved sign-in has one recovery in chat. The reply says to send /login <provider>, and the composer banner offers Open Models instead of contradicting it.

Compatibility:

  • Retired auth choice ids still resolve through deprecatedChoiceIds: openai-device-code (shipped in v2026.5.12) and xai-device-code (shipped in v2026.5.19). The --device-code and --method CLI flags are kept.
  • The Plugin SDK changes are additive only (see Evidence). The deprecated OAuthAuthorizationInput type is kept.
  • The Gateway wizard protocol gets one optional reason field on a step and on an error result. Older clients ignore it, because wizard results are not validated on the client. A newer CLI against an older Gateway gets no reason and prints the plain message, as before.

Why This Change Was Made

One owner now decides sign-in failures:

  • ProviderAuthFailure carries a typed reason. Its recovery (retry, wait, admin) is derived from the reason in one place.
  • Provider plugins throw typed failures instead of formatting their own text.
  • The wizard session carries the reason to clients on progress updates and on the terminal result. The Control UI and chat render it with the one recovery action, and the CLI renders it with its command.
  • One shared SDK parser validates pasted callback addresses for every provider, so state checks and the error messages are the same everywhere.
  • Gateway provider sign-in gets ctx.nodes for paired-node access, so plugins do not reach into core internals.
  • /login authority is checked once, when the flow starts.

Production code in the sign-in scope is smaller than on main (−305 lines). The superseded per-plugin failure formatting, the separate OpenAI authorization and preflight runtimes, MiniMax's own OAuth runtime and the duplicate auth-method matchers are removed.

Danger: two-way door. A revert restores the previous text and flows. No stored state, config or schema changes. The blast radius is provider sign-in in the Control UI, chat /login and the CLI, for the bundled providers that sign in (OpenAI, Codex, xAI, OpenRouter, Chutes, LM Studio, MiniMax, GitHub Copilot) and for external plugins that use the provider-auth SDK, such as Gemini.

Evidence

Failure matrix (src/plugins/provider-auth-failure.matrix.test.ts, 31 cases: each failure × surface, plus refusal and paste cases): every case fails on main 2c47390 and passes on this branch. (The run on main had 39/39 failing; 8 of them were a helper-only group that was later removed, because the Control UI tests cover that path.)

Gates at the PR head:

  • Tests: 87 in-scope test files across 22 Vitest shards pass, including the matrix.
  • Type checks: tsgo:core, tsgo:core:test, tsgo:extensions and tsgo:ui pass.
  • ui:i18n:verify and protocol:check pass. The protocol check includes the Swift and Kotlin contract checks.
  • oxlint is clean.
  • ocx build --dts and the packed release smoke (scripts/release-check.ts) pass.
  • Test-line growth above the 400-line allowance (+161) is recorded in config/test-lines-allocations/203394-provider-sign-in-failure-owner.txt: the matrix replaces per-plugin failure-text tests that this PR deletes.
  • The paste layout reuses the shared .row/.stack layout. The only new CSS is one compact-badge rule, within the Control UI CSS budget.

Line counts in the sign-in scope (physical lines):

Class main this PR Change
Production 18093 17788 −305
Tests 17250 17647 +397

Plugin SDK API diff (no entrypoint added or removed, no export removed). The declared additions are:

  • ProviderAuthFailure, plus its reason and recovery types.
  • ctx.nodes on the Gateway provider sign-in context (approved by the maintainer).
  • The shared paste parser for callback addresses.
  • An optional reason on WizardProgress.update(message, reason?), WizardSession.pushProgress and the local OAuth callback onProgress. This optional parameter is why the diff tool marks 50 more exports that reach WizardPrompter as affected.

CLI commands in sign-in text. All 35 earlier hits are classified:

  • Fixed (reaches the Control UI or chat), with the surface-neutral text now used:
    • the Codex auth bridge and the web-search setup note
    • the OpenAI unknown-model hint
    • the chat /login opener scope note
    • the Control UI save error for a profile that is already in use
    • the loopback callback page ("Return to the terminal")
    • the account-link RPC error
    • the auth-profile failover chat reply
    • the LM Studio key error
    • the shared agentDir config error
  • Kept, because they are CLI-only: doctor, onboarding, the TUI, CLI usage errors, the llama-cpp CLI setup and the CLI renderer.

Telegram /login openai, code denied (real Telegram Test Server, stub device-code provider):

  • Before: OpenAI login did not complete. Send /login openai/openai-device-code to try again., plus a separate "OAuth help" FAQ message, which was then edited.
  • After: OpenAI: The sign-in code was denied. Send /login openai/openai to try again. The FAQ message is gone.

Control UI, before (main) and after (this PR). Captured on scratch Gateways with the real Gemini and OpenAI plugins.

  • Real provider endpoints were used for the expired device code (auth.openai.com, 15 minutes) and for invalid_grant (Google).
  • Consent redirects were simulated on the real callback URL.
  • Network drops and denials were stubbed through a proxy.

No tokens, emails, real codes or live state appear in the images. Visible codes and state values are synthetic.

Case Before After
Consent denied (Gemini, Gateway callback) before: Provider sign-in was declined, attempt ended after: attempt stays open with the reason and Reopen browser tab
Consent denied, callback page before: Sign-in was not completed after: Sign-in was not allowed, go back and allow access
Consent denied (OpenAI loopback) before: OpenAI authorization was not completed with VPS notes after: paste field stays open with the reason
Wrong-state paste before: callback_validation_failed State mismatch, attempt ended after: inline error, address belongs to a different sign-in attempt
Busy callback port before: waits forever, manual entry collapsed after: paste field visible with port-in-use reason
Device code expired (real, 15 min) before: timed out with FAQ link, Close only after: code expired, Start sign-in again
Network drop at token exchange before: token exchange error fetch failed with VPS notes after: connection failed, Start sign-in again
invalid_grant (real Google) before: Google rejected this sign-in, X only after: same reason with Start sign-in again
Saved sign-in rejected later (chat) before: run openclaw configure, banner says Set up a model after: send /login gemini, banner offers Open Models
Paste success after three bad pastes (same attempt; ends on the known profile collision, see follow-ups) — after: same attempt reaches the save step

Local review: a ClawSweeper local review of the PR head found the patch correct, with 0 findings.

Follow-ups (not in this PR):

  • One shared device-code poller for providers that poll their own device codes.
  • A core chat text step, so chat sign-ins do not need provider-specific text.
  • Three chat-reachable diagnostics still use CLI wording: the provider auth recovery hint used by embedded-runner diagnostics, the failover re-auth command in fallback summaries, and the openclaw configure pattern in the failover user copy.
  • Start sign-in again in the waiting dialog, for the browser step.
  • The auth-profile collision on save is still an untyped error.
  • A few removal candidates were kept because their callers are unclear; they need a separate audit.

obviyus and others added 15 commits November 22, 2026 00:54
Folds 445eec06e0f5: ctx.nodes for provider sign-in through the Gateway.

Co-authored-by: obviyus <[email protected]>
ProviderAuthFailure { reason, recovery, providerDetail?, retryAfterMs? } with
core-owned recovery, exported from plugin-sdk/provider-auth. One paste parser in
the SDK (parseOAuthAuthorizationInput with expected state and sign-in page);
parseOAuthCallbackInput and the hex generateOAuthState alias are gone. Loopback
and Gateway-origin refusals keep the sign-in open. Wizard error results carry
the failure reason. One renderer per surface: CLI prints the login command,
chat says /login or Open Models, later turns render the refresh fence as a new
login with a Sign in button. Folds 95efffea64ec minus singleUse.

Co-authored-by: obviyus <[email protected]>
Folds f50bf78c24dc (pasted-address field) and ff4cf89eff2e (show only the
error), and drops the remaining sign-in note appends. A typed failure shows its
sentence and one action: Retry this step, Start sign-in again, Open settings,
or wait/admin text.

Co-authored-by: obviyus <[email protected]>
Folds 02e1463f74ff core parts: pickAuthMethod owns id, label and the shipped
--device-code alias (auth-method-pick.ts is gone). Removes unreachable and
single-use auth.ts paths, the test-only providerConfigNormalizer hook, the
platform split file and duplicate default-model and env-var lookups.

Co-authored-by: obviyus <[email protected]>
The chat sign-in flow no longer rechecks owner authority before every message,
URL, device code and write; cancellation still stops delivery. Removes the
runLoginFlow test hook and the re-validation of its own typed result. The chat
renderer keeps the provider's reason.

Co-authored-by: obviyus <[email protected]>
Folds 02e1463f74ff OpenAI/xAI/Codex parts (merged device-code choices, 404
fallback). OpenAI and xAI throw ProviderAuthFailure; the error rewriter, double
prints and catch-block notes are gone; device code exchanges through the token
runtime; the plugin TLS probe is gone (core doctor owns it).

Co-authored-by: obviyus <[email protected]>
Chutes, OpenRouter, MS Teams, Google Meet, Copilot, MiniMax, Radius and
Anthropic use the SDK paste parser and throw ProviderAuthFailure. Copilot no
longer reports a denied or expired code as success. OpenRouter's private parser
and loopback are gone.

Co-authored-by: obviyus <[email protected]>
A browser refusal at the loopback or Gateway-origin callback kept the sign-in
open but the Control UI never said why. The refusal (and a busy callback port
before the paste fallback) now reaches the open step with its typed reason:
the waiting dialog shows it with Reopen browser tab as the primary action, and
the paste dialog shows it under the field.

Co-authored-by: obviyus <[email protected]>
The login recovery hint carried literal markdown (**Sign in**) that error
surfaces show verbatim, the Control UI turn notice had no cause and so no
action, and the composer banner pointed at /models, /help and model setup.
The hint is plain text, the lifecycle terminal names the provider and an auth
failure so the notice offers Open Models, and the auth-failed banner offers
the same action.

Co-authored-by: obviyus <[email protected]>
Codex app-server auth errors, the Codex Hosted Search setup note, the spark
unknown-model hint, the sign-in scope note shown by chat /login, the saved
profile collision error, the account-link input error, the auth-profile
failover chat reply and the default loopback success page named CLI commands
or a terminal that Control UI and chat users do not have.

Co-authored-by: obviyus <[email protected]>
…covery

OpenClaw-Publication: edd9445b-4d05-87be-ad06-889408f1ae7e
@clawsweeper

clawsweeper Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation channel: msteams Channel integration: msteams channel: telegram Channel integration: telegram app: web-ui App: web-ui gateway Gateway runtime commands Command implementations agents Agent runtime and tooling extensions: openai extensions: minimax extensions: codex extensions: lmstudio plugin: google-meet extensions: chutes extensions: github-copilot labels Nov 22, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 22, 2026
@clawsweeper

clawsweeper Bot commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

What this changes

This PR centralizes provider sign-in failures and pasted callbacks, adds recovery actions, and combines OpenAI Codex sign-in methods.

Example: A user denies Google consent while signing in from Models.

  • Before: The attempt ends and tells the user to retry /login.
  • After: The attempt remains open, explains the denial, and offers Reopen browser tab.

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) Useful and approved behavior has real UI evidence, but affected consumer tests and enforced gates fail, and upgrade validation remains incomplete.
Proof confidence 🦪 silver shellfish (2/6) Real behavior proof is not required for maintainer- or bot-authored pull requests.
Patch quality 🦪 silver shellfish (2/6) 5 actionable review findings remain.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Failed provider sign-ins give inconsistent causes and recovery instructions, including terminal commands on graphical and chat surfaces.
Reason: The recovery improvements address demonstrated user confusion, and the maintainer has approved the SDK expansion and consolidated sign-in direction.

Merge readiness

⛔ Needs changes before merge - 5 items remain

Keep this PR open: the maintainer-approved recovery improvements are useful, but patch-caused test and validation failures need repair before merge.

Priority: P2
Reviewed head: 79b6898fc4e6f2213c2b28ca4aeb2a582f037e95

Before merge

  • Preserve the moved platform predicate in the catalog test mock (P2) - Moving this import into provider-auth-choices.js breaks provider-install-catalog.test.ts, whose module mock exports only resolveManifestProviderAuthChoices. Exact-head CI fails when resolving external provider catalog entries because isProviderAuthChoicePlatformSupported is missing. Update the affected mock to preserve the real exports while overriding its manifest resolver.
  • Update the account-link test for the new recovery message (P2) - The changed missing-profile response intentionally removes the terminal command, but users-auth-connect.control-plane.test.ts:339 still requires that command. Exact-head CI therefore fails the existing failed-attachment scenario. Update this consumer to assert the new sign-in-before-linking guidance while retaining its no-mutation and no-cancellation assertions.
  • Keep Telegram test doubles on the public SDK boundary (P2) - The new relative core mock violates the enforced extension-test boundary and causes lint:plugins:no-extension-test-core-imports to fail. The same private core dependency was added to bot.create-telegram-bot.test.ts:1820 and the support module's importActual. Mock the public provider-auth SDK boundary for Telegram tests and retain core composition coverage in the core-owned suite, without restoring a test-only production hook.
  • Bring the sign-in styles within the enforced CSS budget (P2) - The added paste styles increase built CSS from 1779150 to 1779614 bytes in the check's base/candidate comparison. Because the base already exceeds its ceiling, only 64 bytes of variance are permitted; this patch adds 464 bytes and fails control-ui-performance. Reduce or consolidate the changed styles sufficiently to pass the existing gate without increasing its baseline.
  • Resolve the added tests' enforced line-budget failure (P2) - Using the ratchet's exact path patterns, the introduced diff adds 565 net test lines against a 400-line allowance and changes no allocation record. This accounts for the test-lines failure reported by exact-head CI. Consolidate redundant coverage, including the helper-only matrix assertions, or add the repository-permitted justified allocation for the retained excess.

Findings

  • [P2] Preserve the moved platform predicate in the catalog test mock — src/plugins/provider-install-catalog.ts:20-24
  • [P2] Update the account-link test for the new recovery message — src/gateway/model-account-connect.ts:133
  • [P2] Keep Telegram test doubles on the public SDK boundary — extensions/telegram/src/bot-native-commands.menu-test-support.ts:75-79

Tests

  • Low-value test src/plugins/provider-auth-failure.matrix.test.ts: Remove the 'Control UI picks one core-owned action' group: it checks a copied reason-to-enum table without rendering or invoking a UI action, so it passes even if the recovery controls are broken.
  • Missing end-to-end proof: Supply a latest-stable upgrade run showing that existing account/model selections remain intact and the retired OpenAI/xAI choice aliases still start sign-in; redact credentials and private endpoints.
Agent review details

How this fits together

Provider plugins perform authentication; shared SDK and Gateway owners validate callbacks and carry failure reasons to Control UI, chat, and CLI renderers.

flowchart LR
  A[Control UI chat or CLI] --> B[Gateway sign-in admission]
  B --> C[Provider authentication plugin]
  C --> D[OAuth provider]
  D --> E[Shared callback and paste validation]
  E --> F[Typed failure or credentials]
  F --> A
Loading

Technical review

Best possible solution:

Retain the shared failure and parser owners, repair the affected consumer tests and validation gates, and verify the approved sign-in changes across an upgrade.

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

Current-main failure renderers and callback settlement establish the reported behavior, and supplied before/after screenshots demonstrate the consent-denial case without a reviewer-run reproduction.

Is this the best way to solve the issue?

Shared failure classification, callback parsing, and surface-specific rendering fit the existing owners; the approved direction should remain while consumer tests and enforced gates are repaired.

Full review comments:

  • [P2] Preserve the moved platform predicate in the catalog test mock — src/plugins/provider-install-catalog.ts:20-24
    Moving this import into provider-auth-choices.js breaks provider-install-catalog.test.ts, whose module mock exports only resolveManifestProviderAuthChoices. Exact-head CI fails when resolving external provider catalog entries because isProviderAuthChoicePlatformSupported is missing. Update the affected mock to preserve the real exports while overriding its manifest resolver.
    Confidence: 1
  • [P2] Update the account-link test for the new recovery message — src/gateway/model-account-connect.ts:133
    The changed missing-profile response intentionally removes the terminal command, but users-auth-connect.control-plane.test.ts:339 still requires that command. Exact-head CI therefore fails the existing failed-attachment scenario. Update this consumer to assert the new sign-in-before-linking guidance while retaining its no-mutation and no-cancellation assertions.
    Confidence: 1
  • [P2] Keep Telegram test doubles on the public SDK boundary — extensions/telegram/src/bot-native-commands.menu-test-support.ts:75-79
    The new relative core mock violates the enforced extension-test boundary and causes lint:plugins:no-extension-test-core-imports to fail. The same private core dependency was added to bot.create-telegram-bot.test.ts:1820 and the support module's importActual. Mock the public provider-auth SDK boundary for Telegram tests and retain core composition coverage in the core-owned suite, without restoring a test-only production hook.
    Confidence: 1
  • [P2] Bring the sign-in styles within the enforced CSS budget — ui/src/styles/wizard-sign-in.css:103-108
    The added paste styles increase built CSS from 1779150 to 1779614 bytes in the check's base/candidate comparison. Because the base already exceeds its ceiling, only 64 bytes of variance are permitted; this patch adds 464 bytes and fails control-ui-performance. Reduce or consolidate the changed styles sufficiently to pass the existing gate without increasing its baseline.
    Confidence: 0.99
  • [P2] Resolve the added tests' enforced line-budget failure — src/plugins/provider-auth-failure.matrix.test.ts:188-196
    Using the ratchet's exact path patterns, the introduced diff adds 565 net test lines against a 400-line allowance and changes no allocation record. This accounts for the test-lines failure reported by exact-head CI. Consolidate redundant coverage, including the helper-only matrix assertions, or add the repository-permitted justified allocation for the retained excess.
    Confidence: 0.99

Overall correctness: patch is incorrect
Overall confidence: 0.96

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against a28f2117181c.

Provenance checked

Testing

Proof path: shipped entry point.

Security

None.

Evidence

Acceptance criteria:

  • pnpm test src/plugins/provider-install-catalog.test.ts --maxWorkers=1
  • pnpm test src/gateway/server-methods/users-auth-connect.control-plane.test.ts --maxWorkers=1
  • pnpm lint:plugins:no-extension-test-core-imports
  • pnpm test:extension telegram
  • pnpm ui:i18n:verify

What I checked:

Likely related people:

  • Ayaan Zaidi: Raw commit 3b7b4be adds src/auto-reply/provider-login-recovery.ts:36 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 3b7b4be13b84; files: src/auto-reply/provider-login-recovery.ts)

PR surface

PR surface statistics unavailable: the file list is incomplete.

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Review metrics

Metric Value Why it matters
Production versus test changes Production +1689/-1849; tests and support +1769/-1217 The introduced diff reduces production by 160 lines and grows tests/support by 552; distinct recovery coverage is useful, but the helper-only matrix includes redundant assertions.

Labels

Label changes:

  • add P2: Provider sign-in recovery has clear user value, with focused repairs needed before merge and no demonstrated emergency regression.
  • add merge-risk: 🚨 compatibility: The PR expands provider-auth SDK contracts and changes sign-in defaults; the maintainer explicitly approved that direction and the patch retains shipped choice aliases.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🦪 silver shellfish.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Label justifications:

  • P2: Provider sign-in recovery has clear user value, with focused repairs needed before merge and no demonstrated emergency regression.
  • merge-risk: 🚨 compatibility: The PR expands provider-auth SDK contracts and changes sign-in defaults; the maintainer explicitly approved that direction and the patch retains shipped choice aliases.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🦪 silver shellfish.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed November 21, 2026, 10:30 PM ET / November 22, 2026, 03:30 UTC.

obviyus and others added 6 commits November 22, 2026 09:38
- Keep the chat sign-in runLoginFlow seam so Telegram tests stay on the public SDK.
- Narrow the Chutes token-exchange catch, document the one failure-shape assertion.
- Paste sign-in reuses the shared row/stack layout; only a compact badge is new CSS.
- Update stale tests and ratchet baselines; drop the matrix group that asserted a
  helper instead of the Control UI; record the measured test-line growth.

Co-authored-by: obviyus <[email protected]>
OpenClaw-Publication: 67abf2b0-86d7-8d0b-9f88-352402c04c22
OpenClaw-Publication: 15729543-6d65-8fc1-81af-7ab9757e5657
@obviyus
obviyus merged commit a30bdf3 into main Nov 22, 2026
168 checks passed
@obviyus
obviyus deleted the openclaw/tender-barnacle-f1d158 branch November 22, 2026 06:24
@obviyus

obviyus commented Nov 22, 2026

Copy link
Copy Markdown
Collaborator Author

Landed as a30bdf3. Provider sign-in failures now have one core owner: a typed reason, one recovery action per surface, and one shared paste parser. Recoverable mistakes keep the attempt open, and Control UI and chat no longer show CLI commands. Proof: the 31-case failure matrix fails on main and passes here, CI is green, the local ClawSweeper review is clean, and the before/after screenshots are above.

ArcueidMP added a commit to ArcueidMP/openclaw that referenced this pull request Nov 22, 2026
Merge upstream main after openclaw#203394. Keep provider recovery messages and Gateway node access in the shared sign-in flow while the local TUI retains prompt cancellation and credential refresh.
obviyus added a commit that referenced this pull request Nov 22, 2026
## What Problem This Solves

A user signs in to a provider (for example "Sign in with Google (Gemini)") from Models in the Control UI on a phone or a laptop. The dialog asks them to approve access in the browser and paste back the address of the page it opened. While they are on the provider's page, the Control UI socket drops, or the phone discards and reloads the tab. When they come back, the dialog is gone and they must start the sign-in again. On a phone this happens almost every time, so remote Gateways (VPS, Docker, phone) could not finish a provider sign-in.

This is older than #203394: the same repro fails on `15e5f7596fac` (the parent of #203394) and on current `main`. `models.authLogin` has closed its sign-in when the starting socket closes since #171526 / #183777.

## User Impact

User impact: leaving the Control UI tab during a provider sign-in no longer loses it. After a reconnect, the same step comes back with the address the user already typed. After a reload in the same browser, the same sign-in dialog reopens (the paste field is empty again: the one-time code is not stored in the browser). Pasting the address then finishes the sign-in as before.

- If the Gateway no longer has the sign-in (Gateway restart, 25-minute timeout, or a newer sign-in replaced it), the reopened dialog says "This sign-in session ended" instead of disappearing.
- A sign-in nobody watches no longer blocks other setup: a new sign-in from the same user or device replaces it, and so does anyone's once every connection that showed it is gone. While someone is still on the sign-in (including after a resume), another user's start stays "already in progress", as today.
- Known and out of scope: MCP server sign-in (`mcp.authLogin`) and runtime setup still end when their socket closes.

## Why This Change Was Made

One owner on each side, no new store, timer or config:

- **Gateway:** `models.authLogin` now uses the same session contract as first-run provider sign-in (`openclaw.setup.auth.start`): the session outlives its socket and is reached again by its session id; the starter's retained grant still stops it when the device is revoked or downgraded. The existing per-owner replacement for provider sign-in now also covers `models.authLogin`, and it replaces a predecessor only when every connection that started or read it (`wizard.next`/`status`/`cancel`) is closed, so an abandoned tab cannot hold setup admission for 25 minutes. It no longer requires the replacement to use the same provider/agent/workspace: a user who starts another sign-in has abandoned the first one.
- **Control UI:** the Models login suspends its wizard when the socket drops and resumes the same session on reconnect (same agent and recovery scope only), using the runner's existing `suspend`/`resume`. The typed value follows the model-setup draft rule, which keeps it through the reconnect. The existing activation record (`openclaw.modelSetup.pendingActivation.v1`, HMAC-bound to this browser's device key and credentials) now also records a Models sign-in, and a reloaded Models page reopens it with `restore`/`resume`. First-run setup ignores these records. The sign-in's choice, mode and recovery move into one sibling module (`login-sign-in.ts`); `login-controller.ts` stays at its line cap. A reopened sign-in also takes precedence over a provider picker the page's `?connect=1` route opened.

## Evidence

Base side (reproduction, before the change): scratch Gateway on the same commit as this PR's base and on `15e5f7596fac`, remote (tailnet) Control UI in headless mobile Chromium, Gemini OAuth plugin, Google sign-in page blocked:

| Scenario | `15e5f7596fac` (before #203394) | `main` base | This PR |
|---|---|---|---|
| Start sign-in, type the address, go offline 25 s, come back | no dialog | no dialog | same step, typed address kept |
| Start sign-in, type the address, reload the page | provider picker, no paste field | provider picker, no paste field | same dialog, paste field shown |
| After reconnect, paste an address with a made-up code | n/a | n/a | "Google rejected this sign-in (invalid_grant)": the resumed step reached the plugin and Google |

| | Before (`main`) | After (this PR) |
|---|---|---|
| Socket drops, user comes back | ![before offline](./before-offline.png) | ![after offline](./after-offline.png) |
| Page reloads | ![before reload](./before-reload.png) | ![after reload](./after-reload.png) |

After the reconnect, a made-up code reaches Google: ![invalid_grant after resume](./after-invalid-grant.png)

Regression tests:

- `src/gateway/server-methods/models-auth-login.test.ts` (red on base: 4 failed): the sign-in survives its socket, the returning operator reads the same step on a new socket, another owner stays busy while a returning connection (or any other reader, such as a second tab) is still open and replaces it once all are gone, and browser sign-in still stops on cancel.
- `ui/src/e2e/model-provider-login-recovery.e2e.test.ts` (reload cases red on base): Models page with a mocked Gateway; reload of `?connect=1` reopens the step on the same session instead of the picker; a socket drop during the reloaded page's restore still reopens the sign-in after reconnect; a reload that finds no session says the sign-in ended, once (the next reload shows the picker); a reconnect keeps the step and typed address on the same session without a new start or a cancel (this one also passes on base: the base UI already rereads after a quick reconnect, and the base failure was the Gateway closing the session).
- `ui/src/e2e/provider-browser-login-leave.real-gateway.e2e.test.ts`: real Gateway with a browser-callback provider fixture; start sign-in → socket drops → reconnect → approve → "ready"; and start → reload → approve → "ready". Green here; on the base build checkout its fixture never reached the login form, so its base side is covered by the live runs above instead.

Removed tests that asserted the removed behavior: `models.authLogin` closing on disconnect, and same-owner sign-ins staying busy when the provider, agent, workspace, model target or native catalog setting differs.

Review: local ClawSweeper round 1 found that a reload's restore deferred by a transient config or connection failure never retried; fixed in this head (it retries on the next connection or config change) with the socket-drop test above, red when the retry is removed. Round 2 found that a resumed sign-in could be replaced by another owner because only the starting socket counted; every open reader now counts (a later check found that a second tab's drop must not count as abandonment), with the Gateway test above.

Not covered locally: the SQLite worker ratchet in `pnpm check:changed` runs out of heap on this host (it scans all source files; this change touches no database code). The other changed-lane checks pass. `model-providers-page.usage.test.ts` fails intermittently in the batched Models UI run: 2/5 runs on this branch and 3/5 on the base, same files.

## Merge danger

Two-way door: a revert restores close-on-disconnect. No config, schema, protocol or stored Gateway state changes. The browser activation record keeps its format and gains one record kind.

Blast radius if wrong: provider sign-in from Models and Model setup (a sign-in could be resumed by the wrong tab, or a new sign-in could replace another user's abandoned one), and first-run activation recovery that shares the record.

Co-authored-by: Ayaan Zaidi <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 23, 2026
…covery (openclaw#203394)

## What Problem This Solves

Fixes: provider sign-in failures end the attempt with the wrong reason, raw provider errors, or a terminal command, when consent is denied, a wrong or unrelated address is pasted, the callback port is busy, a device code expires or is denied, the network drops during the token exchange, or a saved sign-in is rejected later.

Each provider plugin, the Control UI wizard, the chat `/login` flow and the CLI decided and worded these failures separately. The same failure looked different on every surface, and most of them told Control UI and chat users to run a CLI command.

## User Impact

User impact: a failed sign-in now names the cause in one plain sentence and offers one recovery action on every surface.

- **Recoverable mistakes keep the attempt open.** Consent denied (Gateway-origin and loopback callbacks), a wrong-state paste, a pasted sign-in page and a pasted `error=` redirect show the reason under the field. The user fixes it without starting over.
- **Terminal failures offer Start sign-in again.** Code expired, code denied, network failure and `invalid_grant` end with Close and **Start sign-in again**, instead of only Close.
- **Paste is visible by default.** The paste field is open when the browser step starts. A busy callback port says so (`The sign-in callback could not start because its port is in use.`).
- **OpenAI Codex login is one method.** It starts with a device code (works on local and remote Gateways). When the device-code endpoint is not available (404), it falls back to browser sign-in by itself, instead of failing with "use ChatGPT OAuth instead". This replaces the separate browser-first and device-code choices.
- **No terminal commands in Control UI or chat text.** The CLI keeps its own renderer, which prints `openclaw models auth login …`.
- **A rejected saved sign-in has one recovery in chat.** The reply says to send `/login <provider>`, and the composer banner offers **Open Models** instead of contradicting it.

Compatibility:

- Retired auth choice ids still resolve through `deprecatedChoiceIds`: `openai-device-code` (shipped in v2026.5.12) and `xai-device-code` (shipped in v2026.5.19). The `--device-code` and `--method` CLI flags are kept.
- The Plugin SDK changes are additive only (see Evidence). The deprecated `OAuthAuthorizationInput` type is kept.
- The Gateway wizard protocol gets one optional `reason` field on a step and on an error result. Older clients ignore it, because wizard results are not validated on the client. A newer CLI against an older Gateway gets no `reason` and prints the plain message, as before.

## Why This Change Was Made

One owner now decides sign-in failures:

- `ProviderAuthFailure` carries a typed reason. Its recovery (`retry`, `wait`, `admin`) is derived from the reason in one place.
- Provider plugins throw typed failures instead of formatting their own text.
- The wizard session carries the reason to clients on progress updates and on the terminal result. The Control UI and chat render it with the one recovery action, and the CLI renders it with its command.
- One shared SDK parser validates pasted callback addresses for every provider, so state checks and the error messages are the same everywhere.
- Gateway provider sign-in gets `ctx.nodes` for paired-node access, so plugins do not reach into core internals.
- `/login` authority is checked once, when the flow starts.

Production code in the sign-in scope is smaller than on `main` (−305 lines). The superseded per-plugin failure formatting, the separate OpenAI authorization and preflight runtimes, MiniMax's own OAuth runtime and the duplicate auth-method matchers are removed.

Danger: two-way door. A revert restores the previous text and flows. No stored state, config or schema changes. The blast radius is provider sign-in in the Control UI, chat `/login` and the CLI, for the bundled providers that sign in (OpenAI, Codex, xAI, OpenRouter, Chutes, LM Studio, MiniMax, GitHub Copilot) and for external plugins that use the provider-auth SDK, such as Gemini.

## Evidence

**Failure matrix** (`src/plugins/provider-auth-failure.matrix.test.ts`, 31 cases: each failure × surface, plus refusal and paste cases): every case fails on `main` 8b61bc2 and passes on this branch. (The run on `main` had 39/39 failing; 8 of them were a helper-only group that was later removed, because the Control UI tests cover that path.)

**Gates at the PR head:**

- Tests: 87 in-scope test files across 22 Vitest shards pass, including the matrix.
- Type checks: `tsgo:core`, `tsgo:core:test`, `tsgo:extensions` and `tsgo:ui` pass.
- `ui:i18n:verify` and `protocol:check` pass. The protocol check includes the Swift and Kotlin contract checks.
- oxlint is clean.
- `ocx build --dts` and the packed release smoke (`scripts/release-check.ts`) pass.
- Test-line growth above the 400-line allowance (+161) is recorded in `config/test-lines-allocations/203394-provider-sign-in-failure-owner.txt`: the matrix replaces per-plugin failure-text tests that this PR deletes.
- The paste layout reuses the shared `.row`/`.stack` layout. The only new CSS is one compact-badge rule, within the Control UI CSS budget.

**Line counts in the sign-in scope** (physical lines):

| Class | main | this PR | Change |
|---|---|---|---|
| Production | 18093 | 17788 | **−305** |
| Tests | 17250 | 17647 | +397 |

**Plugin SDK API diff** (no entrypoint added or removed, no export removed). The declared additions are:

- `ProviderAuthFailure`, plus its reason and recovery types.
- `ctx.nodes` on the Gateway provider sign-in context (approved by the maintainer).
- The shared paste parser for callback addresses.
- An optional `reason` on `WizardProgress.update(message, reason?)`, `WizardSession.pushProgress` and the local OAuth callback `onProgress`. This optional parameter is why the diff tool marks 50 more exports that reach `WizardPrompter` as affected.

**CLI commands in sign-in text.** All 35 earlier hits are classified:

- Fixed (reaches the Control UI or chat), with the surface-neutral text now used:
  - the Codex auth bridge and the web-search setup note
  - the OpenAI unknown-model hint
  - the chat `/login` opener scope note
  - the Control UI save error for a profile that is already in use
  - the loopback callback page ("Return to the terminal")
  - the account-link RPC error
  - the auth-profile failover chat reply
  - the LM Studio key error
  - the shared `agentDir` config error
- Kept, because they are CLI-only: doctor, onboarding, the TUI, CLI usage errors, the llama-cpp CLI setup and the CLI renderer.

**Telegram `/login openai`, code denied** (real Telegram Test Server, stub device-code provider):

- Before: `OpenAI login did not complete. Send /login openai/openai-device-code to try again.`, plus a separate "OAuth help" FAQ message, which was then edited.
- After: `OpenAI: The sign-in code was denied. Send /login openai/openai to try again.` The FAQ message is gone.

**Control UI, before (main) and after (this PR).** Captured on scratch Gateways with the real Gemini and OpenAI plugins.

- Real provider endpoints were used for the expired device code (`auth.openai.com`, 15 minutes) and for `invalid_grant` (Google).
- Consent redirects were simulated on the real callback URL.
- Network drops and denials were stubbed through a proxy.

No tokens, emails, real codes or live state appear in the images. Visible codes and state values are synthetic.

| Case | Before | After |
|---|---|---|
| Consent denied (Gemini, Gateway callback) | ![before: Provider sign-in was declined, attempt ended](https://github.com/user-attachments/assets/95f71861-49d9-48de-be55-d50b028dfde3) | ![after: attempt stays open with the reason and Reopen browser tab](https://github.com/user-attachments/assets/dd25b0da-a432-4b8b-a422-cd52b65037ac) |
| Consent denied, callback page | ![before: Sign-in was not completed](https://github.com/user-attachments/assets/2d10059d-b0c1-4169-848e-fa86229da478) | ![after: Sign-in was not allowed, go back and allow access](https://github.com/user-attachments/assets/68a8648d-af72-4b2f-b77c-62a379470ad3) |
| Consent denied (OpenAI loopback) | ![before: OpenAI authorization was not completed with VPS notes](https://github.com/user-attachments/assets/fb10aadd-236c-43f1-8b28-35a4f2c996f2) | ![after: paste field stays open with the reason](https://github.com/user-attachments/assets/f22925df-2136-4200-bd77-4b6b1aa4adbb) |
| Wrong-state paste | ![before: callback_validation_failed State mismatch, attempt ended](https://github.com/user-attachments/assets/a3e0d749-ca92-438e-bc61-cfc42c95b0ae) | ![after: inline error, address belongs to a different sign-in attempt](https://github.com/user-attachments/assets/78b4b7d5-5fed-4bef-9ef1-f2d7a8073fd5) |
| Busy callback port | ![before: waits forever, manual entry collapsed](https://github.com/user-attachments/assets/a029f016-0294-4cde-a2cc-e1fb8a8ad718) | ![after: paste field visible with port-in-use reason](https://github.com/user-attachments/assets/893bd1f8-d0f5-4971-9714-5eb951a5fe85) |
| Device code expired (real, 15 min) | ![before: timed out with FAQ link, Close only](https://github.com/user-attachments/assets/cf394fb2-90bc-4c14-93fb-87edef9c7ac9) | ![after: code expired, Start sign-in again](https://github.com/user-attachments/assets/39cf03d9-d53a-486e-973b-9596fed4eb23) |
| Network drop at token exchange | ![before: token exchange error fetch failed with VPS notes](https://github.com/user-attachments/assets/b76d7ba2-94d4-4604-9899-589759bcf41b) | ![after: connection failed, Start sign-in again](https://github.com/user-attachments/assets/682d3c5e-9be1-4ceb-8d4b-e53f839e3071) |
| `invalid_grant` (real Google) | ![before: Google rejected this sign-in, X only](https://github.com/user-attachments/assets/7b00cf0d-fd95-4d26-a67b-fc97d1d43040) | ![after: same reason with Start sign-in again](https://github.com/user-attachments/assets/5ef1f16e-a290-4ab6-8455-b097faaa88fe) |
| Saved sign-in rejected later (chat) | ![before: run openclaw configure, banner says Set up a model](https://github.com/user-attachments/assets/10a83196-2f06-411f-aec4-99aa5827e3ba) | ![after: send /login gemini, banner offers Open Models](https://github.com/user-attachments/assets/586b33d4-ff94-4410-b03d-f428e5b3d057) |
| Paste success after three bad pastes (same attempt; ends on the known profile collision, see follow-ups) | — | ![after: same attempt reaches the save step](https://github.com/user-attachments/assets/54b997ac-42b4-428c-8789-2d8e3d36f46a) |

**Local review:** a ClawSweeper local review of the PR head found the patch correct, with 0 findings.

**Follow-ups (not in this PR):**

- One shared device-code poller for providers that poll their own device codes.
- A core chat text step, so chat sign-ins do not need provider-specific text.
- Three chat-reachable diagnostics still use CLI wording: the provider auth recovery hint used by embedded-runner diagnostics, the failover re-auth command in fallback summaries, and the `openclaw configure` pattern in the failover user copy.
- **Start sign-in again** in the waiting dialog, for the browser step.
- The auth-profile collision on save is still an untyped error.
- A few removal candidates were kept because their callers are unclear; they need a separate audit.

Co-authored-by: Ayaan Zaidi <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 23, 2026
…law#203478)

## What Problem This Solves

A user signs in to a provider (for example "Sign in with Google (Gemini)") from Models in the Control UI on a phone or a laptop. The dialog asks them to approve access in the browser and paste back the address of the page it opened. While they are on the provider's page, the Control UI socket drops, or the phone discards and reloads the tab. When they come back, the dialog is gone and they must start the sign-in again. On a phone this happens almost every time, so remote Gateways (VPS, Docker, phone) could not finish a provider sign-in.

This is older than openclaw#203394: the same repro fails on `160a2ebf64d5` (the parent of openclaw#203394) and on current `main`. `models.authLogin` has closed its sign-in when the starting socket closes since openclaw#171526 / openclaw#183777.

## User Impact

User impact: leaving the Control UI tab during a provider sign-in no longer loses it. After a reconnect, the same step comes back with the address the user already typed. After a reload in the same browser, the same sign-in dialog reopens (the paste field is empty again: the one-time code is not stored in the browser). Pasting the address then finishes the sign-in as before.

- If the Gateway no longer has the sign-in (Gateway restart, 25-minute timeout, or a newer sign-in replaced it), the reopened dialog says "This sign-in session ended" instead of disappearing.
- A sign-in nobody watches no longer blocks other setup: a new sign-in from the same user or device replaces it, and so does anyone's once every connection that showed it is gone. While someone is still on the sign-in (including after a resume), another user's start stays "already in progress", as today.
- Known and out of scope: MCP server sign-in (`mcp.authLogin`) and runtime setup still end when their socket closes.

## Why This Change Was Made

One owner on each side, no new store, timer or config:

- **Gateway:** `models.authLogin` now uses the same session contract as first-run provider sign-in (`openclaw.setup.auth.start`): the session outlives its socket and is reached again by its session id; the starter's retained grant still stops it when the device is revoked or downgraded. The existing per-owner replacement for provider sign-in now also covers `models.authLogin`, and it replaces a predecessor only when every connection that started or read it (`wizard.next`/`status`/`cancel`) is closed, so an abandoned tab cannot hold setup admission for 25 minutes. It no longer requires the replacement to use the same provider/agent/workspace: a user who starts another sign-in has abandoned the first one.
- **Control UI:** the Models login suspends its wizard when the socket drops and resumes the same session on reconnect (same agent and recovery scope only), using the runner's existing `suspend`/`resume`. The typed value follows the model-setup draft rule, which keeps it through the reconnect. The existing activation record (`openclaw.modelSetup.pendingActivation.v1`, HMAC-bound to this browser's device key and credentials) now also records a Models sign-in, and a reloaded Models page reopens it with `restore`/`resume`. First-run setup ignores these records. The sign-in's choice, mode and recovery move into one sibling module (`login-sign-in.ts`); `login-controller.ts` stays at its line cap. A reopened sign-in also takes precedence over a provider picker the page's `?connect=1` route opened.

## Evidence

Base side (reproduction, before the change): scratch Gateway on the same commit as this PR's base and on `160a2ebf64d5`, remote (tailnet) Control UI in headless mobile Chromium, Gemini OAuth plugin, Google sign-in page blocked:

| Scenario | `160a2ebf64d5` (before openclaw#203394) | `main` base | This PR |
|---|---|---|---|
| Start sign-in, type the address, go offline 25 s, come back | no dialog | no dialog | same step, typed address kept |
| Start sign-in, type the address, reload the page | provider picker, no paste field | provider picker, no paste field | same dialog, paste field shown |
| After reconnect, paste an address with a made-up code | n/a | n/a | "Google rejected this sign-in (invalid_grant)": the resumed step reached the plugin and Google |

| | Before (`main`) | After (this PR) |
|---|---|---|
| Socket drops, user comes back | ![before offline](./before-offline.png) | ![after offline](./after-offline.png) |
| Page reloads | ![before reload](./before-reload.png) | ![after reload](./after-reload.png) |

After the reconnect, a made-up code reaches Google: ![invalid_grant after resume](./after-invalid-grant.png)

Regression tests:

- `src/gateway/server-methods/models-auth-login.test.ts` (red on base: 4 failed): the sign-in survives its socket, the returning operator reads the same step on a new socket, another owner stays busy while a returning connection (or any other reader, such as a second tab) is still open and replaces it once all are gone, and browser sign-in still stops on cancel.
- `ui/src/e2e/model-provider-login-recovery.e2e.test.ts` (reload cases red on base): Models page with a mocked Gateway; reload of `?connect=1` reopens the step on the same session instead of the picker; a socket drop during the reloaded page's restore still reopens the sign-in after reconnect; a reload that finds no session says the sign-in ended, once (the next reload shows the picker); a reconnect keeps the step and typed address on the same session without a new start or a cancel (this one also passes on base: the base UI already rereads after a quick reconnect, and the base failure was the Gateway closing the session).
- `ui/src/e2e/provider-browser-login-leave.real-gateway.e2e.test.ts`: real Gateway with a browser-callback provider fixture; start sign-in → socket drops → reconnect → approve → "ready"; and start → reload → approve → "ready". Green here; on the base build checkout its fixture never reached the login form, so its base side is covered by the live runs above instead.

Removed tests that asserted the removed behavior: `models.authLogin` closing on disconnect, and same-owner sign-ins staying busy when the provider, agent, workspace, model target or native catalog setting differs.

Review: local ClawSweeper round 1 found that a reload's restore deferred by a transient config or connection failure never retried; fixed in this head (it retries on the next connection or config change) with the socket-drop test above, red when the retry is removed. Round 2 found that a resumed sign-in could be replaced by another owner because only the starting socket counted; every open reader now counts (a later check found that a second tab's drop must not count as abandonment), with the Gateway test above.

Not covered locally: the SQLite worker ratchet in `pnpm check:changed` runs out of heap on this host (it scans all source files; this change touches no database code). The other changed-lane checks pass. `model-providers-page.usage.test.ts` fails intermittently in the batched Models UI run: 2/5 runs on this branch and 3/5 on the base, same files.

## Merge danger

Two-way door: a revert restores close-on-disconnect. No config, schema, protocol or stored Gateway state changes. The browser activation record keeps its format and gains one record kind.

Blast radius if wrong: provider sign-in from Models and Model setup (a sign-in could be resumed by the wrong tab, or a new sign-in could replace another user's abandoned one), and first-run activation recovery that shares the record.

Co-authored-by: Ayaan Zaidi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling app: web-ui App: web-ui channel: msteams Channel integration: msteams channel: telegram Channel integration: telegram commands Command implementations docs Improvements or additions to documentation extensions: chutes extensions: codex extensions: github-copilot extensions: lmstudio extensions: minimax extensions: openai extensions: openrouter extensions: radius extensions: xai gateway Gateway runtime merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. plugin: google-meet rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. security-sensitive-changed size: XL status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant