fix: unlock 1M-token context for Sonnet 4.5 and GPT-5 in pi#1
Closed
dgokeeffe wants to merge 1 commit into
Closed
Conversation
dgokeeffe
force-pushed
the
fix/1m-context-claude-gpt-pi
branch
from
July 18, 2026 13:15
2b16fcc to
a6359d3
Compare
Owner
Author
|
Superseded by upstream PR: databricks#223 |
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.
Summary
Fixes long-context metadata for Claude and GPT gateway models, with GPT handling scoped to Pi.
[1m]to Sonnet 4.5+ and Opus 4.6+ aliases.contextWindow,maxTokens, reasoning, image, and adaptive-thinking metadata instead of accepting Pi's custom-model defaults.system.ai.*,databricks-*, and provider-qualified model IDs.Closes databricks#222.
Root cause and reproducible proof
Pi 0.80.6 documents these defaults for custom models when fields are omitted:
ucode previously emitted Claude models as only
{"id": ...}, so Pi displayed and compacted Opus 4.8 as a 128K model even though the gateway model is long-context.The installed Pi catalog independently declares Claude Opus 4.8 as:
Pi's model override docs also explicitly show GPT-5.6 Sol can opt into:
{"gpt-5.6-sol": {"contextWindow": 1050000}}After this patch, rendering a ucode Pi overlay produces:
{ "id": "databricks-claude-opus-4-8", "reasoning": true, "input": ["text", "image"], "contextWindow": 1000000, "maxTokens": 128000, "compat": {"forceAdaptiveThinking": true} }and:
{ "id": "databricks-gpt-5-6-sol", "contextWindow": 1050000, "maxTokens": 128000, "reasoning": true, "input": ["text", "image"] }Claude Code 2.1.214 bundle inspection also confirms that
[1m]selectscontext-1m-2025-08-07independently ofCLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS. Therefore beta suppression was not the root cause of Pi's 128K display; the omitted Pi custom-model metadata was.Validation
A full local run reached
913 passed, 36 skipped; its only behavioral failure was the managed-environment Claude binary timing out before reaching the test capture server. The other failure was formatting, subsequently fixed and covered by the passingtests/test_lint.pyrun above.Stacking
This PR is stacked on
dgokeeffe:feat/pi-oss-provider-v2/ databricks#217. Retarget todatabricks/ucode:mainafter databricks#217 merges.