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

A setting to turn off the models.dev catalog download (offline and strict-network use)

未关闭 适合新手
#4,714 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
72/100
Issue 类型
功能
描述清晰度
描述清楚
活跃度
活跃
技术栈
docker, go
领域
backend

调研方向

从 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 内容生成。

描述

area/config area/models

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=false for telemetry;
  • DOCKER_AGENT_AUTO_UPDATE for self-update;
  • DOCKER_AGENT_AUTO_INSTALL=false for tool install;
  • --otel is 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

环境准备

在 Codespaces 中打开

在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。

  • 提供 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 没有贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

docker/docker-agent 的其他 Issue

查看 docker/docker-agent 的全部 Issue

相似的 Issue

更多 Go Issue

把新 issue 发到你的邮箱

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