A setting to turn off the models.dev catalog download (offline and strict-network use)
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
从 pkg/modelsdev/store.go 开始:阅读 fetchFromAPI、loadDatabase 和 getDatabase,了解 allowFetch 标志如何已经控制网络路径,以及缓存和内嵌快照作为后备的工作方式。提议是添加一个环境设置(例如 DOCKER_AGENT_OFFLINE 或 DOCKER_AGENT_MODELS_DEV=off),使 getDatabase 的行为如同 allowFetch=false。查看像 TELEMETRY_ENABLED 这样的现有开关是如何解析和编写文档的,照此办理,并添加一个测试,验证目录从缓存/快照提供且不进行任何网络调用。已完成:该设置阻止从 https://models.dev/api.json 进行任何 fetch,且现有测试仍然通过。
由索引模型根据 Issue 内容生成。
描述
What happens
On v1.152.0, docker-agent run downloads the public model catalog from https://models.dev/api.json. That's pkg/modelsdev/store.go, fetchFromAPI. It caches the catalog for 24 hours in $XDG_CACHE_HOME/cagent/models_dev.json. When a deployment gives each session its own HOME, which is common when docker-agent runs as a sandboxed agent runtime, that means one download per new session per day.
The other outbound paths each have a switch:
TELEMETRY_ENABLED=falsefor telemetry;DOCKER_AGENT_AUTO_UPDATEfor self-update;DOCKER_AGENT_AUTO_INSTALL=falsefor tool install;--otelis opt-in.
The catalog download is the one an operator can't turn off.
Why a switch would be enough
The store already handles a failed or blocked download. loadDatabase falls back to the cache, and then to the snapshot embedded at build time (the behaviour #3165 made explicit). So a setting that skips the download and goes straight to cache-or-embedded would only formalise a path that already works.
That matters for deployments that must not make outbound calls beyond the model provider they configured: air-gapped installs, strict egress policies, or self-hosters who want only the calls they asked for.
Proposal
Something like DOCKER_AGENT_OFFLINE=1, or a narrower DOCKER_AGENT_MODELS_DEV=off. It would make getDatabase behave as allowFetch=false: cache if present, otherwise the embedded snapshot, and never the network.
We run docker-agent as one of the agent runtimes in the open-source HarnessRouter. For now, our docs tell self-hosters that it fetches from models.dev and that the host can be blocked. A switch would let us turn it off by default. Thanks for considering it.
- 主要语言
- Go
- 星标
- 4.6k
- 派生
- 529
- 平均合并
- 13 小时 30 分钟
- 30 天内合并 PR
- 172
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 提供 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 没有贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
docker/docker-agent 的其他 Issue
-
Error when trying to run sandbox example?可能已有人在做 @dgageot 于 6 天前认领。 未关闭area/cli
难度 2/5 1-3 小时 新手友好度 62/100
docker/docker-agent#4672 · 1 条评论 · 1 个 reaction · 已指派 1 人 ·
维护者通常 1 天内回复
-
pkg/hooks tests fail with a misleading assertion when jq is not installed可能已有人在做 @dwin-gharibi 于 64 天前认领。 未关闭area/testing
难度 2/5 1-3 小时 新手友好度 86/100
docker/docker-agent#4052 ·
维护者通常 1 天内回复
-
`remove_directory` and `create_directory` hide work they already did when a later path fails可能已有人在做 @dwin-gharibi 于 82 天前认领。 未关闭area/tools
难度 2/5 1-3 小时 新手友好度 85/100
docker/docker-agent#3933 ·
维护者通常 1 天内回复
-
`edit_file` silently edits the first match when `oldText` occurs more than once可能已有人在做 @dwin-gharibi 于 82 天前认领。 未关闭area/tools
难度 2/5 1-3 小时 新手友好度 78/100
docker/docker-agent#3929 · 2 条评论 ·
维护者通常 1 天内回复
-
Allow enabling the streamable-HTTP standalone SSE stream from YAML for remote MCP toolsets可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭area/config area/mcp area/tools
难度 3/5 1-2 天 新手友好度 72/100
docker/docker-agent#4722 ·
维护者通常 1 天内回复
查看 docker/docker-agent 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 82/100
-
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复
-
enhancement
难度 1/5 1-3 小时 新手友好度 76/100
superplanehq/superplane#9007 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
-
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复