Skip to content

feat(providers): add Requesty, MiniMax and Forge - #159

Merged
Zongwei9888 merged 1 commit into
mainfrom
feat/b-tier-providers
Aug 6, 2026
Merged

feat(providers): add Requesty, MiniMax and Forge#159
Zongwei9888 merged 1 commit into
mainfrom
feat/b-tier-providers

Conversation

@Zongwei9888

Copy link
Copy Markdown
Collaborator

Description

Ports three provider contributions that could not merge as submitted. #138 and #130 also touched new_ui/ and nanobot/; #116 targeted nanobot/ only. Those trees were removed in the v2.0 refactor — but the provider work itself applies unchanged to core/providers.

Supersedes #138, #130 and #116.

Why a dedicated ProviderSpec, rather than telling users to use custom

Each spec unlocks behaviour custom cannot express:

Provider Spec field What it buys
Forge (#116) strip_model_prefix=True Forge resolves bare model ids. Configured through custom, a habitual anthropic/claude-3 would be sent verbatim and fail.
Requesty (#138) supports_prompt_caching=True Injects cache_control for Claude models routed through it. Through custom there is no caching — a real cost difference for an agent replaying long contexts.
MiniMax (#130) keywords, default_api_base Convenience: MiniMax-M2 selects the provider automatically and the base URL is preset. Lowest marginal value of the three; custom works.

Both halves, not just the registry

config.py resolves providers with getattr(self.providers, spec.name, None), so a ProviderSpec without a matching ProvidersConfig field is silently skipped everywhere. All three get the registry entry and the config field, as the ProvidersConfig docstring requires. zhipu is the reference for the minimal-complete shape.

Endpoints verified reachable: router.requesty.ai (200), api.minimax.io (401), api.forge.tensorblock.co (401).

Bonus: a gateway bug #116 found, which core had half-fixed

_setup_env() forced spec.env_key for gateways but still used setdefault for env_extras:

if spec.is_gateway:
    os.environ[spec.env_key] = api_key      # gateway wins
else:
    os.environ.setdefault(spec.env_key, api_key)
...
for env_name, env_val in spec.env_extras:
    os.environ.setdefault(env_name, resolved)   # gateway does NOT win

A stale ambient variable therefore outranked the gateway the user had selected. #116 fixed exactly this in nanobot's provider; the same rule now applies to env_extras here. Latent on main today (only zhipu uses env_extras, and it is not a gateway), but it would bite the first gateway that needs one.

What was dropped from the originals

The tests covering new_ui's requesty_models service and nanobot's registry. One of them did pytest.importorskip("nanobot.config.schema"), which now resolves to an unrelated PyPI package (nanobot-ai) when that happens to be installed — so it fails locally and skips in CI, testing nothing either way.

Testing

  • Full suite: 1154 passed, 3 skipped (main baseline 1131; +23 = Requesty 5, MiniMax 12, Forge 6)
  • pre-commit run --from-ref origin/main --to-ref HEAD — clean
  • The env_extras fix is verified in reverse: reverting it fails test_gateway_env_extras_override_ambient_values

Not verified: strip_model_prefix=True for Forge. Confirming it needs a Forge API key. The value is carried over from the author's nanobot spec and matches how AiHubMix was handled in that registry. It only affects users who explicitly configure Forge.

Unrelated flake spotted while validating

tests/application/test_automation_goal_runs.py::test_legacy_unreserved_turn_is_never_adopted_as_automation_initial_turn fails intermittently with timed out waiting for Run ... to become completed. Measured in isolation: 2/20 on clean main, 0/20 on this branch. Pre-existing, not from this PR — but it will redden CI at random and deserves its own issue.

Ports three provider contributions that could not merge as submitted: #138
and #130 also touched new_ui/ and nanobot/, and #116 targeted nanobot/ only.
Those trees were removed in the v2.0 refactor. The provider work itself
applies unchanged to core/providers.

ProvidersConfig reads each provider via getattr(providers, spec.name), so a
ProviderSpec without a matching field is silently skipped — all three get both
halves, as the ProvidersConfig docstring requires.

Endpoints verified reachable: router.requesty.ai (200), api.minimax.io (401),
api.forge.tensorblock.co (401).

Also fixes a gateway bug #116 found in nanobot's provider that core had only
half-fixed: spec.env_key was forced for gateways, but env_extras still used
setdefault, so a stale ambient variable outranked the gateway the user picked.

Dropped from the originals: the tests covering new_ui's requesty_models
service and nanobot's registry. One of those imported "nanobot.config.schema",
which now resolves to an unrelated PyPI package (nanobot-ai) when installed —
it fails locally and skips in CI, testing nothing either way.

Co-authored-by: Thibault Jaigu <thibault.jaigu@gmail.com>
Co-authored-by: Yiiii0 <yiqiaozhou@outlook.com>
Co-authored-by: octo-patch <octo-patch@github.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@Zongwei9888
Zongwei9888 force-pushed the feat/b-tier-providers branch from b69d684 to b737060 Compare August 6, 2026 10:04
@Zongwei9888
Zongwei9888 merged commit ee16f41 into main Aug 6, 2026
14 checks passed
@Zongwei9888
Zongwei9888 deleted the feat/b-tier-providers branch August 6, 2026 16:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant