provider: Grok's mover min is 0.2.6 (plugins#852)

opencode-grok-auth 0.2.6 (plugins ae5188363, lxyer) asks Grok again
when a Responses stream is cut before its first byte. It tries up to
three times, before the answer is returned, so a 429 or 401 on a retry
comes back as itself. Once a byte has arrived, the stream goes on as it
comes, reasoning included. A later cut just ends the stream, and magpie
closes it as a whole response.failed (29bfd5dc8, v0.1.3298). The
plugin no longer writes a response.created or response.failed of its
own: those frames had no sequence_number, and Grok Build failed the
turn on them. An upstream response.failed or error goes on as it came.

npm has 0.2.6: `npm view --prefer-online
@magpie-community/opencode-grok-auth time` gives
2026-11-08T04:50:00Z. The publish run's npm job is red only for
middleware-think-tags 0.1.2 (E404, plugins#180). grok 0.2.6 was
published in that run.

Run on mote at this tree: gofmt -l is clean; go vet
./internal/provider on darwin, linux nogui and windows; go test
./internal/provider: ok (119s).

The plugin's side was run at 463afb79 on mote. Its package tests: 107
pass. The repo-root bun test: 6878 pass, 0 fail. check.mjs grok: ok.
Breaking the retry by hand turned the tests red. The real chain was
Grok Build 1.0.67 and 1.0.77, then magpie eef99e4bb, then the plugin,
then a fake upstream that cuts before the first byte, after
response.created and after text. Every cut was read and retried, with
no "missing field". A retry's 429 reached magpie as a 429, and a vendor
response.failed showed its own message. The plugins merge body has the
details.

Not tried: a live Grok stream cut by the real vendor.
This commit is contained in:
yetone
2026-11-08 12:53:45 +08:00
parent eef99e4bbe
commit 5849b47ca0
+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.2.5", // a 401 that isn't Grok judging the token ("Authentication required", not "Invalid or expired credentials"), on a token Grok Build left as it was and not past its end, is a 503 with Retry-After that keeps the sign-in, not "add the account in magpie again", and a 401's wait on Grok Build's renewal is capped at 15s (plugins#818); 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); a Responses request asks for Grok Build's loop checks (x-grok-doom-loop-check 1024, x-grok-exact-repetition-check 64), so a reply that repeats itself is stopped after ~1K tokens instead of running to max output (#3594); Codex's include loses output.encrypted_content, which Grok refused with 400 "Argument not supported" (plugins#524); a tool_choice object of a type Grok's backend doesn't take, which magpie hands the plugin to read so it adds no x_search over an allowed_tools (#3153), is left out before Grok
min: "0.2.6", // a Responses stream cut before its first byte is asked again, up to three times, and a retry's 429 or 401 comes back as itself; a later cut is passed on to its end for magpie to close as a whole response.failed, with no frame of the plugin's own, and an upstream response.failed or error goes as it came (plugins#852); a 401 that isn't Grok judging the token ("Authentication required", not "Invalid or expired credentials"), on a token Grok Build left as it was and not past its end, is a 503 with Retry-After that keeps the sign-in, not "add the account in magpie again", and a 401's wait on Grok Build's renewal is capped at 15s (plugins#818); 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); a Responses request asks for Grok Build's loop checks (x-grok-doom-loop-check 1024, x-grok-exact-repetition-check 64), so a reply that repeats itself is stopped after ~1K tokens instead of running to max output (#3594); Codex's include loses output.encrypted_content, which Grok refused with 400 "Argument not supported" (plugins#524); a tool_choice object of a type Grok's backend doesn't take, which magpie hands the plugin to read so it adds no x_search over an allowed_tools (#3153), is left out before Grok
agents: []string{"grok"},
out: func() ([]Moving, error) {
var out []Moving