Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

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

未关闭
#23 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

@cyyecao-lappland 已经在做这个了。

开始于 2026年10月2日。

  • #28 来自 @cyyecao-lappland —— 未关闭
  • #30 来自 @cyyecao-lappland —— 未关闭

评估

难度
5/5
预计耗时
一周以上
新手友好度
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. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

mozilla-ai/tinyagent 的其他 Issue

查看 mozilla-ai/tinyagent 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。