Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add echoVic/blade-code --skill capacity-lifecycle-and-egressgit clone --depth 1 https://github.com/echoVic/blade-codeWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/echovic/blade-code/capacity-lifecycle-and-egress)<a href="https://agentmods.dev/skills/echovic/blade-code/capacity-lifecycle-and-egress"><img src="https://agentmods.dev/badge/skills/echovic/blade-code/capacity-lifecycle-and-egress.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00177 | $0.03124 |
| Opus 5 | $0.00088 | $0.01562 |
| Sonnet 5 | $0.00035 | $0.00625 |
| Haiku 4.5 | $0.00018 | $0.00312 |
Grade A, and why
knowledge-capacity-lifecycle-and-egress scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
This is a copy
80% identical to knowledge-session-state-and-context — 117 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.
How it starts
The opening of the file, as written. The whole thing — 96 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Module Structure
该横切域用不同粒度的 reservation、permit、lease 和串行 egress 控制有限资源;每层都拥有独立队列、失败类型和释放责任,不能用一个全局 semaphore 替代。
Directory Layout
packages/cli/src/agent/runtime/SessionRuntimeResidency.ts— Web/ACP Runtime 驻留、pin、LRU 和 reservationpackages/cli/src/agent/runtime/TaskRunScheduler.ts— 顶层 Task active/pending count 与 retained bytespackages/cli/src/tools/execution/ConcurrencyScheduler.ts— 进程和 Session 两级工具公平准入packages/cli/src/tools/execution/ToolConcurrencyGate.ts— 单 executor 的 shared/exclusive FIFO 屏障packages/cli/src/services/pi/providerRequestAdmission.ts— Provider domain/owner/class 加权准入packages/cli/src/browser/BrowserOperationGate.ts— 单 Session Browser 操作串行化packages/cli/src/browser/BrowserProcessPool.ts— 共享 Chromium 与隔离 Context leasepackages/cli/src/utils/BoundedSerialEgress.ts— 通用有界单写者输出packages/cli/src/server/OrderedSseEgress.ts— replay/live 交接和 committed seq 顺序packages/cli/src/services/GracefulShutdown.ts— 信号、清理栈、Hook 和日志关闭packages/cli/src/utils/process/— owned process tree、admission gate 和 PID identity
Decision Entry
SessionRuntimeResidency.reserve()— 初始化前预留 Runtime 容量TaskRunScheduler.admit()— 顶层任务立即运行或进入 FIFO 队列ConcurrencyScheduler.schedule()— 按 Session round-robin 获取工具 permitProviderRequestAdmissionScheduler.admit()— 按 failure domain、root owner 和 request class 准入BrowserOperationGate.run()/BrowserProcessPool.acquire()— 页面操作与 Chromium Context 两级容量BoundedSerialEgress.offer()— 在保留输出前同步判定 item/byte 上限GracefulShutdownManager.shutdown()— 取消活动命令并有界执行清理
Branching Table
| 资源 | 有容量时 | 等待或可回收时 | 满载、失败或关闭时 |
|---|---|---|---|
| Session Runtime | reservation 计数后初始化并 commit lease | Web 可驱逐 idle、unpinned、canEvict 的 LRU resident |
ACP 不驱逐;无候选返回可重试 resident_runtimes |
| 顶层 Task | active slot 空闲则立即运行且不计 pending bytes | paused 或 active 满时按 FIFO 计 pending count/bytes | 任一 pending 上限命中即在执行前拒绝 |
| 工具进程级准入 | 同时满足 global/session total 与 kind 限额后执行 | 每个 Session 只取队首,跨 Session round-robin | queue full 或 180 秒等待超时返回 tool_busy |
| 工具批内 gate | 连续 shared 调用并发 | exclusive 调用作为 FIFO 屏障 | pending 超 64 或 close 时取消未启动调用 |
| Provider stream | 未配置并发旋钮时直接请求;配置后取得 physical-attempt permit | foreground 优先、owner round-robin,background/internal 可 aging | count/bytes/full/timeout 返回脱敏可重试错误 |
| Browser | 进程池复用一个 Chromium,每 Session 独立 Context,操作严格 FIFO | 最后一个 Context release 时关闭 Chromium | Context 或操作队列满分别返回 browser_capacity / browser_busy |
| Surface egress | 单 writer 按接纳顺序输出 | flush() 只等待调用时已接纳的 high-water mark |
overflow、oversized、write failure/timeout 关闭整条通道 |
| 进程关闭 | cleanup handlers 按注册逆序等待 | 单项失败继续执行其余 cleanup | 4 秒 cleanup budget 后报错,5 秒 hard timeout 强制退出 |
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 3d ago First seen · 96 lines · 177 tokens per session scan A 9afa39002f96
knowledge-capacity-lifecycle-and-egress is a skill published in the GitHub repository echoVic/blade-code (178 stars, last pushed yesterday), licensed MIT. It adds 177 tokens to every session and 3,124 once invoked, about $0.0009 per session on Opus 5. A static security scan graded it A with 0 findings. It is 80% identical to knowledge-session-state-and-context, differing in 117 lines, and is treated as a copy.
Other skills, from other repositories
smiles-validation
Strict SMILES validation, structural comparison, and modification verification. Catches invalid LLM-generated molecules.
tricorder-cli
Full CLI reference for the tricorder daemon (build diagnostics, test results, source lookup, eval comments, logs). This is the fallback invoked by the tricorder skill when the tricorder-mcp MCP tools aren't available or aren't working — invoke tricorder first; it decides whether this is needed.
tricorder-mcp
Check GHCi build status, diagnostics, and test results for this Haskell project via the tricorder MCP server. Use when asked to check the build, see compiler errors/warnings, or run tricorder.
tricorder
Check GHCi build status, compiler errors/warnings, or test results for this Haskell project. Use when asked to check the build, see errors/warnings, or run tricorder.
webapp-testing
Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.
systematic-debugging
4-phase root cause debugging: understand bugs before fixing.