@magpie-community/opencode-factory-auth 0.1.30 → 0.1.31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.mjs +10 -2
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -172,7 +172,8 @@ function configModels() {
172
172
  reasoning: m.efforts.length > 0,
173
173
  attachment: m.images,
174
174
  tool_call: true,
175
- temperature: true,
175
+ // OpenAI's reasoning models take no temperature (droidBody)
176
+ temperature: m.upstream !== "openai",
176
177
  modalities: { input: m.images ? ["text", "image"] : ["text"], output: ["text"] },
177
178
  cost: { input: 0, output: 0 },
178
179
  limit: { context: m.context, output: m.output },
@@ -474,11 +475,18 @@ function droidBody(path, body) {
474
475
  if (path.endsWith("/responses")) {
475
476
  const v = m.instructions
476
477
  if (v !== undefined && v !== null && typeof v !== "string") return body // not something droid sends
478
+ // OpenAI's reasoning models turn temperature and top_p away with a 400,
479
+ // and droid sends neither (Nowledge Mem on gpt-6.1-sol, magpie's Discord)
480
+ const sampled = byId.get(m.model)?.upstream === "openai" && ("temperature" in m || "top_p" in m)
481
+ if (sampled) {
482
+ delete m.temperature
483
+ delete m.top_p
484
+ }
477
485
  const opened = promptOpenings(m.input)
478
486
  const ins = promptText(v ?? "")
479
487
  if (!ins.startsWith(DROID_LINE)) m.instructions = ins.trim() === "" ? DROID_LINE : DROID_LINE + "\n" + ins
480
488
  else if (ins !== v || opened) m.instructions = ins
481
- else return body
489
+ else if (!sampled) return body
482
490
  } else if (path.endsWith("/chat/completions")) {
483
491
  if (!Array.isArray(m.messages)) return body
484
492
  const opened = promptOpenings(m.messages, true)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@magpie-community/opencode-factory-auth",
3
- "version": "0.1.30",
3
+ "version": "0.1.31",
4
4
  "description": "Sign in to a Factory (Droid) subscription from OpenCode or magpie",
5
5
  "type": "module",
6
6
  "main": "./index.mjs",