Repository navigation
Conversation
[Medium impact] The change affects users who choose Runcrate for their model calls. The PR appears safe to merge, with a non-blocking fix to make the new test independent of local overrides.
|
Comment on lines
+127
to
+128
| monkeypatch.setenv("RUNCRATE_API_KEY", "rc-test") | ||
| monkeypatch.setattr(providers, "get_credential", lambda name: None) |
There was a problem hiding this comment.
Local overrides break the test
If a developer has RUNCRATE_BASE_URL or RUNCRATE_MODEL set, resolve() correctly uses that override, but this test fails because it expects the defaults. Clear both variables with monkeypatch.delenv(..., raising=False) before resolving so the test does not depend on the developer’s environment.
Suggested change
| monkeypatch.setenv("RUNCRATE_API_KEY", "rc-test") | |
| monkeypatch.setattr(providers, "get_credential", lambda name: None) | |
| monkeypatch.setenv("RUNCRATE_API_KEY", "rc-test") | |
| monkeypatch.delenv("RUNCRATE_BASE_URL", raising=False) | |
| monkeypatch.delenv("RUNCRATE_MODEL", raising=False) | |
| monkeypatch.setattr(providers, "get_credential", lambda name: None) |
Prompt To Fix With AI
This is a comment left during a code review.
Path: tests/test_providers.py
Line: 127-128
Comment:
**Local overrides break the test**
If a developer has `RUNCRATE_BASE_URL` or `RUNCRATE_MODEL` set, `resolve()` correctly uses that override, but this test fails because it expects the defaults. Clear both variables with `monkeypatch.delenv(..., raising=False)` before resolving so the test does not depend on the developer’s environment.
```suggestion
monkeypatch.setenv("RUNCRATE_API_KEY", "rc-test")
monkeypatch.delenv("RUNCRATE_BASE_URL", raising=False)
monkeypatch.delenv("RUNCRATE_MODEL", raising=False)
monkeypatch.setattr(providers, "get_credential", lambda name: None)
```
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi, thanks for building OpenHack; this adds Runcrate to the bring-your-own-key provider list next to DeepInfra, Cerebras and the others.
Summary
Adds a
runcrateentry to the provider registry inopenhack/providers.py. Runcrate is an AI cloud with an OpenAI-compatible inference API for open-weight models, so it uses the same code path as the other OpenAI-compatible providers: base URLhttps://api.runcrate.ai/v1, key fromRUNCRATE_API_KEY(or a saved credential), default modelQwen/Qwen3-235B-A22B-Instruct-2507, which is in the public model list athttps://api.runcrate.ai/v1/modelsand advertises tool calling there. It is a long-tail entry likedeepinfra, so the curated picker list is unchanged.Changes
openhack/providers.py: theruncrateProviderSpec.tests/test_providers.py:resolve("runcrate")returns the base URL, key from the environment and the default model, and reportsRUNCRATE_API_KEYas the missing key when it is unset.How I tested
In a Python 3.14 venv created with
uv venvanduv pip install -e '.[dev]' pytest pytest-asyncio:pytest tests/test_providers.py tests/test_provider_picker.py: 46 passed.pytest(full suite): 513 passed.I did not make an authenticated chat call; I only checked that the default model id appears in the public
/v1/modelsresponse.Disclosure: I work on Runcrate.
This PR was prepared with AI assistance (omp with Claude): the code, tests and this description were written with it, and the tests listed above were run as part of preparing it.