knowledge-model-and-provider-runtime-provider-resilience-admission-and-observability

knowledge-model-and-provider-runtime-provider-resilience-admission-and-observability is a skill for Claude Code, Codex from echoVic/blade-code. It costs 184 tokens per session (3,906 once invoked), scanned A, original, MIT.

A codebase guide for handling unreliable AI provider requests across agents and sessions, including retries, circuit breakers, fair queues, stalled streams, cache tracking, and health checks.

In plain words
What is it for?
Use it for provider recovery, retry rules, failure isolation, request admission, stream-stall handling, health monitoring, and cache or cost metrics.
Why use it?
It helps developers diagnose rate limits, server errors, timeouts, duplicate requests, capacity contention, and changes in prompt-cache performance.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions subagents.

Good fit Use it for provider recovery, retry rules, failure isolation, request admission, stream-stall handling, health monitoring, and cache or cost metrics.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/echovic/blade-code/provider-resilience-admission-and-observability
Install

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.

Any agent
npx skills add echoVic/blade-code --skill provider-resilience-admission-and-observability
Clone the repo
git clone --depth 1 https://github.com/echoVic/blade-code

Made for: Claude Code, Codex.

Wrote 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.

agentmods badge for knowledge-model-and-provider-runtime-provider-resilience-admission-and-observability

README.md
[![agentmods](https://agentmods.dev/badge/skills/echovic/blade-code/provider-resilience-admission-and-observability/github.svg)](https://agentmods.dev/skills/echovic/blade-code/provider-resilience-admission-and-observability)
Your own site
<a href="https://agentmods.dev/skills/echovic/blade-code/provider-resilience-admission-and-observability"><img src="https://agentmods.dev/badge/skills/echovic/blade-code/provider-resilience-admission-and-observability/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for knowledge-model-and-provider-runtime-provider-resilience-admission-and-observability

Your own site · 80×15
<a href="https://agentmods.dev/skills/echovic/blade-code/provider-resilience-admission-and-observability"><img src="https://agentmods.dev/badge/skills/echovic/blade-code/provider-resilience-admission-and-observability.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 184 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,906 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00184 $0.03906
Opus 5 $0.00092 $0.01953
Sonnet 5 $0.00037 $0.00781
Haiku 4.5 $0.00018 $0.00391

Measured 6d ago against content hash cd20bc775552, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

knowledge-model-and-provider-runtime-provider-resilience-admission-and-observability 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 6d 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.

.trae/knowledges/model-and-provider-runtime/provider-resilience-admission-and-observability/SKILL.md · 113 lines

How it starts

The opening of the file, as written. The whole thing — 113 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Module Structure

该节点不是单一模块,而是包围每条物理 Provider stream 的横切控制面。它根据请求类别、 失败类型、候选位置、输出边界和显式容量配置选择不同恢复路径,并向所有运行表面投影 同一组临时事件。

Directory Layout

  • packages/cli/src/services/PiAIChatService.ts — 恢复、熔断、准入、deadline 与 fallback 总编排
  • packages/cli/src/services/pi/providerRetry.ts — 错误分类、Retry-After 和退避
  • packages/cli/src/services/pi/providerCircuitBreaker.ts — 进程共享 Closed/Open/HalfOpen 状态机
  • packages/cli/src/services/pi/providerFailureDomain.ts — 敏感路由维度的规范化 HMAC 身份
  • packages/cli/src/services/pi/providerRequestAdmission.ts — 进程共享加权公平队列与 permit
  • packages/cli/src/services/pi/providerRequestFootprint.ts — 等待请求 retained-footprint 估算
  • packages/cli/src/services/pi/providerStall.ts — stall 生命周期契约
  • packages/cli/src/services/pi/promptCacheBreakMonitor.ts — Session 级缓存断裂归因
  • packages/cli/src/services/ProviderHealthService.ts — 受限、脱敏的真实 Provider 探测
  • packages/cli/src/api/promptCacheMetrics.ts — 缓存指标归一化和展示格式

Decision Entry

  • PiAIChatService.streamChat() in packages/cli/src/services/PiAIChatService.ts — 依据 recovery mode、request class、candidate index、circuit/admission 状态和首个真实 chunk 选择分支
  • classifyProviderRetry() in packages/cli/src/services/pi/providerRetry.ts — 将错误链和响应头归类为可重试或终止
  • ProviderRequestAdmissionScheduler.admit() in packages/cli/src/services/pi/providerRequestAdmission.ts — 决定立即运行、排队或按 count/bytes 拒绝

Branching Table

决策维度 分支 A 分支 B
准入是否启用 三个 concurrency 配置均未设置时不创建 scheduler,物理流直接访问 Provider 任一 concurrency 配置显式设置或注入 scheduler 时,所有 primary/retry/fallback/probe 先取 permit
请求类别 root 用户阻塞请求为 foreground,可携带 bounded recovery Subagent/Hook 为 background,健康探测等为 internal,不继承扩展恢复
Open circuit 与候选位置 非末 fallback 候选或 standard 请求立即拒绝该候选并继续 fallback/失败 bounded foreground 的末候选在原 recovery deadline 内等待唯一 HalfOpen probe
错误类型 408/409/429、5xx、transport、零输出 EOF 和 physical deadline 可进入有界重试 quota/context、caller abort、recovery budget、idle timeout 不重试同一候选
流式提交边界 首个真实 chunk 前的可重试失败可重放并切换 fallback text/reasoning/tool/usage/finish 任一已交付后 fail closed,不再重试或 fallback
容量状态 队列为空且 capacity 可用时立即运行,超大请求不计 pending bytes 必须等待时同时受 count、retained bytes 和 wait deadline 限制,0 表示 fail-fast
时间预算 admission 后启动每次 physical attempt 的 total deadline,语义事件只刷新 idle watchdog foreground recovery 启动后覆盖 backoff、排队、建连和 stream,并在更早/相等时保持权威错误原因
Prompt Cache 关闭缓存时清除 Session 基线;普通启用使用 short retention 带稳定 Session ID 的非官方 OpenAI-compatible completion endpoint 使用 long retention

Read the full file on GitHub · 113 lines

Changes

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.

  1. 6d ago First seen · 113 lines · 184 tokens per session scan A cd20bc775552

Subscribe to this mod's changes

knowledge-model-and-provider-runtime-provider-resilience-admission-and-observability is a skill published in the GitHub repository echoVic/blade-code (178 stars, last pushed yesterday), licensed MIT. It adds 184 tokens to every session and 3,906 once invoked, about $0.0009 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories

histolab

Lightweight WSI tile extraction and preprocessing. Use for basic slide processing tissue detection, tile extraction, stain normalization for H&E images. Best for simple pipelines, dataset preparation, quick tile-based analysis. For advanced spatial proteomics, multiplexed imaging, or deep learning pipelines use pathml.

synthetic-sciences/openscience · 62 tokens

shap

Model interpretability and explainability using SHAP (SHapley Additive exPlanations). Use this skill when explaining machine learning model predictions, computing feature importance, generating SHAP plots (waterfall, beeswarm, bar, scatter, force, heatmap), debugging models, analyzing model bias or fairness, comparing…

synthetic-sciences/openscience · 109 tokens

torch-geometric

Graph Neural Networks (PyG). Node/graph classification, link prediction, GCN, GAT, GraphSAGE, heterogeneous graphs, molecular property prediction, for geometric deep learning.

synthetic-sciences/openscience · 41 tokens

zarr-python

Chunked N-D arrays for cloud storage. Compressed arrays, parallel I/O, S3/GCS integration, NumPy/Dask/Xarray compatible, for large-scale scientific computing pipelines.

synthetic-sciences/openscience · 42 tokens

glycobiology

Glycosylation site prediction and glycobiology analysis. N-glycosylation motif finding, O-glycosylation hotspot prediction, glycan structure resources. Lightweight, pure Python. For protein function queries use uniprot-database; for structure analysis use alphafold-database.

synthetic-sciences/openscience · 67 tokens

pyhealth

Comprehensive healthcare AI toolkit for developing, testing, and deploying machine learning models with clinical data. This skill should be used when working with electronic health records (EHR), clinical prediction tasks (mortality, readmission, drug recommendation), medical coding systems (ICD, NDC, ATC)…

synthetic-sciences/openscience · 109 tokens