Repository navigation
openrouter-decisions 0.1.0: OpenRouter's Decisions API as System One - #1324
Open
Subway-chenyan wants to merge 2 commits into
Open
Subway-chenyan wants to merge 2 commits into
Subway-chenyan wants to merge 2 commits into
Conversation
added 2 commits
November 18, 2026 20:17
A provider exposing OpenRouter's Decisions API (POST https://openrouter.ai/api/alpha/decisions) through magpie's System One interface, serving Microsoft's decision models microsoft-decision-1.1 and microsoft-decision-1 as classifiers and decision-group members. - choice, score and noul questions with probabilities, confidence and the score legend validated and restored - choices [...] shorthand expanded to a criteria map; blank criteria text falls back to the option name so the upstream's non-empty constraint holds - object, numeric and boolean state become JSON text evidence; text and multimodal part arrays pass through - per-question refusals stay refusals; other answers and usage kept - OpenRouter credit usage through auth.usage (/api/v1/auth/key, /api/v1/credits) - fixed upstream endpoint, fresh header set, no redirects; HTTP error answers never retried, one quick network-level retry for transient connection failures; cancellation propagates - decision models stay out of the chat catalog and refuse conversation 16 offline tests (node --test, bun test) with injected fetches; verified live on magpie 0.1.4462 as an intent classifier and through /provider test (decide 2228 ms) in a sandbox HOME.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
A new provider package,
packages/openrouter-decisions(
@magpie-community/opencode-openrouter-decisions-auth), exposingOpenRouter's Decisions API (
POST https://openrouter.ai/api/alpha/decisions)through magpie's System One interface.
Provider id:
openrouter-decisions. Models:microsoft-decision-1.1(text+image input) andmicrosoft-decision-1(text), Microsoft's System One decision models on OpenRouter.
Registry entry and a root-README row are included, beside the other
decision providers.
Why
OpenRouter speaks a System One dialect on a different path with a few extra
constraints, so its decision models (including newly added Microsoft
Decision 1.1) cannot serve as magpie classifiers directly. This package
converts, the same way
openai-decisionsdoes for OpenAI's native API.How
choice,scoreandnoulquestions; answers validated and restoredwith probabilities, confidence and the score legend. Per-question
refusals stay refusals; other answers and usage are kept.
choices: [...]shorthand expands to a criteria map; blank criteriatext falls back to the option name (then a positional label), because the
upstream rejects empty strings with 422 (
string_too_short).text passes through; multimodal part arrays keep their form.
auth.usagereads/api/v1/auth/keyand/api/v1/credits: creditwindow, percentage and balance in
magpie quota.and cookies never forwarded. HTTP error answers pass through untouched
and are never retried; one quick network-level retry absorbs transient
connection failures (observed once in production use); cancellation
propagates. No failover of its own — magpie routes.
decides: true, stay out of the chat catalog andrefuse conversation requests.
opencode2.mjsis a byte-identical copy ofscripts/opencode2.mjs.Checks
bun scripts/check.mjs— all packages pass (60 ✓, 0 ✗) on this branch.bun test packages/openrouter-decisions— 16 pass, 0 fail (offline,injected fetches, synthetic credentials, no files written).
scripts/try.sh openrouter-decisionsin a sandbox HOME with magpie0.1.4462: provider listed with 2 models; after sign-in,
provider testshows✓ decide 2228 ms · microsoft-decision-1.1(chat correctly refused: the models only decide).
gateway in ~1.1–3.0 s and the routing record carried the matched intent
and
surevalues of 0.94–0.99;magpie quotashowed the credit windowand balance.
Review checklist from the README followed: credentials only through the
host's selected-account auth, non-empty instructions and criteria supplied
wherever the upstream requires them, offline tests without credential
files, English code comments, root README / package README / bilingual
registry / changelog aligned, live verification recorded in
VERIFICATION.md.
Not verified: OpenCode 2.x decision workflows end to end; other OpenRouter
decision models;
boxquestions (the models do not declare imagelocalization and the adapter does not accept the type).