Skip to content

/login has no xAI (Grok/X subscription) option — vendored packages/ai predates upstream's xAI OAuth #678

Description

@ethan-huo

Edited. The original report claimed the flow was already bundled and just
needed registering. That was wrong — it came from probing node_modules
instead of what actually runs. See the correction comment below; this body is
the accurate version.

With a SuperGrok / X Premium subscription there is no way to authenticate:
/login lists xAI as API-key only, which is a separately paid plan.

Version: prime-agent 0.7.0

Where the gap is

packages/ai/src/utils/oauth/ contains only:

anthropic.ts  github-copilot.ts  openai-codex.ts  index.ts  oauth-page.ts  pkce.ts  types.ts

and packages/ai/src/providers/ has no xai.ts — xAI exists purely as a model
catalog entry with env-key auth. Those three are exactly the three that show up
in the login picker, so the picker is faithfully reflecting the vendored tree.

Upstream has it

earendil-works/pi — the repo @earendil-works/pi-ai points at in its
repository field — carries the flow at packages/ai/src/auth/oauth/xai.ts,
and its packages/ai/src/providers/xai.ts mounts it the same way Anthropic and
Codex are mounted:

auth: {
    apiKey: envApiKeyAuth("xAI API key", ["XAI_API_KEY"]),
    oauth: lazyOAuth({
        name: "xAI (Grok/X subscription)",
        loginLabel: "Sign in with SuperGrok or X Premium",
        load: loadXaiOAuth,
    }),
},

Note the directory: upstream is src/auth/oauth/, the vendored copy is
src/utils/oauth/. These are two generations of the same tree, not a one-version
lag — upstream moved to a file-per-provider layout that carries auth.oauth
inline, and the vendored copy predates it.

can1357/oh-my-pi, another pi derivative, also ships this — as a distinct
xai-oauth provider sitting alongside the API-key xai one (/login xai-oauth).

Side observation

The published package declares @earendil-works/pi-ai as a tarball whose
package.json says 0.83.0 (upstream, has the xAI flow), while the bundle
that bin actually resolves to is built from the vendored 0.7.0 tree
(no xAI flow). If that split is deliberate, ignore this part — it just made the
first version of this report wrong.

Ask

Support xAI OAuth in /login. Whether that means porting the flow into the
vendored tree's architecture or reconciling the two trees is your call — I can't
judge that from outside.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions