Skip to content

feat(319): OpenAI's Decisions API behind the same decision step - #132

Merged
munchist merged 2 commits into
mainfrom
feat/openai-decisions
Oct 17, 2026
Merged

munchist merged 2 commits into
mainfrom
feat/openai-decisions

Conversation

@aflow-pr-agent

Copy link
Copy Markdown
Contributor

Plan 319 — OpenAI's Decisions API as a second model behind ai.decision.decide. Spec: docs/plans/319-a-second-decision-model-openai-decisions.md.

What changes

  • A second decision model. Catalog entry gpt-6-luna-decisions (alias luna-decisions) on the space's existing OpenAI credential. The adapter calls POST /v1/decisions through the OpenAI client's generic post, so no SDK bump. Skills don't change when a space switches models.
  • Decision profiles are catalog data. Every decision model carries { questionsPerCall?, imageContext, confidence: 'calibrated' | 'self_reported' }, held by a contract test. Requests over the per-call limit are split and merged.
  • Refusals. A refused question comes back as { type: 'refusal', decided: false }, so a decided == false route takes it.
  • Calibration is stated. The step output carries calibration. A minConfidence on a model with self-reported confidence raises the advisory decision_confidence_self_reported.
  • A space chooses. modelDefaults.decision in space directives, plus a Decisions row on the Agent settings page. Unset resolves to the first decision model the space holds a key for, skipping models that read no images when the step carries images.
  • Images. The step takes up to 128 stored-media references, resolved by the executor. Sending them to a model that reads no images is refused by the client and by skill validity (decision_model_reads_no_images).
  • yarn models:verify-decisions checks each profile against the live API.

Verification

  • yarn models:verify-decisions against the live APIs: luna-decisions answers choice, score and yes/no in one call, accepts 200 questions and refuses 201, and reads an image; jev answers all three types in one call. All profiles match.
  • After rebasing on main: yarn build, yarn typecheck, yarn format:check clean.
  • yarn test:changed: 16,319 passed, 2 failed, neither from this branch:
    • checkoutReplacement.test.ts (host sandbox) fails identically on a branch with no host changes.
    • ownershipEnv.test.ts timed out under load and passes on its own.
  • Repo-wide lint left to CI.
  • Open: P4, the measured comparison of the two models on labelled decision sets.

🤖 Generated with Claude Code

munchist and others added 2 commits October 17, 2026 20:05
A second decision model, so a space with an OpenAI key runs decision skills
with no TypeSafe account.

- ai-client: gpt-6-luna-decisions (alias luna-decisions) on the existing
  OpenAI credential, called through the SDK client's generic post so auth,
  retries and errors are the adapter's own. Every decision model carries a
  measured profile (questionsPerCall, imageContext, confidence); a request
  past the per-call limit is split and merged; a declined question is a
  refusal; images ride as data URLs. `yarn models:verify-decisions` re-reads
  each profile from the live API
- schemas: the step takes images (stored-media references), answers may be a
  refusal that is never decided, and the output states its calibration.
  modelDefaults.decision names a space's decision model
- executor-ai: the model is the step's, else the space's, else the first
  decision model the space holds a key for (one that reads images when the
  step carries them)
- cybernetic-runtime: a named model that reads no images is an error; a
  threshold on self-reported confidence is an advisory
- web-product: a Decisions row in the Agent settings

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Top-level await does not transform for tsx's CommonJS output, so the probe
runs inside main() like the reasoning probe. Both decision profiles match the
live APIs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@munchist
munchist merged commit e7f5cb3 into main Oct 17, 2026
3 checks passed
@munchist
munchist deleted the feat/openai-decisions branch October 17, 2026 19:42
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.

1 participant