Skip to content

fix(codex): preserve Astra Ultra workflow metadata - #6718

Merged
Wei-Shaw merged 2 commits into
Wei-Shaw:mainfrom
lyy0709:codex/astra-ultra-catalog
Sep 7, 2026
Merged

Wei-Shaw merged 2 commits into
Wei-Shaw:mainfrom
lyy0709:codex/astra-ultra-catalog

Conversation

@lyy0709

@lyy0709 lyy0709 commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Summary

Restore GPT-6 Astra's Ultra option in generated Codex catalogs and preserve the metadata that tells Codex how to execute it. This is a catalog/workflow fix, not a new inference reasoning level.

The current fallback advertises Astra only through max. Merely appending ultra would also be incorrect: without multi_agent_reasoning_effort, Codex falls back to max, whereas the official Astra catalog specifies xhigh.

Source of truth

Verified against openai/codex commit a9896da3febcaf30e1c5d7b452fb6334b1a0bc51:

  • Bundled models.json: Astra advertises low, medium, high, xhigh, max, ultra, multi_agent_reasoning_effort: "xhigh", and multi_agent_version: "v2".
  • ModelInfo::resolve_reasoning_effort: Ultra resolves to the advertised override; otherwise it falls back to max, another supported non-Ultra effort, or medium.
  • effective_multi_agent_mode: Ultra selects proactive multi-agent behavior under v2 unless explicit mode instructions override it.

Changes

  • Add Astra Ultra to the fallback catalog, together with its xhigh inference override and v2 selector; the gpt-6 alias uses the same descriptor.
  • Preserve multi_agent_reasoning_effort and multi_agent_version through upstream catalog extraction, persisted metadata, routed group catalogs, and standard model-list conversion using the existing nullable-scalar capability path.
  • Preserve provider overrides and explicit null; conflicting/missing peer metadata keeps the existing conservative intersection behavior.
  • Describe Ultra as automatic task delegation, including metadata-synced levels.

This does not alter raw Responses request normalization, billing, group effort limits, or implement server-side subagents. Codex translates Ultra to the ordinary inference effort before requests reach Sub2API. Explicit provider reasoning-level lists retain precedence over the fallback.

Validation

  • go test ./internal/service -run 'Test(AstraUltra|AstraCodexTool|NewConfiguredCodexModelDescriptor|BuildCodexModelsManifest|CompleteAPIKeyCodexModelsManifest|SyncUpstreamModelCatalog)' -count=1 passed on upstream ab99d56e9626e6cd731592dae8553c9758a0efa2 plus this patch.
  • The same targeted tests passed on the downstream fork in an isolated checkout.
  • Installed codex-cli 0.153.4, with an isolated home and the corrected catalog, sent reasoning.effort: "xhigh" when configured for ultra. A loopback-only endpoint captured the request and intentionally returned HTTP 400; no remote inference was performed.
  • git diff --check passed.

The new regressions cover metadata extraction/snapshot round-trip, aliases, group intersection, native and converted catalogs, and explicit overrides/nulls. Existing descriptor tests verify Astra and its alias; other model expectations remain unchanged.

Related PRs

Follow-up to #6572 and #6628. The latter explicitly used an Astra fallback without Ultra. Open #6678 addresses stale image modalities and #6690 addresses reasoning.mode; neither covers this workflow metadata. No duplicate Ultra PR was found in the open/all-state keyword searches.

Local Codex configuration and catalog files are not included in this PR.

Copilot AI lite review requested due to automatic review settings September 6, 2026 17:13

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The changes are cohesive, covered by targeted tests, and appear to correctly preserve Ultra workflow metadata across the catalog/manifest pipeline.

Pull request overview

Restores GPT-6 Astra’s Ultra option in generated Codex catalogs while preserving the workflow metadata (multi_agent_reasoning_effort, multi_agent_version) needed for Codex to execute Ultra correctly (rather than silently falling back to max).

Changes:

  • Add Ultra to Astra’s fallback reasoning-level advertisement and default its workflow metadata (xhigh + v2) in the generated descriptor.
  • Preserve multi_agent_reasoning_effort / multi_agent_version through the existing nullable-scalar capability propagation path (including intersection behavior).
  • Add regression tests to validate metadata round-trip and explicit overrides/null preservation.
File summaries
File Description
backend/internal/service/openai_codex_models_service.go Adds Astra Ultra to supported reasoning levels and emits default Ultra workflow metadata for Astra descriptors.
backend/internal/service/openai_codex_models_service_test.go Updates descriptor expectations to include Ultra + multi-agent metadata for Astra (and gpt-6 alias).
backend/internal/service/openai_codex_model_metadata.go Extends preserved Codex scalar-capability fields to include Ultra workflow metadata and adds Ultra description text.
backend/internal/service/openai_codex_model_metadata_test.go Adds tests ensuring workflow metadata is preserved through extraction, conversion, and group/alias handling.
Review details
  • Files reviewed: 4/4 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines 373 to +376
gpt6 := newConfiguredCodexModelDescriptor("gpt-6")
require.Equal(t, "GPT-6 (Astra)", gpt6.DisplayName)
require.Equal(t, []string{"low", "medium", "high", "xhigh", "max"}, effortsFromConfiguredCodexLevels(gpt6.SupportedReasoningLevels))
require.Equal(t, []string{"low", "medium", "high", "xhigh", "max", "ultra"}, effortsFromConfiguredCodexLevels(gpt6.SupportedReasoningLevels))
require.Equal(t, "xhigh", *gpt6.MultiAgentReasoningEffort)
@Wei-Shaw
Wei-Shaw merged commit 561fc1c into Wei-Shaw:main Sep 7, 2026
8 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 7, 2026
Wei-Shaw added a commit to MarushiruDonato/sub2api_copy that referenced this pull request Sep 7, 2026
…roup parameter

- Resolve conflict in openai_codex_models_service_test.go: keep both
  GPT-6 Astra instructions template assertion (from this PR) and ultra
  reasoning level + multi_agent fields (from Wei-Shaw#6718 on main)
- Fix compilation error on main: add missing `group *Group` parameter
  to buildCodexModelsManifestForAccounts calls in
  openai_codex_model_metadata_test.go (lines 24, 32) — caused by Wei-Shaw#6688
  changing the function signature while Wei-Shaw#6718 added new callers with
  the old signature
@lyy0709
lyy0709 deleted the codex/astra-ultra-catalog branch September 29, 2026 06:34
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants