AGENTS.md@internal/llmA

AGENTS.md@internal/llm from iohub/yagent is an AGENTS.md file: the standing instructions coding agents read in that repo.

Install it, pinned
mdr add iohub/yagent/internal/llm/AGENTS.md@git:20261027.0637c8b

Pins git:20261027.0637c8b in mdr.lock. Pin the fingerprint instead.

Audit grade
A, 14 of 14 checks passed
Kind
AGENTS.md file
Repository
iohub/yagent
Path
internal/llm/AGENTS.md
Versions recorded
4
Latest version
git:20261027.0637c8b, committed Oct 27, 2026
First version recorded
Oct 21, 2026
Size
11,526 bytes
Repository stars
31
License
Apache-2.0

Collected from public GitHub. Every version is saved exactly as it was and never changes. Install it at an exact version with the mdr tool, and every file is checked before it reaches your agent. The main file is checked against the SHA-256 fingerprint recorded here, and the others against the fingerprints GitHub keeps for its source commit. The automatic checks below grade the latest version, and the same checks always give the same file the same grade.

What the file says

# internal/llm — 引擎、路由、故障转移、在飞闸门

> 范围:本目录内不可派生的约束。全局见仓库根 `AGENTS.md` §2.3 与 §6.3。

## 边界

`Engine` 抽象 + 两套协议实现(openai-go SDK / 自研 Anthropic Messages)、provider→引擎的解析与缓存、
auto-routing 三档、故障转移、进程级在飞闸门、以及**发出/读入的字节形状**。
不负责工具循环、不负责压缩阈值推导(`internal/compression`);输入 token 的**跨 provider 归一**在本包
(第 12 条),怎么展示是 `internal/tui` 的事。

## 硬约束

**1. 引擎构造函数收整个 `*config.ProviderConfig`,不收散参数**
(`engine_openai.go:36-40`、`engine_anthropic.go:111-112`)。散参数时每往 `ProviderConfig` 加一个键
就多一处"配置写了但没人读"——`max_tokens` 曾经正是这样失效的(请求体里根本没有它,thinking 模型
因此能一口气生成 39k token)。

**2. `0` 一律按"没配"处理,且不发这个字段**(`engine_openai.go:28-32,162-167`、
`engine_anthropic.go:100,269-279`)。优先级:`单次 CallOptions > provider 默认 > 不发`。
显式发 `temperature: 0` 会把服务端默认采样顶成贪心解码;`ProviderConfig.Temperature` 是裸
`float64`,分不清"写了 0.0"与"没写"。anthropic 侧未配 `max_tokens` 时兜底 8192(Messages API 必填)。

**3. 认不出的 `reasoning_effort` = 整个 thinking 字段缺席**(`engine_anthropic.go:304-316,323-336`)。
映射是 `low|medium|high|max → 1024/8192/24576/32000`;**绝不发 `budget_tokens: 0`**——provider 要求
≥1024,一个拼错的 effort 会让此后每次调用都 400。此时也不得连带把 `temperature` 钉成 1.0。
开思考时 `max_tokens` 至少 `budget+4096`。

**4. 在飞闸门是进程级,不是每引擎一份**(`inflight.go:8-19`):429 记在账号上,两个引擎各放 8 格
…

Read the whole file at its exact version.

How to install

The exact contents, by fingerprint
mdr add iohub/yagent/internal/llm/AGENTS.md@sha256:4c8befd99cf3fc28

The line at the top of this page pins the label git:20261027.0637c8b, which is what most people want. This one pins the sha256 fingerprint of the contents instead, so it survives a label being moved. Either way the exact version is written to mdr.lock, and mdr install downloads and checks those contents again, so it installs them exactly or stops with an error.

Badge

mdr badge

[![mdr](https://markdownregistry.com/badge/art_xicgnzlyoynv22pz.svg)](https://markdownregistry.com/a/art_xicgnzlyoynv22pz)

2 badge image fetches in 30 days. What the badge shows.

Versions

The registry has recorded 4 versions of this file, between Oct 21, 2026 and Oct 27, 2026, about one every 2 days.

versioncommittedcommitsizeaudit
git:20261027.0637c8b latest2026-10-27 0637c8b 11,526 BA view · diff
git:20261025.f70d95c2026-10-25 f70d95c 11,269 BA view · diff
git:20261024.9b444412026-10-24 9b44441 8,662 BA view · diff
git:20261021.9f5bf872026-10-21 9f5bf87 4,943 BA view

Audit of the latest version

A  14 of 14 checks passed. Fixed automatic checks with no AI involved, so the same checks give the same answer every run.
  • pass: Size between 200 bytes and 200 KB (11526 bytes)
  • pass: No zero-width or bidi control characters
  • pass: No instruction hidden inside an HTML comment
  • pass: No link to an exfiltration or paste host
  • pass: No credential-shaped string
  • pass: No instruction to send local credentials anywhere
  • pass: No text hidden with inline styles
  • pass: No prompt-injection phrasing
  • pass: No curl or wget piped into a shell
  • pass: No recursive delete of root, home or parent
  • pass: No instruction to read or print local credentials
  • pass: No base64 blob over 200 characters
  • pass: No link to a raw IP address
  • pass: No script tag

Source

GitHub

iohub/yagent · 31 stars · license Apache-2.0 · pushed 2026-11-05 · branch main

API

GET https://markdownregistry.com/api/v1/artifacts/art_xicgnzlyoynv22pz
GET https://markdownregistry.com/api/v1/resolve?ref=iohub/yagent/internal/llm/AGENTS.md
GET https://markdownregistry.com/api/v1/blob/4c8befd99cf3fc28a7c75ad208e1968c98fafa0a7ae272d5e4c664fbeccfe06c

Your AI assistant does the legwork. You hear about the deals worth your word. Hand yours the standing instructions at modelranch.com and it joins the network that reads files like this one.

Guides: how to write a good AGENTS.md · AGENTS.md vs CLAUDE.md · which agent file does what.

More from iohub/yagent

AGENTS.md AGENTS.md file
iohub/yagent · AGENTS.md
git:20261103.104f21a · audit A · 31 stars
AGENTS.md@internal AGENTS.md file
iohub/yagent · internal/AGENTS.md
git:20261026.7381d71 · audit A · 31 stars
AGENTS.md@internal/agents AGENTS.md file
iohub/yagent · internal/agents/AGENTS.md
git:20261103.104f21a · audit A · 31 stars
AGENTS.md@internal/agents/director AGENTS.md file
iohub/yagent · internal/agents/director/AGENTS.md
git:20261103.104f21a · audit A · 31 stars
AGENTS.md@internal/app AGENTS.md file
iohub/yagent · internal/app/AGENTS.md
git:20261024.9b44441 · audit A · 31 stars
AGENTS.md@internal/blackboard AGENTS.md file
iohub/yagent · internal/blackboard/AGENTS.md
git:20261026.89c0391 · audit A · 31 stars
AGENTS.md@internal/blueprint AGENTS.md file
iohub/yagent · internal/blueprint/AGENTS.md
git:20261026.9762922 · audit A · 31 stars
AGENTS.md@internal/browserctl AGENTS.md file
iohub/yagent · internal/browserctl/AGENTS.md
git:20261030.25a3126 · audit A · 31 stars
AGENTS.md@internal/compression AGENTS.md file
iohub/yagent · internal/compression/AGENTS.md
git:20261028.19903d6 · audit A · 31 stars
AGENTS.md@internal/config AGENTS.md file
iohub/yagent · internal/config/AGENTS.md
git:20261024.9b44441 · audit A · 31 stars
AGENTS.md@internal/http AGENTS.md file
iohub/yagent · internal/http/AGENTS.md
git:20261026.7381d71 · audit A · 31 stars
AGENTS.md@internal/mcp AGENTS.md file
iohub/yagent · internal/mcp/AGENTS.md
git:20261024.9b44441 · audit A · 31 stars

Every file in iohub/yagent

Browse by kind, by grade A, or by owner.