Skip to content

feat: GPT-6 Astra/Sol/Luna + GPT-5.6 tiers, with -fast, prompt-family and SSE fixes - #130

Open
PaoloC68 wants to merge 16 commits into
numman-ali:mainfrom
PaoloC68:feature/add-gpt-5.6
Open

PaoloC68 wants to merge 16 commits into
numman-ali:mainfrom
PaoloC68:feature/add-gpt-5.6

Conversation

@PaoloC68

@PaoloC68 PaoloC68 commented Sep 20, 2026 •

Copy link
Copy Markdown

Summary

Brings the plugin up to the current Codex backend: GPT-6 (Astra, Sol, Luna) and the GPT-5.6 tiers (sol/terra/luna), plus three bugs found along the way. Every model claim here was verified against POST https://chatgpt.com/backend-api/codex/responses with a ChatGPT OAuth account rather than inferred.

Relationship to #129: that PR covers the 5.6/5.5/5.4 mappings. This branch additionally adds GPT-6 Astra, fixes -fast handling, fixes the prompt-family fallback, and brings both config files to parity. Happy to rebase onto #129 if it lands first.

Model support

  • GPT-6 Astra and GPT-5.6 sol/terra/luna across MODEL_MAP, normalizeModel, and both config files.
  • normalizeModel had no gpt-6 branch, so an astra id missing from MODEL_MAP fell through every gpt-5 pattern to the default return and was silently downgraded to gpt-5.1. It is now checked ahead of the gpt-5 patterns.
  • GPT-6 Sol and Luna hit the same downgrade: they matched no pattern and were sent as gpt-5.1, which the backend now rejects outright (The 'gpt-5.1' model is not supported when using Codex with a ChatGPT account.). The astra-only check is now one rule that keeps any gpt-6-<tier> id and drops its suffix, so the next GPT-6 tier needs no code change. gpt-6-{sol,luna}-fast are rejected like astra's and resolve to their base model. Sol and Luna are not yet in the config presets or README.
  • Sol and Luna accept none..max, so none is no longer lifted to low for them; astra still rejects none and keeps the clamp.
  • supportsXhigh only covered 5.2 / 5.2-codex / codex-max, so xhigh on the 5.6 tiers and on astra was quietly clamped to high. Both families accept it (astra low..max, 5.6 none..max).

Fixes

-fast ids returned a hard 400

Six ids mapped to themselves and were passed through verbatim, but the backend rejects every one:

The 'gpt-5.6-luna-fast' model is not supported when using Codex with a ChatGPT account.

Confirmed 400 for gpt-5.4-fast, gpt-5.4-mini-fast, gpt-5.5-fast, gpt-5.6-{sol,terra,luna}-fast and gpt-6-astra-fast. They now normalize to their base model, so a -fast selection degrades to a working request instead of failing.

This also covers opencode's openai provider default, which resolves to gpt-5.6-terra-fast and was therefore unusable out of the box.

5.6 and GPT-6 were served the gpt-5.1 prompt

getModelFamily enumerated 5.2 through 5.5 and fell through to a gpt-5.1 catch-all, so the newest models received the oldest instructions while 5.4 and 5.5 correctly received gpt_5_2_prompt.md.

Since no 5.6 or 6 prompt files exist in this repo, they join the existing gpt-5.2 family rather than adding ModelFamily entries that point at the same files.

SSE parsing — port of #96 by @harshav167

parseSseStream matched only data: with a trailing space, parsed each line in isolation, and returned null unless it saw response.done. It now accepts both data: spellings, joins JSON split across several data lines, survives a malformed event mid-stream, and falls back finalResponse → lastResponseLike → lastEvent.

Behaviour change: a stream with no response.done now returns the last JSON event rather than the raw SSE text, so that test was updated accordingly.

Config parity

opencode-legacy.json had stopped at the 5.2/5.1 families, so nobody on opencode v1.0.209 or below could reach anything added since — 5.3 Codex, 5.4, 5.5, the 5.6 tiers or astra. Now 22 → 67 presets mirroring opencode-modern.json entry for entry.

