From 45593cc1d6a4cb374980f822445fa693799e11ca Mon Sep 17 00:00:00 2001 From: yetone Date: Fri, 23 Oct 2026 03:15:12 +0800 Subject: [PATCH] provider: Grok's mover min is 0.2.1, which renews once on a 401 (plugins#324) plugins 92d5557 (grok 0.2.1, on npm: npm view --prefer-online answers 0.2.1) renews a sign-in once through Grok Build when a request, the model list or usage gets a 401, and retries once. A renewal that leaves the same token now says Grok Build couldn't renew it, with the CLI's last line, not that the sign-in expired; a half-written auth.json is read again and then falls back to the last good read. Maxwelltoo's report: 716 failed silent refreshes over a day, each surfaced as "sign-in has expired; run grok login". min 0.1.18 -> 0.2.1, so keepMovedCurrent brings every moved user up. The note drops "a token Grok refuses early reads as expired", which 0.2.1 no longer does. Run at 79856727f plus this change: go test -tags nogui ./internal/provider/ ok (92s), gofmt clean. Only this string changed, so no full suite. Not tried: a real Grok Build sign-in on 0.2.1; the plugin's own tests use a fake CLI. --- internal/provider/migrate_side.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/provider/migrate_side.go b/internal/provider/migrate_side.go index 9c05f4e6f..8ea2df1e4 100644 --- a/internal/provider/migrate_side.go +++ b/internal/provider/migrate_side.go @@ -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.18", // the sign-in page opens once, where Grok Build opened it and magpie again (andyfmyth on X); 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; a tool_choice with no tools beside it, which magpie hands the plugin as "none" when a client turned tools off (#3110), is left out before Grok + min: "0.2.1", // the sign-in page opens once, where Grok Build opened it and magpie again (andyfmyth on X); 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; 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; a tool_choice with no tools beside it, which magpie hands the plugin as "none" when a client turned tools off (#3110), is left out before Grok; a 401 renews once through Grok Build and retries, a renewal that leaves the same token says Grok Build couldn't renew it, not that the sign-in expired, and a half-written auth.json is read again (plugins#324) agents: []string{"grok"}, out: func() ([]Moving, error) { var out []Moving