AGENTS.md@internal/messagingA
AGENTS.md@internal/messaging from iohub/yagent is an AGENTS.md file: the standing instructions coding agents read in that repo.
mdr add iohub/yagent/internal/messaging/AGENTS.md@git:20261024.9b44441Pins git:20261024.9b44441 in mdr.lock. Pin the fingerprint instead.
- Audit grade
- A, 14 of 14 checks passed
- Kind
- AGENTS.md file
- Repository
- iohub/yagent
- Path
internal/messaging/AGENTS.md- Versions recorded
- 2
- Latest version
- git:20261024.9b44441, committed Oct 24, 2026
- First version recorded
- Oct 21, 2026
- Size
- 7,191 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/messaging — 事件总线 > 范围:本目录内不可派生的约束。全局见仓库根 `AGENTS.md` §6.6。 ## 边界 自研事件总线(`MessageDispatcher` / `Publisher` / 两代 Consumer 接口)与丢弃记账。 **不理解事件语义**——类型 SSOT 在 `protocol/agent-events.yaml`(但该文件与生成物已经落后于实际总线)。 ## 硬约束 **1. 同一条 `*Event` 会并发分发给多个消费者,消费者必须只读、禁止改字段** (包注释 `message_dispatcher.go:1-8`)。`Seq` 因此在 `Publish` 里"最后一次被写"(`:224-228`)。 **2. 普通事件满载即丢、绝不阻塞生产者;关键事件走独立旁路。** `user_help_needed` / `user_help_response` 永不丢(mutex+slice FIFO,防御上限 4096,超限 drop-oldest 并记 error)。只有"同一消费者、同一类别"承诺顺序(`:3-6,24-34,85-122`)。 **3. 绝不 close 事件 channel**——并发 send 会 panic。只 close `stop` + 原子标志,收尾由消费 goroutine 自己排空(`:8-9,304,351-372`)。 **4. 队列容量只有一处定义。** 生产 6 个建调度器的地方全部走 `NewDefaultMessageDispatcher()` (`message_dispatcher.go:150-158`;`main.go:317,394`、`internal/http/task_executor.go:35`、 `internal/http/websocket.go:182`、`internal/tui/tui_tasks.go:202,278`)。历史事实是六处都手写 `NewMessageDispatcher(100)`, 把文档承诺的 1000 压成十分之一,而**那个 1000 从来没生效过**——满载丢弃比设计早一个数量级发生, 表现是"界面偶尔少字",日志里只有一条限频 warn(根 AGENTS.md §11 坑 35)。不要再手写数字。 **5. 满载丢弃必须可被知道**:`Dropped()` 是总数,任务收尾调 `WarnDropped(scope)` (HTTP 任务 / 两个 TUI 闭包 / WS 会话各自报告)。 **6. 委派坐标由 `ForDelegation` 绑定一次,不是在 10 个发布点各传一遍** …
Read the whole file at its exact version.
How to install
mdr add iohub/yagent/internal/messaging/AGENTS.md@sha256:33e2cd7d03acbfe1The line at the top of this page pins the label git:20261024.9b44441, 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.
[](https://markdownregistry.com/a/art_tqjbjeuldhjtx6f5)
2 badge image fetches in 30 days. What the badge shows.
Versions
The registry has recorded 2 versions of this file, between Oct 21, 2026 and Oct 24, 2026, about one every 3 days.
| version | committed | commit | size | audit | |
|---|---|---|---|---|---|
| git:20261024.9b44441 latest | 2026-10-24 | 9b44441 | 7,191 B | A | view · diff |
| git:20261021.9f5bf87 | 2026-10-21 | 9f5bf87 | 4,123 B | A | view |
Audit of the latest version
- pass: Size between 200 bytes and 200 KB (7191 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
iohub/yagent · 31 stars · license Apache-2.0 · pushed 2026-11-05 · branch main
API
GET https://markdownregistry.com/api/v1/artifacts/art_tqjbjeuldhjtx6f5 GET https://markdownregistry.com/api/v1/resolve?ref=iohub/yagent/internal/messaging/AGENTS.md GET https://markdownregistry.com/api/v1/blob/33e2cd7d03acbfe1a03ac9e50dd2ac81a549c660fe3cdde52d01fe727dc72c74
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.