-fast ids are deliberately not carried into the legacy config, since they normalize to their base model and would just be duplicate presets.

README updated: model list, families, and the stale 30 model presets figure → the actual 81 presets across 18 models.

Verification

  • tsc --noEmit clean
  • 237/237 tests passing (was 231)
  • opencode run --model openai/gpt-6-luna and openai/gpt-6-sol return 200 through the plugin (previously 400 naming gpt-5.1)
  • Every id in both config files resolves through MODEL_MAP — 0 unmapped

Note

Two incidental commits are included: a package-lock.json sync (it still recorded 4.3.1 after the 4.4.0 release) and a .gitignore entry for local agent tooling directories. Happy to drop either if you'd rather keep this PR to the model changes.

leether and others added 12 commits May 4, 2026 14:42
- Add model mappings for gpt-5.3-codex, gpt-5.3-codex-spark,
  gpt-5.4, gpt-5.4-fast, gpt-5.4-mini, gpt-5.4-mini-fast,
  gpt-5.5, gpt-5.5-fast
- Pattern-based model normalization for 5.3/5.4/5.5 families
- Explicit gpt-5.5-pro rejection with clear error message
- Update config templates, install script, docs, and tests
- All 229 tests passing, all new models e2e verified
The ChatGPT/Codex backend serves the three named 5.6 tiers to ChatGPT
Plus/Pro accounts, so they can run on subscription quota rather than
metered api.openai.com credits.

Verified against POST https://chatgpt.com/backend-api/codex/responses:
  gpt-5.6-sol    HTTP 200
  gpt-5.6-terra  HTTP 200
  gpt-5.6-luna   HTTP 200
  gpt-5.6        HTTP 400 'not supported when using Codex with a ChatGPT account'
  gpt-5.6-codex  HTTP 400 (same)

Only the three supported ids are mapped. The pattern-matching fallback in
request-transformer checks the 5.6 tiers before the 5.5 branch, otherwise an
unmapped id such as gpt-5.6-sol-pro would silently downgrade to gpt-5.5.

229 existing tests pass unchanged.
The ChatGPT/Codex backend rejects every "-fast" id with "The '<id>' model is
not supported when using Codex with a ChatGPT account", so passing them
through as-is produced a hard 400 rather than a faster request. Verified
against POST https://chatgpt.com/backend-api/codex/responses on 2026-09-20
for gpt-5.4-mini-fast, gpt-5.6-{sol,terra,luna}-fast and gpt-6-astra-fast.

Mapping them to their base model degrades a "-fast" selection to a working
request instead of failing. This also covers opencode's openai provider
default, which resolves to gpt-5.6-terra-fast and was therefore unusable.

gpt-6-astra already had no -fast entry for this reason; this applies the
same treatment to the 5.4, 5.5 and 5.6 families.
normalizeModel had no gpt-6 branch, so any astra id that missed MODEL_MAP
fell through every gpt-5 pattern to the default return and was silently
downgraded to gpt-5.1. The new check runs ahead of the gpt-5 patterns, so an
unreleased tier such as "gpt-6-astra-pro" still resolves to gpt-6-astra
rather than a wrong-family model.

getReasoningConfig only allowed xhigh for 5.2, 5.2-codex and codex-max, so
xhigh on the 5.6 tiers and on astra was quietly clamped to high. Both
families accept it (astra: low/medium/high/xhigh/max; 5.6: none through
max), so both are now included.
The lockfile still recorded 4.3.1 after the 4.4.0 release. Regenerating it
also picks up esbuild 0.25.10 -> 0.27.7 and the current rollup platform
binaries. No direct dependency ranges changed.
.omo/ and .serena/ hold local agent state (run-continuation data, Serena
caches and memories). They are machine-specific and were surfacing as
untracked on every status, where they risk being committed by accident.
.opencode/ is already ignored for the same reason.
MODEL_MAP and normalizeModel have handled gpt-6-astra and gpt-5.6
sol/terra/luna since the 5.6 work, but neither was ever added to
opencode-modern.json, so a fresh install exposed 14 models and none of the
new ones. Users had to hand-edit their opencode.json to reach models the
plugin already supported.

