You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
OpenShell does not currently provide a first-class way for a NemoClaw/OpenClaw sandbox to use a user's Grok subscription (SuperGrok or X Premium) through xAI's supported OAuth flow while keeping the OAuth grant under gateway control.
Upstream OpenClaw already has a bundled xai provider. The recommended path is Grok OAuth with an eligible SuperGrok or X Premium subscription; an API key is the fallback. Gateway, config, routing, and tools stay local; only Grok requests go to xAI. See https://docs.openclaw.ai/providers/xai and https://x.ai/news/grok-openclaw.
That does not give OpenShell a sandbox-safe subscription path. Today the practical choices are incomplete:
sign in inside the sandbox or copy the OpenClaw/xAI auth profile, exposing usable OAuth material to the sandbox;
copy an existing host OpenClaw xai OAuth login into OpenShell, creating two owners of rotating credentials;
run a separate host OpenClaw gateway and point OpenShell's compatible-endpoint provider at it;
use an XAI_API_KEY or a local model instead of the user's Grok subscription.
This is the same class of gap as #2740 (Codex subscription OAuth). #2740 should stay Codex-only. This issue is the xAI sibling on the same #1306 substrate.
A current downstream test on NemoClaw v0.0.103, OpenShell 0.0.85, and OpenClaw 2026.7.1-2 can use OpenClaw's host-side xai OAuth, but an xAI/Grok login initiated from the sandbox is not a first-class OpenShell provider. Local OpenAI-compatible inference can remain healthy while subscription Grok is still missing as a sandbox inference path. This is an authentication/provider-integration gap rather than a general inference outage.
#988 proved provider-backed placeholders can work (Codex). #1306 provides the generic gateway-owned refresh foundation (oauth2_refresh_token) and already names ChatGPT/OpenAI OAuth-style integrations; it does not define an xAI/Grok subscription provider, login UX, endpoint policy, or NemoClaw/OpenClaw integration.
Proposed Design
Add a provider profile such as xai-grok-oauth with a user-facing alias such as grok-subscription.
Explicit, provider-owned login
A provider creation login option starts an attended xAI-supported Grok/SuperGrok or X Premium browser or device-code login (the same class of flow OpenClaw already uses for --provider xai --method oauth).
The resulting grant is created specifically for OpenShell and is owned by that provider instance.
Do not import or copy a live OpenClaw xai refresh token. An existing OpenClaw xAI login must remain independently usable.
Pin or strictly allow-list the supported HTTPS xAI origins and required route shapes (OpenClaw's bundled transport is the xAI Responses API).
Do not honor a generic provider base-URL override for this bearer credential.
If xAI does not publish a stable third-party integration contract for this grant, mark the provider experimental and centralize/version the compatibility boundary rather than spreading private constants through the codebase.
Fail-closed refresh and expiry
Refresh persistence must be version-matched and atomic across rotation, deletion, and reconfiguration.
Distinguish terminal grant rejection from retryable timeout, rate-limit, and server errors.
Enforce credential expiry during route resolution and in supervisor caches; an expired or reauth-required credential must be omitted and previously cached routes cleared.
Provide bounded status, re-login, logout, and revocation guidance without exposing credentials.
NemoClaw/OpenClaw UX
NemoClaw should be able to attach the provider to an OpenClaw sandbox and select a Grok-backed model without a separately managed host gateway.
OpenClaw should complete a normal tool-free response through inference.local, while the subscription credential remains gateway-side.
Optional follow-up, not this issue's first slice: the same gateway-owned grant may later back Grok web_search / x_search the way OpenClaw reuses one xAI credential. First slice is inference only.
The two providers should be proofed together as evidence that #1306 is a shared substrate, not a Codex one-off:
Create both provider instances (Codex subscription + Grok subscription) from attended logins.
Attach only Codex to sandbox A and only Grok to sandbox B. A cannot reach xAI; B cannot reach ChatGPT/Codex.
Logout/revoke of one grant leaves the other usable.
Existing Codex desktop/CLI login and existing OpenClaw xai OAuth login remain independently usable before and after OpenShell refresh.
No reusable credential from either grant appears in either sandbox.
This dual-proof is acceptance evidence. It is not a request to merge the two provider designs into one issue.
Acceptance Criteria
OpenShell creates a distinct gateway-owned xAI grant; an existing OpenClaw xai OAuth login continues working before and after OpenShell refresh.
No access token, refresh token, account token, or equivalent reusable credential appears in sandbox environment, filesystem, normal CLI output, diagnostics, or logs.
Sandbox A with this provider attached can use the Grok route; sandbox B without it is denied.
A hostile or custom base URL cannot receive the subscription bearer credential.
Refresh, delete-during-refresh, reconfigure-during-refresh, expiry, reauth-required, 408/429, and transient 5xx cases are covered.
Expired routes stop resolving even when a supervisor cannot refresh its bundle from the gateway.
E2E proof covers provider login, attachment, one OpenClaw response, credential rotation, and logout/revocation behavior.
The implementation does not remove unrelated provider-refresh or concurrency regression coverage.
Alternatives Considered
Copy the host OpenClaw xAI auth profile. Rejected: it exposes or duplicates reusable OAuth material and creates ambiguous refresh ownership.
Reuse the current OpenClaw xai OAuth login. Rejected: two independent refreshers can invalidate one another. This was the central failure mode identified in feat(providers): anthropic subscription oauth #2285.
Keep the host OpenClaw gateway bridge. It works for models OpenClaw already speaks, but requires another daemon, credential boundary, policy path, and timeout configuration.
Use an API key. Supported and appropriate for usage-based xAI API access, but it does not satisfy subscription-backed Grok access (SuperGrok / X Premium).
Use only local inference. Valid for offline/local deployments, but it does not address the requested cloud-provider capability.
Problem Statement
OpenShell does not currently provide a first-class way for a NemoClaw/OpenClaw sandbox to use a user's Grok subscription (SuperGrok or X Premium) through xAI's supported OAuth flow while keeping the OAuth grant under gateway control.
Upstream OpenClaw already has a bundled
xaiprovider. The recommended path is Grok OAuth with an eligible SuperGrok or X Premium subscription; an API key is the fallback. Gateway, config, routing, and tools stay local; only Grok requests go to xAI. See https://docs.openclaw.ai/providers/xai and https://x.ai/news/grok-openclaw.That does not give OpenShell a sandbox-safe subscription path. Today the practical choices are incomplete:
xaiOAuth login into OpenShell, creating two owners of rotating credentials;XAI_API_KEYor a local model instead of the user's Grok subscription.This is the same class of gap as #2740 (Codex subscription OAuth). #2740 should stay Codex-only. This issue is the xAI sibling on the same #1306 substrate.
A current downstream test on NemoClaw v0.0.103, OpenShell 0.0.85, and OpenClaw 2026.7.1-2 can use OpenClaw's host-side
xaiOAuth, but an xAI/Grok login initiated from the sandbox is not a first-class OpenShell provider. Local OpenAI-compatible inference can remain healthy while subscription Grok is still missing as a sandbox inference path. This is an authentication/provider-integration gap rather than a general inference outage.#988 proved provider-backed placeholders can work (Codex). #1306 provides the generic gateway-owned refresh foundation (
oauth2_refresh_token) and already names ChatGPT/OpenAI OAuth-style integrations; it does not define an xAI/Grok subscription provider, login UX, endpoint policy, or NemoClaw/OpenClaw integration.Proposed Design
Add a provider profile such as
xai-grok-oauthwith a user-facing alias such asgrok-subscription.Explicit, provider-owned login
--provider xai --method oauth).xairefresh token. An existing OpenClaw xAI login must remain independently usable.Gateway-only credential lifecycle
inference.localroute.Sandbox-scoped authorization
Endpoint-bound use
Fail-closed refresh and expiry
NemoClaw/OpenClaw UX
inference.local, while the subscription credential remains gateway-side.web_search/x_searchthe way OpenClaw reuses one xAI credential. First slice is inference only.Dual-proof with #2740
The two providers should be proofed together as evidence that #1306 is a shared substrate, not a Codex one-off:
xaiOAuth login remain independently usable before and after OpenShell refresh.This dual-proof is acceptance evidence. It is not a request to merge the two provider designs into one issue.
Acceptance Criteria
xaiOAuth login continues working before and after OpenShell refresh.Alternatives Considered
xaiOAuth login. Rejected: two independent refreshers can invalidate one another. This was the central failure mode identified in feat(providers): anthropic subscription oauth #2285.Agent Investigation
oauth2_refresh_token); first-pass strategies are Microsoft/Google, with ChatGPT/OpenAI OAuth-style integrations named as blocked use cases.@openclaw/xai-plugin/openclaw models auth login --provider xai --method oauth. OpenShell has noxai/grokprovider profile today (providers/hascodex.yamland no xAI equivalent).Checklist