Skip to content

Commit d198f66

Browse files
committed
fix(app-server): preserve v2 response fields
1 parent 5382e96 commit d198f66

3 files changed

Lines changed: 25 additions & 2 deletions

File tree

codex/app_server/models.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ class ReasoningEffortOption(AppServerResultModel):
7171

7272

7373
class ModelInfo(AppServerResultModel):
74+
additional_speed_tiers: list[str] | None = Field(default_factory=list)
7475
availability_nux: ModelAvailabilityNux | None = None
7576
default_reasoning_effort: protocol.ReasoningEffort
7677
description: str
@@ -110,6 +111,7 @@ class SkillInterface(AppServerResultModel):
110111
class SkillInfo(AppServerResultModel):
111112
name: str
112113
description: str
114+
dependencies: protocol.SkillDependencies | None = None
113115
enabled: bool
114116
path: str
115117
scope: str
@@ -120,7 +122,7 @@ class SkillInfo(AppServerResultModel):
120122
class SkillsListEntry(AppServerResultModel):
121123
cwd: str
122124
skills: list[SkillInfo]
123-
errors: list[str] = Field(default_factory=list)
125+
errors: list[protocol.SkillErrorInfo] = Field(default_factory=list)
124126

125127

126128
class SkillsListResult(AppServerResultModel):

codex/app_server/options.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -519,6 +519,10 @@ class AppServerThreadListOptions(_AppServerOptionsModel):
519519
default=None,
520520
description="Sent as thread/list sortKey.",
521521
)
522+
sort_direction: protocol.SortDirection | None = Field(
523+
default=None,
524+
description="Sent as thread/list sortDirection.",
525+
)
522526
source_kinds: list[protocol.ThreadSourceKind] | None = Field(
523527
default=None,
524528
description="Sent as thread/list sourceKinds.",

tests/test_app_server_client.py

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ def _model_list_payload() -> JsonObject:
107107
"id": "gpt-5.4",
108108
"model": "gpt-5.4",
109109
"displayName": "GPT-5.4",
110+
"additionalSpeedTiers": ["flex"],
110111
"description": "Primary model",
111112
"hidden": False,
112113
"defaultReasoningEffort": "medium",
@@ -578,6 +579,7 @@ def test_app_server_turn_and_list_options_use_protocol_owned_types() -> None:
578579
input=[{"type": "text", "text": "Summarize this repo."}],
579580
)
580581
list_params = AppServerThreadListOptions(
582+
sort_direction=protocol.SortDirection("asc"),
581583
sort_key=protocol.ThreadSortKey("updated_at"),
582584
source_kinds=[protocol.ThreadSourceKind("appServer")],
583585
).to_params()
@@ -594,6 +596,7 @@ def test_app_server_turn_and_list_options_use_protocol_owned_types() -> None:
594596
"threadId": "thr-1",
595597
}
596598
assert list_params.model_dump(mode="python", by_alias=True, exclude_none=True) == {
599+
"sortDirection": "asc",
597600
"sortKey": "updated_at",
598601
"sourceKinds": ["appServer"],
599602
}
@@ -1334,6 +1337,9 @@ def list_skills(message: JsonObject) -> JsonObject:
13341337
"name": "skill-creator",
13351338
"description": "Create a skill",
13361339
"enabled": True,
1340+
"dependencies": {
1341+
"tools": [{"type": "cli", "value": "git"}],
1342+
},
13371343
"interface": {
13381344
"displayName": "Skill Creator",
13391345
"shortDescription": "Create or update skills",
@@ -1347,7 +1353,12 @@ def list_skills(message: JsonObject) -> JsonObject:
13471353
"scope": "repo",
13481354
}
13491355
],
1350-
"errors": [],
1356+
"errors": [
1357+
{
1358+
"message": "missing dependency",
1359+
"path": "/repo/.codex/skills/broken/SKILL.md",
1360+
}
1361+
],
13511362
}
13521363
]
13531364
},
@@ -1755,10 +1766,16 @@ def windows_sandbox_setup_start(message: JsonObject) -> JsonObject:
17551766
windows_setup = await client.windows_sandbox.setup_start(mode="elevated", cwd="C:/repo")
17561767

17571768
assert models[0].display_name == "GPT-5.4"
1769+
assert models[0].additional_speed_tiers == ["flex"]
17581770
assert model_page.data[0].display_name == "GPT-5.4"
1771+
assert model_page.data[0].additional_speed_tiers == ["flex"]
17591772
assert apps[0].id == "demo-app"
17601773
assert app_page.data[0].id == "demo-app"
17611774
assert skills[0].cwd == "/repo"
1775+
assert skills[0].errors[0].message == "missing dependency"
1776+
assert skills[0].errors[0].path == "/repo/.codex/skills/broken/SKILL.md"
1777+
assert skills[0].skills[0].dependencies is not None
1778+
assert skills[0].skills[0].dependencies.tools[0].value == "git"
17621779
assert skills[0].skills[0].interface is not None
17631780
assert skills[0].skills[0].interface.display_name == "Skill Creator"
17641781
assert skills[0].skills[0].short_description == "Create or update skills"

0 commit comments

Comments
 (0)