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 agentmods add agents/modelstudioai/cli/error-hint-changegit clone --depth 1 https://github.com/modelstudioai/cliWhat 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 | $0.00000 | $0.02078 |
| Opus 5 | $0.00000 | $0.01039 |
| Sonnet 5 | $0.00000 | $0.00416 |
| Haiku 4.5 | $0.00000 | $0.00208 |
Grade A, and why
error-hint-change 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 yesterday.
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.
How it starts
The opening of the file, as written. The whole thing — 133 lines — stays where its author put it; the contents beside it link to each section on GitHub.
错误文案变更
触发条件
- 修改
BailianError的 message 或 hint - 调整 runtime 的 hint 增强逻辑(
enhanceHint) - 改 auth stage / resolver 的鉴权失败文案
- 改任何抛错位置的分类(exitCode)
注意:
mapApiError不再做错误分类(参见下方"边界原则")。如果你想给某种 HTTP 错误码加白名单分类,请先回到本文档读完"边界原则"再说。
边界原则:CLI 不翻译服务端错误
CLI 只为「自己能权威解释的错误」发出语义化信号,服务端的错误原样透传。
| 错误来源 | 归类 | 处理方式 |
|---|---|---|
| 命令解析、缺 flag、参数校验 | 内部 | BailianError(USAGE) |
| 文件 I/O(ENOENT/EACCES/...) | 内部 | BailianError(GENERAL) + errno-specific hint |
| 本地 credentials 缺失(resolver / authStage 等) | 内部 | BailianError(AUTH) |
fetch 自身失败(DNS/TCP/TLS/proxy) |
内部 | BailianError(NETWORK) + 读 err.cause.code 给 errno-hint |
| polling 客户端超时 | 内部 | BailianError(TIMEOUT) |
| HTTP 4xx/5xx、HTTP 200 + 业务错码、async task FAILED | 服务 | BailianError(GENERAL),message 原样透传,不分类、不替换 |
判断标准:错误信息的"权威来源"在哪一侧 —— 来自服务端响应 → 服务错误,透传;来自本地(OS / Node / CLI 自己)→ 内部错误,包装。
反面 case(为什么这条原则是必要的)
历史上的几个错误处理 bug 都是因为越过了这条边界:
mapApiError白名单未覆盖 OpenAI 兼容错误码 ——qwen3.7不存在时服务端返回invalid_request_error,白名单只认ModelNotFound,fall through 到 GENERAL,该是 USAGE 信号被丢bl auth login用 try/catch 替换错误 —— key 有效但缺模型权限时,显示"API key validation failed"撒谎,误导用户去换 keyerror-handler.ts用 message 关键词归并网络错误 —— ENOTFOUND / ECONNREFUSED / TLS 错误全归并成"Network request failed.",错误根源完全丢失
共同根因:我们试图在没有"权威信息"的位置代理服务端做分类。修复方案是统一退回到透传 + 让本地错误的真实诊断浮上来。
错误流的分层架构
core 抛出 BailianError(message, exitCode, hint, cause?)
↓ 沿调用栈冒泡
runtime/create-cli.ts: dispatch().catch(handleError)
↓
runtime/error-handler.ts:
- 服务端错误(BailianError(GENERAL)) → text 直接打 message
- 内部 AUTH/USAGE/NETWORK/TIMEOUT → 走 enhanceHint(只 AUTH 还有增强)
- TypeError("fetch failed") → 读 err.cause.code 翻成 NETWORK
- Node fs errno → 翻成 GENERAL + errno hint
- `--output json` → stderr 输出两空格缩进的多行 error JSON;前面已有结构化 warning 时,两个 diagnostics 以空行分隔
- 其它 Error → 默认走 cause 链
↓
process.exit(err.exitCode)
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.
- yesterday First seen · 133 lines · 0 tokens per session scan A d9e28aa8720e
error-hint-change is an agent published in the GitHub repository modelstudioai/cli (320 stars, last pushed 4d ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 2,078 tokens. 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-08-30.
Other agents, from other repositories
index
Browse built-in Agent Framework capabilities for multimodal input, tools, retrieval, evaluation, security, and autonomous execution.
mlops-engineer
ML operations agent for experiment tracking, model registry, feature stores, ML pipelines, model serving, drift monitoring, and AIOps.
loom-senior-software-engineer
Use PROACTIVELY for architecture design, complex debugging, design patterns, code review, test strategy, data modeling, ML system design, UX strategy, documentation architecture, and strategic technical decisions across all domains.
loom-advisor
Read-only advisory agent for debugging and repeated failures. Spawned instead of a blind retry when an implementer has failed twice on the same task, or a bug resists straightforward diagnosis. Returns a root-cause diagnosis plus one concrete next step.
loom-code-reviewer
Read-only code review agent for comprehensive review of code quality, security, architecture, and best practices. Cannot modify files.
integrity-check
Detect adversarial content in .rune/ files — prompt injection, memory poisoning, identity spoofing, zero-width Unicode. Verdict: CLEAN/SUSPICIOUS/TAINTED.