Skip to content

The agent that grows with you

fix(copilot): offline Astra effort fallback matches the exact Astra slugs

kshitijk4poore991bfe24ade
diff --git a/agent/auxiliary_client.py b/agent/auxiliary_client.py
index 867bc6879d2..c6e76c5749f 100644
--- a/agent/auxiliary_client.py
+++ b/agent/auxiliary_client.py
@@ -1505,7 +1505,7 @@ class _CodexCompletionsAdapter:
resp_kwargs["service_tier"] = service_tier.strip()
reasoning_cfg = extra_body.get("reasoning")
if isinstance(reasoning_cfg, dict):
- # Shared per-model vocabulary with the main transport ("max" is gpt-5.6-only; "minimal"/"ultra"
+ # Shared per-model vocabulary with the main transport ("max" only where the model publishes it; "minimal"/"ultra"
# rejected; ``()`` = the model takes no ``reasoning`` field at all — gpt-4o/4.1 on api.openai.com,
# #76255). ``enabled: False`` goes on the wire as ``effort: none`` where the vocabulary has it,
# since an omitted field leaves the model's default effort on (#75227).
diff --git a/hermes_cli/models.py b/hermes_cli/models.py
index c06f2fcbce1..31615e63430 100644
--- a/hermes_cli/models.py
+++ b/hermes_cli/models.py
@@ -534,7 +534,7 @@ _nous_caps_disk_checked = False
_nous_caps_warm_started = False
-from agent.reasoning_effort import clamp_effort as _clamp_effort, is_astra_model
+from agent.reasoning_effort import CODEX_ASTRA_EFFORTS, clamp_effort as _clamp_effort, is_astra_model
def clamp_reasoning_effort_to_supported(
@@ -2352,9 +2352,7 @@ def _github_reasoning_efforts_for_model_id(model_id: str) -> list[str]:
if raw.startswith(("openai/o1", "openai/o3", "openai/o4", "o1", "o3", "o4")):
return list(COPILOT_REASONING_EFFORTS_O_SERIES)
normalized = normalize_copilot_model_id(model_id).lower()
- if normalized.startswith("gpt-6-astra"):
- from agent.reasoning_effort import CODEX_ASTRA_EFFORTS
-
+ if is_astra_model(normalized):
return list(CODEX_ASTRA_EFFORTS)
if normalized.startswith("gpt-5"):
return list(COPILOT_REASONING_EFFORTS_GPT5)
diff --git a/tests/agent/transports/test_codex_transport.py b/tests/agent/transports/test_codex_transport.py
index 139767cee4f..e3eb50040f9 100644
--- a/tests/agent/transports/test_codex_transport.py
+++ b/tests/agent/transports/test_codex_transport.py
@@ -59,6 +59,16 @@ class TestCodexBuildKwargs:
)
assert kw.get("reasoning") == ({"effort": expected} if expected else None)
+ @pytest.mark.parametrize("model, expected", [
+ ("gpt-6-astra", ["low", "medium", "high", "xhigh", "max"]),
+ ("openai/gpt-6-astra", ["low", "medium", "high", "xhigh", "max"]),
+ ("gpt-6-astra-pro", []), # speed-tier / unknown suffixes stay off the Astra ladder
+ ])
+ def test_copilot_offline_astra_efforts_use_exact_slug(self, model, expected):
+ from hermes_cli.models import github_model_reasoning_efforts
+
+ assert github_model_reasoning_efforts(model, catalog=[]) == expected
+
def test_astra_direct_request_applies_model_contract_after_overrides(self, transport):
kw = transport.build_kwargs(
model="gpt-6-astra",