Adds the four models with the effort ranges the backend actually accepts:
astra low..max (no "none", which it rejects outright) and the 5.6 tiers
none..max. Context follows the 5.5 generation convention at 400k.

README now lists them, drops the stale "30 model presets" figure for the
real 81 across 18 models, and documents that "-fast" ids normalize to their
base model rather than selecting a distinct tier.
getModelFamily enumerated 5.2 through 5.5 and fell through to a gpt-5.1
catch-all, so gpt-5.6-sol/terra/luna and gpt-6-astra were each sent
gpt_5_1_prompt.md while gpt-5.4 and gpt-5.5 correctly received
gpt_5_2_prompt.md. The newest models were getting the oldest instructions.

This is the same catch-all-default failure that silently downgraded astra
in normalizeModel, one layer further down, so the comment now states the
invariant: any family omitted here is served the oldest prompt in the repo.

Found while reviewing upstream numman-ali#129,
which extends ModelFamily for the 5.6 tiers. No new prompt files exist for
5.6 or 6, so they join the existing gpt-5.2 family rather than adding
entries that point at the same file.
Port of upstream numman-ali#96 by @harshav167.

parseSseStream only matched "data: " with a trailing space, parsed each
line in isolation, and returned null unless it saw response.done or
response.completed. A stream using "data:" without the space, or splitting
one JSON object across several data lines, yielded nothing and the caller
fell back to handing the raw SSE text to a JSON consumer.

Now: both "data:" spellings are accepted, consecutive data lines are joined
before parsing, a malformed event no longer poisons the events after it,
and the payload falls back from finalResponse to the last response-like
event to the last event, logging a warning when the final event is missing.

Behaviour change: a stream with no response.done now returns the last JSON
event rather than the original text, so that test was updated accordingly.
The legacy config still stopped at the 5.2 and 5.1 families, so anyone on
opencode v1.0.209 or below could not reach any model added since - 5.3
Codex, 5.4, 5.5, the 5.6 tiers or GPT-6 Astra - even though the plugin has
resolved them for several releases.

Adds 45 presets (22 -> 67) mirroring config/opencode-modern.json: effort
ranges and context limits match entry for entry, and gpt-6-astra omits
"none" because the backend rejects it.

Also adds the missing gpt-5.6-{sol,terra,luna}-max ids to MODEL_MAP. The
suffixed spelling is how the legacy config addresses a model, and only
gpt-6-astra-max existed; the 5.6 tiers resolved through the pattern-match
fallback instead of an explicit mapping.

The "-fast" ids are deliberately not carried into the legacy config. They
normalize to their base model, so legacy entries for them would be
duplicate presets.
normalizeModel only knew gpt-6-astra, so gpt-6-sol and gpt-6-luna matched
no pattern, reached the default return and were sent as gpt-5.1 - which the
backend now rejects outright:

  "The 'gpt-5.1' model is not supported when using Codex with a ChatGPT
   account."

Both tiers are served (verified against POST
https://chatgpt.com/backend-api/codex/responses on 2026-09-23), so the
astra-only check becomes one rule that keeps any "gpt-6-<tier>" id and drops
its suffix. "-fast" ids still resolve to their base model, which matters
because gpt-6-{sol,luna}-fast are rejected just like gpt-6-astra-fast. A
future GPT-6 tier resolves without another code change.
supportsNone only covered GPT-5.1 and GPT-5.2 general purpose, so "none" on
gpt-6-sol and gpt-6-luna was silently lifted to "low". Both accept every
effort from none to max (verified 2026-09-23); gpt-6-astra still rejects
"none" and keeps the clamp.
@PaoloC68 PaoloC68 changed the title feat: GPT-6 Astra + GPT-5.6 tiers, with -fast, prompt-family and SSE fixes feat: GPT-6 Astra/Sol/Luna + GPT-5.6 tiers, with -fast, prompt-family and SSE fixes Sep 23, 2026

This branch has not been deployed

No deployments
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