Files
plugins/packages/zed/package.json
T
yetoneandump45nose 3618bf9f22 zed 0.1.14: a Gemini model's effort variants are keyed lowercase, and its thinking level reaches Zed uppercase (#215)
Zed's cloud parses a Google request with its own serde enums (zed
crates/google_ai): ThinkingLevel is rename_all UPPERCASE (MINIMAL, LOW,
MEDIUM, HIGH) and FunctionCallingMode rename_all lowercase (auto, any,
none). A thinking budget reached it as thinkingLevel "low" and was
answered 400 "failed to parse Google AI request: unknown variant `low`,
expected one of `MINIMAL`, `LOW`, `MEDIUM`, `HIGH`" (iron-water, #215).

- The gemini wire in providerRequest() now goes through geminiEnums(),
  from ump45nose's #587: the thinking level is uppercased (an empty one
  left out) and the tool-calling mode lowercased, as 0.1.13 already did,
  with VALIDATED, which Zed has no variant for, asked as auto.
- Zed's /models now lists a Gemini model's supported_effort_levels
  uppercase (LOW/MEDIUM/HIGH; Yezike-yyy's Student-plan list on #215), so
  the variants were keyed LOW and carried thinkingLevel "LOW". magpie's pi
  profile, which maps efforts by key, matched none of them, and
  @ai-sdk/google (thinkingLevel z.enum minimal/low/medium/high) refuses
  an uppercase level. effortsOf() now lowercases the values whatever case
  /models writes, once each, so a variant keeps the AI SDK's lowercase
  spelling (the owner's review on #587) and only the wire is uppercase.
  This covers every vendor's efforts, not only Google's.
- _internal exports model() so the test checks provider.models' variants.

Tests: gemini-enums.test.mjs builds its model list from the
supported_effort_levels Yezike-yyy pasted on #215, byte for byte, and its
fake /completions refuses both enums with Zed's error text.

Run on mote at f4e2ac3 plus this change: packages/zed `bun test` 61 pass,
0 fail; root `HOME=$(mktemp -d) bun test` 4545 pass, 0 fail; `bun
scripts/check.mjs` ok. (A root run with a HOME outside tmpdir gives the
same 20 devin/isolated-home reds on origin/main as with this change.)
Broken by hand:
- origin/main's index.mjs under the new test: 7 of 7 fail;
- effortsOf without the lowercase: 4 fail;
- the wire level not uppercased: 2 fail;
- VALIDATED not mapped to auto: 1 fail.
Not tried: a live request to cloud.zed.dev and OpenCode with the real
@ai-sdk/google (no Zed account here). Yezike-yyy reports the same two
changes, patched into 0.1.13, answered 200 for low/medium/high on
zed/gemini-4-argon through magpie on Windows with pi.

Thanks to Yezike-yyy for the uppercase /models finding and its check
through pi.

Co-authored-by: ump45nose <52391318+ump45nose@users.noreply.github.com>
2026-11-01 23:44:10 +08:00

12 lines
479 B
JSON

{
"name": "@magpie-community/opencode-zed-auth",
"version": "0.1.14",
"description": "Sign in to a Zed subscription (Zed Pro, trial, student, business) from OpenCode or magpie",
"type": "module",
"main": "./index.mjs",
"files": ["index.mjs", "README.md"],
"keywords": ["opencode", "opencode-plugin", "magpie", "zed"],
"license": "MIT",
"repository": { "type": "git", "url": "git+https://github.com/magpie-community/plugins.git", "directory": "packages/zed" }
}