mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-07-25 17:18:11 +00:00
fix(codex): exclude models.github.ai from auxiliary cache retention
This commit is contained in:
parent
48049a1d31
commit
f54fa1bcb7
2 changed files with 15 additions and 1 deletions
|
|
@ -1066,7 +1066,10 @@ class _CodexCompletionsAdapter:
|
|||
|
||||
_host_src = str(getattr(self._client, "base_url", "") or "")
|
||||
_is_xai = base_url_host_matches(_host_src, "x.ai") or base_url_host_matches(_host_src, "api.x.ai")
|
||||
_is_github = base_url_host_matches(_host_src, "githubcopilot.com")
|
||||
_is_github = (
|
||||
base_url_host_matches(_host_src, "githubcopilot.com")
|
||||
or base_url_host_matches(_host_src, "models.github.ai")
|
||||
)
|
||||
_is_codex_backend = (
|
||||
base_url_host_matches(_host_src, "chatgpt.com")
|
||||
and "/backend-api/codex" in _host_src.lower()
|
||||
|
|
|
|||
|
|
@ -4989,6 +4989,17 @@ class TestCodexAdapterPromptCacheKey:
|
|||
])
|
||||
assert "prompt_cache_retention" not in captured
|
||||
|
||||
def test_prompt_cache_retention_skipped_for_github_models_host(self):
|
||||
"""models.github.ai is a GitHub Responses host in the main transport
|
||||
(agent/chat_completion_helpers.py) — the auxiliary path must exclude
|
||||
it from cache-retention emission the same way as githubcopilot.com."""
|
||||
adapter, captured = self._build_adapter(base_url="https://models.github.ai/inference")
|
||||
adapter.create(messages=[
|
||||
{"role": "system", "content": "SYS"},
|
||||
{"role": "user", "content": "hi"},
|
||||
])
|
||||
assert "prompt_cache_retention" not in captured
|
||||
|
||||
|
||||
class TestCodexAdapterGithubResponsesMessageIdDrop:
|
||||
"""_CodexCompletionsAdapter must drop codex_message_items ``id`` when
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue