Skip to content

1M-token context not applied to Sonnet 4.5 and GPT-5 (pi) #222

Description

@dgokeeffe

Problem

Two model families are served with a truncated context window instead of the 1M-token window the gateway supports — the same class of limitation already fixed for GLM.

  1. Claude Sonnet 4.5_maybe_add_1m_suffix (in agents/claude.py) gates the [1m] suffix at >= (4, 6) for both Opus and Sonnet. Sonnet 4.5 supports the 1M context window (its 1M beta shipped before the Opus one), so it was incorrectly served at the default 200k window.

  2. GPT-5 family in pi — the databricks-openai provider models are written as bare {"id": m} with no contextWindow. GPT ids aren't in pi's built-in model catalog, so pi falls back to a small default window and truncates long sessions.

Expected

  • Sonnet 4.5+ gets the [1m] suffix (Opus stays at 4.6+).
  • pi's databricks-openai model entries carry contextWindow/maxTokens; the GPT-5 family uses the 1M window served via the gateway's coding-agent path (same 1M unlocked for Claude/GLM).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions