Skip to content

fix(ai): treat OpenAI gateway aliases as reasoning models #1474

Closed

Description

@willgriffin

HappyVertical's Bifrost gateway now exposes stable OpenAI tier aliases (openai/luna, openai/terra, openai/sol, openai/astra) that resolve to the current GPT-6 model (happyvertical/iac#2435), so apps never name a version. Anytown will switch to them.

usesCompletionTokenLimit in packages/ai/src/shared/providers/openai.ts recognises reasoning models only by name (gpt-5*, gpt-6*, o1/o3/o4). An alias's last segment (terra) matches none of these, so the request goes out in the legacy shape: max_tokens plus temperature, which GPT-6 reasoning models reject. top_p is also always forwarded, and reasoning models reject it too.

Change

  • For an openai/-prefixed id, treat the model as a reasoning model unless its last segment is a known legacy family (gpt-3*, gpt-4*, chatgpt-*, and ft: fine-tunes of those). Aliases and future OpenAI families then work without an SDK change. Bare ids and other vendors (anthropic/…, ollama/…) keep today's name-based behaviour.
  • Omit top_p for reasoning-shaped requests, in both chat and streaming.

Acceptance

  • openai/terra (and the other tiers) get max_completion_tokens, with no temperature or top_p.
  • openai/gpt-4.1-mini, openai/gpt-4o-mini, anthropic/claude-sonnet-4-6 and bare mistral:latest are unchanged.
  • Unit tests cover both directions. Package typecheck, lint and tests pass.

Activity

  1. willgriffin commented on Oct 31, 2026

    @willgriffin
    ContributorAuthor

    Claimed by Claude Code · session anytown-terra-6-1-47a0e2 · branch claude/ai-openai-reasoning-aliases · 2026-10-30
    Status: ready for review in #1475 (validation green, review-cycle clean after one accepted fix). Next: owner merge; the release workflow publishes the patch, then Anytown bumps @happyvertical/ai from 0.108.0.

  2. willgriffin commented on Oct 31, 2026

    @willgriffin
    ContributorAuthor

    Review budget ledger (maintained by hv-review-dispatch; do not edit).

    {
      "dispatches": [
        {
          "counted": false,
          "dispatch_id": "bdedf1b6-2675-4ad5-8d4d-988e62d6735c",
          "disposition": "unavailable",
          "escalation_reason": null,
          "finished_at": "2026-10-31T05:36:39Z",
          "head": "789a203bbf17deb5dbc394c22c8f2eb2f66ccfd3",
          "past_cap": null,
          "phase": "final",
          "reconciliation": null,
          "review_base": "64a1b9c04bd4b07ee66657028bb9a689fe955c97",
          "review_cycle": "6539608522",
          "review_round": 1,
          "target": "codex-sol",
          "token_cap": 30000000,
          "total_tokens": null,
          "user_approval": null
        },
        {
          "counted": true,
          "dispatch_id": "42f0c4c8-7407-4f21-b8de-4fa0d85c9ab9",
          "disposition": "findings",
          "escalation_reason": null,
          "finished_at": "2026-10-31T05:36:56Z",
          "head": "789a203bbf17deb5dbc394c22c8f2eb2f66ccfd3",
          "past_cap": null,
          "phase": "final",
          "reconciliation": null,
          "review_base": "64a1b9c04bd4b07ee66657028bb9a689fe955c97",
          "review_cycle": "6539608522",
          "review_round": 1,
          "target": "claude-sonnet",
          "token_cap": 30000000,
          "total_tokens": 12748,
          "user_approval": null
        },
        {
          "counted": true,
          "dispatch_id": "4f0964a2-cb8c-4f96-bba9-6aec2c65a537",
          "disposition": "clean",
          "escalation_reason": null,
          "finished_at": "2026-10-31T05:37:55Z",
          "head": "2aa37e6ce8fcebe92693660c5a630a39e4050436",
          "past_cap": null,
          "phase": "recall",
          "reconciliation": null,
          "review_base": "64a1b9c04bd4b07ee66657028bb9a689fe955c97",
          "review_cycle": "6539608522",
          "review_round": 2,
          "target": "claude-sonnet",
          "token_cap": 30000000,
          "total_tokens": 15575,
          "user_approval": null
        }
      ],
      "final_pass_cap": 6,
      "issue": 1474,
      "repository": "happyvertical/sdk",
      "schema": "https://happyvertical.com/schemas/review-budget/v1"
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions