Skip to content

feat(openrouter-decisions): add System One API, Box, images, and question design - #201

Merged
mattapperson merged 8 commits into
mainfrom
devin/1793121267-agent-call-decision
Oct 29, 2026
Merged

mattapperson merged 8 commits into
mainfrom
devin/1793121267-agent-call-decision

Conversation

@mattapperson

@mattapperson mattapperson commented Oct 27, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Folds TypeSafe's typesafe-ai System One skill into openrouter-decisions instead of shipping it as a second skill. Both skills had the same job and the same API contract. openrouter-decisions already triggers on "Jev, TypeSafe, or System One", so a sibling skill would have competed with it for the same requests. This PR adds the parts the TypeSafe skill had and openrouter-decisions lacked.

What changes in skills/openrouter-decisions:

  • Box questions (box, Jev 1.14 only). scripts/lib.ts gains BoxQuestion and BoxAnswer types. parseQuestion and parseAnswer now accept box and reject box with criteria. @openrouter/sdk is bumped from ^1.3.23 to ^1.5.13, which adds DecisionsBoxQuestion, so decide.ts --sdk sends Box too.
  • Images. references/decisions-api.md documents:
    • inline image_url data-URL parts in state;
    • TypeSafe's assets map, which OpenRouter accepts: the asset shape, the rule that every asset is referenced, and where Jev and the other models read references;
    • per-model image limits.
  • Fit check for image requests. models.ts fit is now fitVerdict(textTokens, maxInput, hasImages) in lib.ts. The text estimate leaves out inline image parts, so a request with images reports unknown, or no when its text alone is over the cap. Offline tests are in scripts/lib.test.ts (npm test).
  • System One API and TypeSafe SDK path. POST /api/v1/systemone takes the same request and returns the same answers. Bare IDs map onto the typesafe/ namespace (jev-1.14 → typesafe/jev-1.14). TypeSafeClient works with baseURL: 'https://openrouter.ai/api' and an OpenRouter key, but client.models.list() does not.
  • New references/question-design.md. Holds TypeSafe's design guidance: truth tables, the human test, wording, criteria, speculative questions, how to read answers, probing, the order of checks when an answer looks wrong, yellow flags, and cookbooks. The cookbooks include translation notes from TypeSafe's API to OpenRouter's, and OpenRouter's own cookbooks are added.
  • SKILL.md behavior changes:
    • The null case for a Choice is now a companion noul (TypeSafe's Jev 1.14 guidance), replacing the "add a none option" rule. Readers are told to probe both on other models.
    • Code reads a paired choice or box only in the presence noul's yes branch. The no branch goes to no-match, and the uncertain band goes to the fallback.
    • The noul gate now allows a 0.7/0.3 band, with the middle routed to the fallback when one exists.
    • The description gains the Box and TypeSafe/System One triggers.

skills/agent-call-decision from the first commit is removed, along with its root README row.

Verified

  • decide.ts sends a Box+Noul image request to typesafe/jev-1.14 over both HTTP and --sdk, and returns typed box answers.
  • A box question with criteria is rejected locally.
  • npm test passes 4 fit and estimate tests.
  • models.ts with an image request prints unknown for each model's fit, except no for models whose cap is 0.
  • tsc --strict on the scripts reports no errors apart from the existing missing @types/node.
  • The TypeSafeClient snippet in decisions-api.md runs against OpenRouter.
  • Every SKILL.md frontmatter parses. The Validate skills CI check passes on this PR.

What still doesn't work

  • Box picks the wrong object when there are distractors. On an image with a blue rectangle and a red circle, the "red circle" Box returned the rectangle's region (low confidence, 0.26), while the companion noul was 0.99. The skill tells readers to probe images with distractors. The fix is on the model side.
  • The bundled scripts reject assets. decide.ts and models.ts accept only inline image parts. Requests that use assets work against the API but need the caller's own client.
  • No image cost per provider. Fit reports unknown for image requests rather than modeling each provider's image accounting.
  • One example still uses none. The decisions-api.md request example still uses a none option on a jev-1.13 Choice, which is still valid there. I left it as is rather than rewrite the canonical example.

Env vars

  • OPENROUTER_API_KEY is needed only for decide.ts and live probes. models.ts, npm test, and reading the skill need no key.

Link to Devin session: https://openrouter.devinenterprise.com/sessions/b6c66f70018a448883eb7d40a75958e3
Open in Devin Desktop: https://openrouter.devinenterprise.com/desktop/session/b6c66f70018a448883eb7d40a75958e3?variant=devin
Requested by: @mattapperson


Devin Review

@devin-ai-integration

Copy link
Copy Markdown
Contributor

I'll fix CI failures and address comments from users with write access that start with 'Devin'.

  • Disable automatic comment, CI, and merge conflict monitoring

Original prompt from Matt

I want to make sure our https://github.com/OpenRouterTeam/skills/tree/main/skills/openrouter-decisions skill can do the same thing as this skill. if not. take this skill and refactor it to call our system one decision API and then PR it to this repo as a agent-call-decision skill
ATTACHMENT:"https://openrouter.devinenterprise.com/attachments/679ac90f-4425-4fe7-91ad-ae76dffddd21/SKILL%20%282%29.md"

@devin-ai-integration devin-ai-integration Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note

Newer findings are available below. Devin Review posted a newer report on this PR, in addition to the findings presented here.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

@devin-ai-integration devin-ai-integration Bot changed the title feat(agent-call-decision): add System One decision skill for OpenRouter feat(openrouter-decisions): add System One API, Box, images, and question design Oct 27, 2026

@w0nche0l w0nche0l left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

approving to unblock with one opinion

…t-call-decision

# Conflicts:
#	skills/openrouter-decisions/SKILL.md
devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration Bot and others added 2 commits October 27, 2026 18:40
Co-Authored-By: Matt Apperson <me@mattapperson.com>
devin-ai-integration[bot]

This comment was marked as resolved.

@devin-ai-integration

Copy link
Copy Markdown
Contributor

Heads-up from the daily skills sync: openrouter-web#54599, merged 2026-10-27, makes OpenRouter accept TypeSafe's top-level assets map and asset references in Decisions requests. That makes three statements in this PR outdated:

  • references/decisions-api.md: "a top-level assets field is ignored ... an image sent either way never reaches the model"
  • references/decisions-api.md (TypeSafe SDK paragraph) and references/question-design.md: "inline image parts in place of assets"
  • On models other than Jev, an image part nested in state objects, instructions, or criteria now returns a 400. It is no longer read as text.

Current behavior is documented in the multimodal decisions guide, Asset references. The same correction is on the sync PR #195. I have not pushed anything to this branch.

Written by Devin

perry-the-pr-reviewer[bot]

This comment was marked as resolved.

…t for image requests

Co-Authored-By: Matt Apperson <me@mattapperson.com>
@perry-the-pr-maintainer
perry-the-pr-maintainer Bot dismissed perry-the-pr-reviewer[bot]’s stale review October 29, 2026 15:43

Superseded by updated Perry review

perry-the-pr-maintainer[bot]

This comment was marked as resolved.

…ection

Co-Authored-By: Matt Apperson <me@mattapperson.com>
@mattapperson
mattapperson merged commit fc4b230 into main Oct 29, 2026
2 checks passed
@mattapperson
mattapperson deleted the devin/1793121267-agent-call-decision branch October 29, 2026 16:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants