Skip to content

Commit 94cf78c

Browse files
authored
Merge pull request #290 from GitHubSecurityLab/p--rem-gh-models
chore: remove references to GitHub models
2 parents 31df912 + 8999af4 commit 94cf78c

4 files changed

Lines changed: 3 additions & 54 deletions

File tree

‎src/seclab_taskflow_agent/capi.py‎

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
"""AI API endpoint and token management.
55
6-
Supports multiple API providers (GitHub Copilot, GitHub Models, OpenAI, and
6+
Supports multiple API providers (GitHub Copilot, OpenAI, and
77
custom endpoints). All provider-specific behaviour is captured in a single
88
``APIProvider`` dataclass so that adding a new provider only requires one
99
registry entry instead of changes scattered across multiple match/case blocks.
@@ -91,19 +91,6 @@ def check_tool_calls(self, _model: str, model_info: dict) -> bool:
9191
)
9292

9393

94-
class _GitHubModelsProvider(APIProvider):
95-
"""GitHub Models API (models.github.ai)."""
96-
97-
def parse_models_list(self, body: Any) -> list[dict]:
98-
# Models API returns a bare list, not {"data": [...]}
99-
if isinstance(body, list):
100-
return body
101-
return super().parse_models_list(body)
102-
103-
def check_tool_calls(self, _model: str, model_info: dict) -> bool:
104-
return "tool-calling" in model_info.get("capabilities", [])
105-
106-
10794
class _OpenAIProvider(APIProvider):
10895
"""OpenAI API (api.openai.com).
10996
@@ -127,12 +114,6 @@ def check_tool_calls(self, _model: str, model_info: dict) -> bool:
127114
default_model="gpt-4.1",
128115
extra_headers={"Copilot-Integration-Id": COPILOT_INTEGRATION_ID},
129116
),
130-
"models.github.ai": _GitHubModelsProvider(
131-
name="github-models",
132-
base_url="https://models.github.ai/inference",
133-
models_catalog="/catalog/models",
134-
default_model="openai/gpt-4.1",
135-
),
136117
"api.openai.com": _OpenAIProvider(
137118
name="openai",
138119
base_url="https://api.openai.com/v1",

‎tests/test_api_endpoint_config.py‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class TestAPIEndpoint:
1717
"""Test API endpoint configuration."""
1818

1919
def test_default_api_endpoint(self):
20-
"""Test that default API endpoint is set to models.github.ai/inference."""
20+
"""Test that the default API endpoint is GitHub Copilot."""
2121
try:
2222
original_env = os.environ.pop("AI_API_ENDPOINT", None)
2323
endpoint = get_AI_endpoint()
@@ -41,7 +41,6 @@ def test_api_endpoint_env_override(self):
4141

4242
def test_provider_base_urls(self):
4343
"""Test that providers resolve to expected base URLs."""
44-
assert get_provider("https://models.github.ai/inference").base_url == "https://models.github.ai/inference/"
4544
assert get_provider("https://api.githubcopilot.com").base_url == "https://api.githubcopilot.com/"
4645
assert get_provider("https://api.openai.com/v1").base_url == "https://api.openai.com/v1/"
4746

‎tests/test_capi_extended.py‎

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -45,28 +45,6 @@ def test_copilot_endpoint_without_capabilities(self, monkeypatch):
4545
}
4646
assert supports_tool_calls("text-only", models) is False
4747

48-
def test_models_github_endpoint(self, monkeypatch):
49-
"""models.github.ai checks for 'tool-calling' in capabilities list."""
50-
monkeypatch.setenv("AI_API_ENDPOINT", "https://models.github.ai/inference")
51-
models = {
52-
"openai/gpt-4o": {
53-
"id": "openai/gpt-4o",
54-
"capabilities": ["tool-calling", "chat"],
55-
}
56-
}
57-
assert supports_tool_calls("openai/gpt-4o", models) is True
58-
59-
def test_models_github_endpoint_no_tool_calling(self, monkeypatch):
60-
"""models.github.ai returns False when 'tool-calling' not in list."""
61-
monkeypatch.setenv("AI_API_ENDPOINT", "https://models.github.ai/inference")
62-
models = {
63-
"some-model": {
64-
"id": "some-model",
65-
"capabilities": ["chat"],
66-
}
67-
}
68-
assert supports_tool_calls("some-model", models) is False
69-
7048
def test_openai_endpoint_model_in_catalog(self, monkeypatch):
7149
"""OpenAI endpoint returns True for known chat model families."""
7250
monkeypatch.setenv("AI_API_ENDPOINT", "https://api.openai.com/v1")
@@ -118,12 +96,6 @@ def test_copilot_provider(self):
11896
assert p.base_url == "https://api.githubcopilot.com/"
11997
assert "Copilot-Integration-Id" in p.extra_headers
12098

121-
def test_github_models_provider(self):
122-
p = get_provider("https://models.github.ai/inference")
123-
assert p.name == "github-models"
124-
assert p.models_catalog == "/catalog/models"
125-
assert p.default_model == "openai/gpt-4.1"
126-
12799
def test_openai_provider(self):
128100
p = get_provider("https://api.openai.com/v1")
129101
assert p.name == "openai"

‎tests/test_sdk_anthropic_adapter.py‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -222,15 +222,12 @@ def test_call_tool_result_to_text_preserves_empty_among_nonempty():
222222

223223

224224
def test_known_provider_uses_bearer_auth():
225-
"""Known providers (CAPI, GitHub Models) should have bearer_auth=True."""
225+
"""Known providers like CAPI should have bearer_auth=True."""
226226
from seclab_taskflow_agent.capi import get_provider
227227

228228
provider = get_provider("https://api.githubcopilot.com")
229229
assert provider.bearer_auth is True
230230

231-
provider = get_provider("https://models.github.ai/inference")
232-
assert provider.bearer_auth is True
233-
234231

235232
def test_unknown_endpoint_uses_native_auth():
236233
"""Unknown endpoints should default to native SDK auth (bearer_auth=False)."""

0 commit comments

Comments
 (0)