provider: moved Grok users get plugin 0.1.16, which keeps a sign-in with no email (llllleo9 on X)

llllleo9 couldn't add Grok: grok login --device-auth exited 0, and the
sign-in failed with "grok login finished without an account".

Grok Build 1.0.62 was run in a sandbox against a stand-in auth.x.ai. When
the id_token has no email claim (an account signed in through X), the CLI
writes "email": null, and plugin 0.1.15 refused a sign-in made beside an
already signed-in Grok Build. With GROK_AUTH_PATH set, the CLI kept the
sign-in elsewhere.

Plugin 0.1.16 (magpie-community/plugins 8cdf2d2) fixes both:
- the account is told by its email, else its xAI user id, else the
  token's sub;
- GROK_AUTH_PATH is left out of the login;
- a login that leaves nothing says which file it read and what was there.

npm view @magpie-community/opencode-grok-auth@0.1.16 --prefer-online
shows 0.1.16, which is latest, and its integrity matches the publish
run's. This commit raises the mover's min to 0.1.16, so keepMovedCurrent
updates moved users. The built-in's own Grok sign-in (runCLISignIn) has
no caller left, so the built-in is unchanged.

Run at this change, on origin/main ccb2eea15 plus this diff, macOS:
- gofmt -l: clean. go vet ./..., GOOS=linux go vet -tags nogui ./...,
  GOOS=windows go vet ./... and go build: clean.
- go test ./... -timeout 45m: internal/provider ok (1205s),
  internal/plugin ok (1244s), and 60 packages ok.
- Four packages were red with the machine at load average 195-235, while
  six other sessions ran benchmarks:
  - internal/agent timed out at 45m in TestCodexAgentsV1WarnsWhenCodexOwnV2IsOn;
  - internal/gateway timed out at 45m in TestPluginStreamLargeReplies
    (#2551);
  - internal/library timed out at 45m in TestSkillHow;
  - internal/gui failed TestSetAnswersWhileDevinAndProvidersHang
    (15.7s, #1375).
  None of the four reads the mover's min.
- A rerun of those four, at load average 420, had not finished a
  package after 30 minutes. It isn't a record of green.
- go test -count=1 -run 'Moved|Mover|Grok' ./internal/provider: ok.

Not tried with a real xAI account: whether xAI's token for llllleo9's
account lacks the email claim, and whether their Grok Build was already
signed in.
This commit is contained in:
yetone
2026-10-19 02:43:48 +08:00
parent 95ef45fda4
commit cc8e8e3bda
+1 -1
View File
@@ -97,7 +97,7 @@ func init() {
// names, as the built-in does: the homes stay where they are.
movers["grok"] = &mover{
pkg: "@magpie-community/opencode-grok-auth",
min: "0.1.15", // a Go key the Provider API refuses is taken as Go's and asked at /alpha/generate (#969); a failure's status and its sign-in mark as the built-in's; grok-4.7's reasoning levels; a token Grok refuses early reads as expired; the sign-in renewed ahead of time through auth.refresh; a 429 shows a spent Rate limit window until it lifts; a login with no link says why; a tool whose parameters are a root union goes as a plain object (#1271); a plain Codex agent_message (a subagent's task or reply) goes as the user's message, not refused with 422 "unknown item type", a sealed one as it came (plugins#61); a model Grok lists at two windows is offered at each, grok-4.7@500k sent with x-grok-context-window (plugins#83); a window offered without a k (grok-4.7@131072) goes as that window, not as a model named so (#1679); a sign-in without Grok Build names GROK_BIN_DIR (#2223)
min: "0.1.16", // a Go key the Provider API refuses is taken as Go's and asked at /alpha/generate (#969); a failure's status and its sign-in mark as the built-in's; grok-4.7's reasoning levels; a token Grok refuses early reads as expired; the sign-in renewed ahead of time through auth.refresh; a 429 shows a spent Rate limit window until it lifts; a login with no link says why; a tool whose parameters are a root union goes as a plain object (#1271); a plain Codex agent_message (a subagent's task or reply) goes as the user's message, not refused with 422 "unknown item type", a sealed one as it came (plugins#61); a model Grok lists at two windows is offered at each, grok-4.7@500k sent with x-grok-context-window (plugins#83); a window offered without a k (grok-4.7@131072) goes as that window, not as a model named so (#1679); a sign-in without Grok Build names GROK_BIN_DIR (#2223); a sign-in with no email (an X account) is kept by its xAI user id, GROK_AUTH_PATH no longer takes it elsewhere, and a login that leaves none says where it looked
agents: []string{"grok"},
out: func() ([]Moving, error) {
var out []Moving