Skip to content

Commit d019814

Browse files
committed
Bring upgrade back
1 parent 0f8ca88 commit d019814

File tree

8 files changed

+19
-4
lines changed

8 files changed

+19
-4
lines changed

codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.schemas.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10266,6 +10266,12 @@
1026610266
"default": false,
1026710267
"type": "boolean"
1026810268
},
10269+
"upgrade": {
10270+
"type": [
10271+
"string",
10272+
"null"
10273+
]
10274+
},
1026910275
"upgradeInfo": {
1027010276
"anyOf": [
1027110277
{

codex-rs/app-server-protocol/schema/json/v2/ModelListResponse.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,12 @@
6363
"default": false,
6464
"type": "boolean"
6565
},
66+
"upgrade": {
67+
"type": [
68+
"string",
69+
"null"
70+
]
71+
},
6672
"upgradeInfo": {
6773
"anyOf": [
6874
{

codex-rs/app-server-protocol/schema/typescript/v2/Model.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ import type { ReasoningEffort } from "../ReasoningEffort";
66
import type { ModelUpgradeInfo } from "./ModelUpgradeInfo";
77
import type { ReasoningEffortOption } from "./ReasoningEffortOption";
88

9-
export type Model = { id: string, model: string, upgradeInfo: ModelUpgradeInfo | null, displayName: string, description: string, hidden: boolean, supportedReasoningEfforts: Array<ReasoningEffortOption>, defaultReasoningEffort: ReasoningEffort, inputModalities: Array<InputModality>, supportsPersonality: boolean, isDefault: boolean, };
9+
export type Model = { id: string, model: string, upgrade: string | null, upgradeInfo: ModelUpgradeInfo | null, displayName: string, description: string, hidden: boolean, supportedReasoningEfforts: Array<ReasoningEffortOption>, defaultReasoningEffort: ReasoningEffort, inputModalities: Array<InputModality>, supportsPersonality: boolean, isDefault: boolean, };

codex-rs/app-server-protocol/src/protocol/v2.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1395,6 +1395,7 @@ pub struct ModelListParams {
13951395
pub struct Model {
13961396
pub id: String,
13971397
pub model: String,
1398+
pub upgrade: Option<String>,
13981399
pub upgrade_info: Option<ModelUpgradeInfo>,
13991400
pub display_name: String,
14001401
pub description: String,

codex-rs/app-server/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ Example with notification opt-out:
142142
- `thread/realtime/stop` — stop the active realtime session for the thread (experimental); returns `{}`.
143143
- `review/start` — kick off Codex’s automated reviewer for a thread; responds like `turn/start` and emits `item/started`/`item/completed` notifications with `enteredReviewMode` and `exitedReviewMode` items, plus a final assistant `agentMessage` containing the review.
144144
- `command/exec` — run a single command under the server sandbox without starting a thread/turn (handy for utilities and validation).
145-
- `model/list` — list available models (set `includeHidden: true` to include entries with `hidden: true`), with reasoning effort options and optional `upgradeInfo` metadata (`model`, `upgradeCopy`, `modelLink`, `migrationMarkdown`). This replaces the previous top-level `upgrade` field.
145+
- `model/list` — list available models (set `includeHidden: true` to include entries with `hidden: true`), with reasoning effort options, optional legacy `upgrade` model ids, and optional `upgradeInfo` metadata (`model`, `upgradeCopy`, `modelLink`, `migrationMarkdown`).
146146
- `experimentalFeature/list` — list feature flags with stage metadata (`beta`, `underDevelopment`, `stable`, etc.), enabled/default-enabled state, and cursor pagination. For non-beta flags, `displayName`/`description`/`announcement` are `null`.
147147
- `collaborationMode/list` — list available collaboration mode presets (experimental, no pagination). This response omits built-in developer instructions; clients should either pass `settings.developer_instructions: null` when setting a mode to use Codex's built-in instructions, or provide their own instructions explicitly.
148148
- `skills/list` — list skills for one or more `cwd` values (optional `forceReload`).

codex-rs/app-server/src/models.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ fn model_from_preset(preset: ModelPreset) -> Model {
2525
Model {
2626
id: preset.id.to_string(),
2727
model: preset.model.to_string(),
28+
upgrade: preset.upgrade.as_ref().map(|upgrade| upgrade.id.clone()),
2829
upgrade_info: preset.upgrade.as_ref().map(|upgrade| ModelUpgradeInfo {
2930
model: upgrade.id.clone(),
3031
upgrade_copy: upgrade.upgrade_copy.clone(),

codex-rs/app-server/tests/suite/v2/model_list.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ fn model_from_preset(preset: &ModelPreset) -> Model {
2424
Model {
2525
id: preset.id.clone(),
2626
model: preset.model.clone(),
27+
upgrade: preset.upgrade.as_ref().map(|upgrade| upgrade.id.clone()),
2728
upgrade_info: preset.upgrade.as_ref().map(|upgrade| ModelUpgradeInfo {
2829
model: upgrade.id.clone(),
2930
upgrade_copy: upgrade.upgrade_copy.clone(),
@@ -166,6 +167,7 @@ async fn list_models_returns_upgrade_info_metadata() -> Result<()> {
166167
.as_ref()
167168
.expect("expected upgrade info to be populated");
168169

170+
assert_eq!(item.upgrade.as_ref(), Some(&upgrade_info.model));
169171
assert!(!upgrade_info.model.is_empty());
170172
assert!(
171173
upgrade_info.upgrade_copy.is_some()

codex-rs/docs/codex_mcp_interface.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,15 +104,14 @@ Each response yields:
104104
- `inputModalities` – accepted input types for the model
105105
- `supportsPersonality` – whether the model supports personality-specific instructions
106106
- `isDefault` – whether the model is recommended for most users
107+
- `upgrade` – optional recommended upgrade model id
107108
- `upgradeInfo` – optional upgrade metadata object with:
108109
- `model` – recommended upgrade model id
109110
- `upgradeCopy` – optional display copy for the upgrade recommendation
110111
- `modelLink` – optional link for the upgrade recommendation
111112
- `migrationMarkdown` – optional markdown shown when presenting the upgrade
112113
- `nextCursor` – pass into the next request to continue paging (optional)
113114

114-
Breaking change: `model.upgrade` has been removed. Clients should migrate to `model.upgradeInfo?.model`.
115-
116115
## Collaboration modes (experimental)
117116

118117
Fetch the built-in collaboration mode presets with `collaborationMode/list`. This endpoint does not accept pagination and returns the full list in one response:

0 commit comments

Comments
 (0)