Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

`uses_openai` gateway prefix is unreachable since any-llm retired the `gateway` provider

オープン
#23 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

@cyyecao-lappland がすでに取り組んでいます。

2026年10月2日 から。

  • #28 @cyyecao-lappland による — オープン
  • #30 @cyyecao-lappland による — オープン

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
42/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
python

調査の方向性

Start in tinyagent/agent.py with the provider parsing and AnyLLM.create flow. Reproduce the documented otari:openai and otari:anthropic cases, then settle whether the outer otari provider or inner provider should be instantiated. Done means gateway-prefixed model IDs no longer fail and the chosen routing preserves the intended uses_openai behavior.

索引モデルが issue の本文から書いたものです。

説明

tinyagent/agent.py strips a gateway: prefix before computing uses_openai:

provider_name, model_id = AnyLLM.split_model_provider(self.config.model_id)
if provider_name == "gateway":
    provider_name, model_id = AnyLLM.split_model_provider(model_id)
self.uses_openai = provider_name == LLMProvider.OPENAI

That branch can no longer run. any-llm migrated the gateway provider to otari (mozilla-ai/any-llm#1089) and then removed the gateway provider along with the GATEWAY value of the LLMProvider enum (mozilla-ai/any-llm#1122, merged 2026-06-12). split_model_provider raises on the first call, before the check is reached:

>>> AnyLLM.split_model_provider("gateway:openai:gpt-4.1-mini")
any_llm.exceptions.UnsupportedProviderError: 'gateway' is not a supported provider

any-llm kept the legacy GATEWAY_API_KEY and GATEWAY_API_BASE env vars inside the otari provider as the migration path, but deliberately did not keep a provider-name alias. So every gateway: model id has been broken since 2026-06-12.

Renaming the sentinel to otari restores the original semantics:

otari:openai:gpt-4.1-mini  -> uses_openai True
otari:anthropic:claude-3   -> uses_openai False

One design question is worth settling before that. The strip reassigns provider_name, which then flows into AnyLLM.create(provider_name, ...), so gateway:openai:gpt-4 built a plain OpenAI client and never instantiated the gateway provider at all; reaching the gateway required also passing api_base. That was reasonable when gateway was a thin OpenAI-compatible wrapper. OtariProvider is now a real SDK-backed provider with native /messages pass-through, batch support and cache_control preservation, so a straight rename would keep bypassing it.

Should otari:openai:gpt-4 route through OtariProvider, or keep resolving to the inner provider with the caller supplying api_base? That decides whether this is a one-word change or a behavior fix.

For context, any-agent has dropped its gateway: test coverage in mozilla-ai/any-agent#954, since the behavior lives here and otari: cannot stand in there without taking the otari SDK as a dependency.

Note: this issue was drafted by Claude Opus 5 via back-and-forth with @njbrake. The reasoning and decisions are his; the prose is Claude's.

主要言語
Python
スター
33
フォーク
7
PR マージ指標
30日以内にマージされた PR はありません

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

mozilla-ai/tinyagent のほかの issue

mozilla-ai/tinyagent の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。