Repository navigation
feat(opencode): send muse-spark max effort first, fallback once to xhigh - #12687
Chewji9875 wants to merge 9 commits into
Conversation
… muse-spark-1.3+ models
… and reasoning effort for responses api
…igh on upstream 400 Upstream /responses rejects literal max for muse-spark (400 unsupported reasoning.effort); command-code already passes reasoning_effort through and accepts max natively. OpencodeExecutor now sends max verbatim and retries a single time with xhigh only on that 400 signature.
|
This is a well-designed feature — trying One thing to flag: this PR's registry changes for |
Resolves the opencode.ts conflict by combining this PR's max-first muse-spark fallback dispatch with the release's Responses first-byte stall guard (diegosouzapw#13484). Also de-duplicates the muse-spark-1.3-contributor registry entries the merge brought in twice: the release tip already landed the same base + effort-tier aliases in registry/opencode/{go, index,zen} (fix for diegosouzapw#12674); kept the release's copy (it carries the diegosouzapw#12681 context-length correction) and folded this PR's own -max variant into it instead of keeping two separate blocks. Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>
Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>
…tributor The PR's two commits each declared the same EFFORT_TIERS["muse-spark-1.3-contributor"] key — the later one (without "max") silently won at runtime and tripped TS1117 (duplicate object-literal property) on the open-sse-typecheck gate. Merged into a single entry with the full minimal/low/medium/high/xhigh/max list; parseEffortLevel's generic muse-spark-*-contributor regex fallback already covered the "-max" suffix either way, so this is a type-safety fix with no behavior change (51/51 tests still pass). Also records the file-size-baseline.json entry for open-sse/executors/opencode.ts: this PR's own growth (929->1059) and the release tip's independent growth (929->1185, unrelated already-merged PRs) each stay under the 1200 new-file cap alone; only their merge (1320) crosses it. Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>
Resolves the conflicts — providerModels.ts: kept the base's getVertexModelTargetFormat dispatch and re-inserted this PR's muse-spark → openai-responses block after it; file-size-baseline.json: took the base's baseline (the release tip's ceilings already cover this branch). Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>
…park max-first effort logic into opencodeMuseSparkEffort.ts Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>
|
Re-homed to |
…iegosouzapw#14138, diegosouzapw#13634, diegosouzapw#14267, diegosouzapw#12687) Single branch with everything useful from the open Muse Code PRs that release/v3.8.52 does not have yet: - diegosouzapw#15234: session-pinned multi-account round-robin, same-owner empty-response retry, semantic-cache bypass, Responses URL fix for custom baseUrl, 512 output-token floor. - diegosouzapw#12687: opencode-go sends reasoning.effort=max verbatim for muse-spark-1.3+, one xhigh retry on the unsupported-effort 400. - diegosouzapw#13634: MuseCodeExecutor restores the 24h prompt_cache_retention window stripped by the generic sanitizer. - diegosouzapw#14267: device-flow hardening (origin pin, expiry cap, poll-error allowlist, bounded auth requests). - diegosouzapw#14138: mint-failure contract (401/403 forces re-login, 429/transient keeps the stored key). Skipped as subsumed or rejected: duplicate OAuth flows (merged diegosouzapw#14329 covers them), diegosouzapw#14492 parallel provider, llama catalog removals, command-code/freebuff catalog additions. Co-authored-by: mdc2122 <mdc2122@users.noreply.github.com> Co-authored-by: SIGTERM-015 <SIGTERM-015@users.noreply.github.com> Co-authored-by: KSonny4 <KSonny4@users.noreply.github.com> Co-authored-by: caniko <caniko@users.noreply.github.com> Co-authored-by: Chewji9875 <Chewji9875@users.noreply.github.com>
…ation, spark max-effort, cache retention, device-flow hardening, mint-failure contract) into feat/muse-code-compat Conflict in open-sse/executors/opencode.ts transformRequest resolved in favour of the consolidated applyMuseSparkResponsesEffort path (diegosouzapw#12687); the superseded applyGoEffortSuffixMapping helper stays exported and tested.
|
Thanks @Chewji9875 — trying |
- oauth-polltoken-nonjson-body: the diegosouzapw#14267 hardening carried here allowlists Muse Code poll errors and never echoes upstream text, so a non-JSON 502 page now maps to a bare { error: "invalid_response" } instead of a description quoting the HTML. Kimi and GitHub keep the original assertion. - opencode-go-muse-spark-1-3-12674: diegosouzapw#12687 adds `max` as an explicit muse-spark-1.3 alias (sent verbatim, xhigh fallback on the upstream unsupported-effort 400), so parseEffortLevel(-max) now resolves. Co-authored-by: caniko <caniko@users.noreply.github.com> Co-authored-by: Chewji9875 <Chewji9875@users.noreply.github.com> Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>
สรุป
reasoning.effort=maxตรงๆ ไป/responsesก่อน (max-first) — ถ้า upstream ตอบ 400 unsupported-effort จะ retry อัตโนมัติ 1 ครั้งด้วยxhighreasoning_effortผ่าน verbatim และรับmaxอยู่แล้ว (มี test ยืนยัน)ที่มา
ยิง
reasoning.effort=maxตรงไป OpenCode Go upstream ได้ 400:ของเดิม clamp เป็น
xhighตั้งแต่ต้นทาง (ยิงรอบเดียว) — PR นี้เปลี่ยนเป็นลองmaxก่อน เผื่อวันไหน upstream รองรับ จะได้ใช้ทันทีโดยไม่ต้อง deploy ใหม่ไฟล์ที่เปลี่ยน
open-sse/executors/opencode.ts—transformRequestส่ง tier ตรงๆ (เลิก clamp max→xhigh), เพิ่มisUnsupportedReasoningEffortRejection()+dispatchWithMuseSparkMaxFallback()ครอบทั้ง fast path (single account) และ rotation looptests/unit/opencode-muse-spark-max-fallback.test.ts(ใหม่, 7 tests) — TDDtests/unit/opencode-muse-spark-1.3-support.test.ts— อัปเดต expectation-max → effort:maxVerify
opencode.tsเป็นของเดิมบน base)release/v3.8.51green, ไม่มี release-freeze เปิดอยู่