python-yama 0.10.2__tar.gz → 0.10.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {python_yama-0.10.2 → python_yama-0.10.4}/PKG-INFO +22 -2
- {python_yama-0.10.2 → python_yama-0.10.4}/README.md +21 -1
- {python_yama-0.10.2 → python_yama-0.10.4}/README.zh-CN.md +21 -1
- {python_yama-0.10.2 → python_yama-0.10.4}/docs/agent-skill-test-framework-design.md +65 -21
- {python_yama-0.10.2 → python_yama-0.10.4}/docs/case-schema-reference.md +59 -23
- {python_yama-0.10.2 → python_yama-0.10.4}/skills/eval-plugin-with-yama/SKILL.md +18 -4
- {python_yama-0.10.2 → python_yama-0.10.4}/skills/eval-plugin-with-yama/references/case-schema.md +35 -7
- {python_yama-0.10.2 → python_yama-0.10.4}/skills/eval-plugin-with-yama/references/debugging.md +36 -9
- {python_yama-0.10.2 → python_yama-0.10.4}/tests/test_cli.py +25 -8
- {python_yama-0.10.2 → python_yama-0.10.4}/tests/test_framework.py +137 -2
- {python_yama-0.10.2 → python_yama-0.10.4}/tests/test_judge_llm.py +852 -34
- {python_yama-0.10.2 → python_yama-0.10.4}/tests/test_openai_llm.py +29 -4
- {python_yama-0.10.2 → python_yama-0.10.4}/tests/test_report.py +115 -0
- {python_yama-0.10.2 → python_yama-0.10.4}/tests/test_thread_case.py +13 -52
- {python_yama-0.10.2 → python_yama-0.10.4}/tests/test_workspace.py +144 -0
- {python_yama-0.10.2 → python_yama-0.10.4}/yama/cli.py +21 -2
- {python_yama-0.10.2 → python_yama-0.10.4}/yama/judge_llm.py +436 -70
- python_yama-0.10.4/yama/judge_routing.py +115 -0
- {python_yama-0.10.2 → python_yama-0.10.4}/yama/llm.py +4 -0
- {python_yama-0.10.2 → python_yama-0.10.4}/yama/models.py +3 -0
- {python_yama-0.10.2 → python_yama-0.10.4}/yama/openai_llm.py +28 -9
- {python_yama-0.10.2 → python_yama-0.10.4}/yama/report.py +130 -7
- {python_yama-0.10.2 → python_yama-0.10.4}/yama/runner.py +21 -7
- {python_yama-0.10.2 → python_yama-0.10.4}/yama/thread_case.py +1 -36
- {python_yama-0.10.2 → python_yama-0.10.4}/yama/workspace.py +51 -0
- python_yama-0.10.2/docs/superpowers/plans/2026-08-07-judge-model-resolution.md +0 -382
- python_yama-0.10.2/docs/superpowers/plans/2026-08-07-local-judge-default-model-retry.md +0 -348
- python_yama-0.10.2/docs/superpowers/plans/2026-08-07-openai-timeout-retry-reporting.md +0 -881
- python_yama-0.10.2/docs/superpowers/specs/2026-08-04-judge-model-object-design.md +0 -131
- python_yama-0.10.2/docs/superpowers/specs/2026-08-04-openai-adapter-safety-design.md +0 -108
- python_yama-0.10.2/docs/superpowers/specs/2026-08-07-judge-model-resolution-design.md +0 -143
- python_yama-0.10.2/docs/superpowers/specs/2026-08-07-local-judge-default-model-retry-design.md +0 -124
- python_yama-0.10.2/docs/superpowers/specs/2026-08-07-openai-timeout-retry-reporting-design.md +0 -260
- {python_yama-0.10.2 → python_yama-0.10.4}/.github/workflows/publish.yml +0 -0
- {python_yama-0.10.2 → python_yama-0.10.4}/.gitignore +0 -0
- {python_yama-0.10.2 → python_yama-0.10.4}/CLAUDE.md +0 -0
- {python_yama-0.10.2 → python_yama-0.10.4}/LICENSE +0 -0
- {python_yama-0.10.2 → python_yama-0.10.4}/docs/yama-intro.html +0 -0
- {python_yama-0.10.2 → python_yama-0.10.4}/pyproject.toml +0 -0
- {python_yama-0.10.2 → python_yama-0.10.4}/skills/eval-plugin-with-yama/references/install-upgrade.md +0 -0
- {python_yama-0.10.2 → python_yama-0.10.4}/tests/test_assertions.py +0 -0
- {python_yama-0.10.2 → python_yama-0.10.4}/tests/test_cli_shim.py +0 -0
- {python_yama-0.10.2 → python_yama-0.10.4}/tests/test_dashboard.py +0 -0
- {python_yama-0.10.2 → python_yama-0.10.4}/tests/test_llm.py +0 -0
- {python_yama-0.10.2 → python_yama-0.10.4}/tests/test_main_entrypoint.py +0 -0
- {python_yama-0.10.2 → python_yama-0.10.4}/tests/test_mocks.py +0 -0
- {python_yama-0.10.2 → python_yama-0.10.4}/tests/test_pr.py +0 -0
- {python_yama-0.10.2 → python_yama-0.10.4}/tests/test_preview.py +0 -0
- {python_yama-0.10.2 → python_yama-0.10.4}/tests/test_public_api.py +0 -0
- {python_yama-0.10.2 → python_yama-0.10.4}/tests/test_report_bundle.py +0 -0
- {python_yama-0.10.2 → python_yama-0.10.4}/tests/test_report_upload.py +0 -0
- {python_yama-0.10.2 → python_yama-0.10.4}/tests/test_run_plan.py +0 -0
- {python_yama-0.10.2 → python_yama-0.10.4}/tests/test_runner.py +0 -0
- {python_yama-0.10.2 → python_yama-0.10.4}/tests/test_skill_loader.py +0 -0
- {python_yama-0.10.2 → python_yama-0.10.4}/tests/test_skill_tool.py +0 -0
- {python_yama-0.10.2 → python_yama-0.10.4}/tests/test_tool_loader.py +0 -0
- {python_yama-0.10.2 → python_yama-0.10.4}/tests/test_usage.py +0 -0
- {python_yama-0.10.2 → python_yama-0.10.4}/uv.lock +0 -0
- {python_yama-0.10.2 → python_yama-0.10.4}/yama/__init__.py +0 -0
- {python_yama-0.10.2 → python_yama-0.10.4}/yama/__main__.py +0 -0
- {python_yama-0.10.2 → python_yama-0.10.4}/yama/assertions.py +0 -0
- {python_yama-0.10.2 → python_yama-0.10.4}/yama/dashboard.py +0 -0
- {python_yama-0.10.2 → python_yama-0.10.4}/yama/loaders/__init__.py +0 -0
- {python_yama-0.10.2 → python_yama-0.10.4}/yama/loaders/case.py +0 -0
- {python_yama-0.10.2 → python_yama-0.10.4}/yama/loaders/common.py +0 -0
- {python_yama-0.10.2 → python_yama-0.10.4}/yama/loaders/skill_loader.py +0 -0
- {python_yama-0.10.2 → python_yama-0.10.4}/yama/loaders/tool_loader.py +0 -0
- {python_yama-0.10.2 → python_yama-0.10.4}/yama/mocks.py +0 -0
- {python_yama-0.10.2 → python_yama-0.10.4}/yama/pr.py +0 -0
- {python_yama-0.10.2 → python_yama-0.10.4}/yama/preview.py +0 -0
- {python_yama-0.10.2 → python_yama-0.10.4}/yama/report_bundle.py +0 -0
- {python_yama-0.10.2 → python_yama-0.10.4}/yama/report_upload.py +0 -0
- {python_yama-0.10.2 → python_yama-0.10.4}/yama/tools/__init__.py +0 -0
- {python_yama-0.10.2 → python_yama-0.10.4}/yama/tools/base.py +0 -0
- {python_yama-0.10.2 → python_yama-0.10.4}/yama/tools/bash/__init__.py +0 -0
- {python_yama-0.10.2 → python_yama-0.10.4}/yama/tools/bash/_cli_shim.py +0 -0
- {python_yama-0.10.2 → python_yama-0.10.4}/yama/tools/bash/bash.py +0 -0
- {python_yama-0.10.2 → python_yama-0.10.4}/yama/tools/bash/fs.py +0 -0
- {python_yama-0.10.2 → python_yama-0.10.4}/yama/tools/skill/__init__.py +0 -0
- {python_yama-0.10.2 → python_yama-0.10.4}/yama/tools/skill/skill.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: python-yama
|
|
3
|
-
Version: 0.10.
|
|
3
|
+
Version: 0.10.4
|
|
4
4
|
Summary: A reproducible evaluation runner for tool-using Agent skills
|
|
5
5
|
Project-URL: Repository, https://github.com/world-sim-dev/yama
|
|
6
6
|
Project-URL: Issues, https://github.com/world-sim-dev/yama/issues
|
|
@@ -46,7 +46,27 @@ Instead of prefixing every command, you can put credentials in a `.env` file: on
|
|
|
46
46
|
|
|
47
47
|
### Judge routing
|
|
48
48
|
|
|
49
|
-
Evaluated Agent calls always use the configured OpenAI-compatible API. In an ordinary non-CI run,
|
|
49
|
+
Evaluated Agent calls always use the configured OpenAI-compatible API. In an ordinary non-CI run, Judge routing recognizes OpenAI/GPT/o-family names as Codex, Claude/Anthropic names as Claude Code, and Grok/xAI names as Cursor. An exact per-agent map may translate an API model name to a local CLI model slug. Without a mapping, every recognized family first passes the original Judge model name to its local Agent. If any local attempt that explicitly names a model fails, Yama retries the same Agent with its default model; if that default attempt also fails, Yama calls the original Judge API. Other families become local-first only through an exact mapping. This local-first chain never enters the fallback Agent.
|
|
50
|
+
|
|
51
|
+
```toml
|
|
52
|
+
[defaults.judge.local.models.codex]
|
|
53
|
+
"openai/gpt-5.4" = "gpt-5.4-high"
|
|
54
|
+
|
|
55
|
+
[defaults.judge.local.models.claude]
|
|
56
|
+
"anthropic/claude-opus-4.1" = "claude-opus-4-1"
|
|
57
|
+
|
|
58
|
+
[defaults.judge.local.models.cursor]
|
|
59
|
+
"x-ai/grok-4" = "grok-4-fast"
|
|
60
|
+
"kimi.k3" = "kimi-k3"
|
|
61
|
+
|
|
62
|
+
[defaults.judge.local.agent]
|
|
63
|
+
name = "claude" # "claude", "codex", or "cursor"
|
|
64
|
+
model = "claude-sonnet-4-5"
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
An unmapped, unrecognized model is API-first. Only after its original API exhausts retryable failures may `[defaults.judge.local.agent]` run as the terminal fallback: configured local model, then the same Agent's default whenever that named-model attempt fails, then end. There is no fallback-model API call. External cancellation always stops the chain immediately. The HTML report shows the complete Judge attempt chain, including mapped/configured/default/fallback source, retries, failures, and the effective local model when the Agent reports it.
|
|
68
|
+
|
|
69
|
+
CI and `pr-run` are API-only. Local agents receive the mapped model slug or original Judge model name and a compatible `reasoning_effort`, but never temperature, credentials, or endpoint settings. Cursor Judge passes `--trust` only for its per-attempt empty temporary workspace so non-interactive execution cannot stop at Workspace Trust; it still omits `--force`/`--yolo`, and Yama does not edit Cursor's global trust configuration. Evaluated Agent API attempts default to a 180-second transport timeout; Judge API attempts and local Judge processes default to 120 seconds. The whole-Step timeout remains independently configured by `execution.timeout_seconds_per_step` (default 300 seconds).
|
|
50
70
|
|
|
51
71
|
## Writing a Case
|
|
52
72
|
|
|
@@ -19,7 +19,27 @@ Instead of prefixing every command, you can put credentials in a `.env` file: on
|
|
|
19
19
|
|
|
20
20
|
### Judge routing
|
|
21
21
|
|
|
22
|
-
Evaluated Agent calls always use the configured OpenAI-compatible API. In an ordinary non-CI run,
|
|
22
|
+
Evaluated Agent calls always use the configured OpenAI-compatible API. In an ordinary non-CI run, Judge routing recognizes OpenAI/GPT/o-family names as Codex, Claude/Anthropic names as Claude Code, and Grok/xAI names as Cursor. An exact per-agent map may translate an API model name to a local CLI model slug. Without a mapping, every recognized family first passes the original Judge model name to its local Agent. If any local attempt that explicitly names a model fails, Yama retries the same Agent with its default model; if that default attempt also fails, Yama calls the original Judge API. Other families become local-first only through an exact mapping. This local-first chain never enters the fallback Agent.
|
|
23
|
+
|
|
24
|
+
```toml
|
|
25
|
+
[defaults.judge.local.models.codex]
|
|
26
|
+
"openai/gpt-5.4" = "gpt-5.4-high"
|
|
27
|
+
|
|
28
|
+
[defaults.judge.local.models.claude]
|
|
29
|
+
"anthropic/claude-opus-4.1" = "claude-opus-4-1"
|
|
30
|
+
|
|
31
|
+
[defaults.judge.local.models.cursor]
|
|
32
|
+
"x-ai/grok-4" = "grok-4-fast"
|
|
33
|
+
"kimi.k3" = "kimi-k3"
|
|
34
|
+
|
|
35
|
+
[defaults.judge.local.agent]
|
|
36
|
+
name = "claude" # "claude", "codex", or "cursor"
|
|
37
|
+
model = "claude-sonnet-4-5"
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
An unmapped, unrecognized model is API-first. Only after its original API exhausts retryable failures may `[defaults.judge.local.agent]` run as the terminal fallback: configured local model, then the same Agent's default whenever that named-model attempt fails, then end. There is no fallback-model API call. External cancellation always stops the chain immediately. The HTML report shows the complete Judge attempt chain, including mapped/configured/default/fallback source, retries, failures, and the effective local model when the Agent reports it.
|
|
41
|
+
|
|
42
|
+
CI and `pr-run` are API-only. Local agents receive the mapped model slug or original Judge model name and a compatible `reasoning_effort`, but never temperature, credentials, or endpoint settings. Cursor Judge passes `--trust` only for its per-attempt empty temporary workspace so non-interactive execution cannot stop at Workspace Trust; it still omits `--force`/`--yolo`, and Yama does not edit Cursor's global trust configuration. Evaluated Agent API attempts default to a 180-second transport timeout; Judge API attempts and local Judge processes default to 120 seconds. The whole-Step timeout remains independently configured by `execution.timeout_seconds_per_step` (default 300 seconds).
|
|
23
43
|
|
|
24
44
|
## Writing a Case
|
|
25
45
|
|
|
@@ -19,7 +19,27 @@ YAMA_LLM_API_KEY=... uv run --project yama yama --plugin dingding-simple
|
|
|
19
19
|
|
|
20
20
|
### Judge 路由
|
|
21
21
|
|
|
22
|
-
被评测 Agent 的调用始终使用配置好的 OpenAI-compatible API。普通非 CI 运行中,
|
|
22
|
+
被评测 Agent 的调用始终使用配置好的 OpenAI-compatible API。普通非 CI 运行中,Judge 路由把 OpenAI/GPT/o 系列交给 Codex、Claude/Anthropic 系列交给 Claude Code、Grok/xAI 系列交给 Cursor。每个 Agent 都可用精确映射把 API 模型名翻译成本地 CLI 模型 slug;未配置映射时,三个已识别系列都会先把原始 Judge 模型名传给对应本地 Agent。凡是显式携带模型名的本地尝试发生任何错误,Yama 都会改用同一 Agent 的默认模型重试;默认模型仍失败后才调用原始 Judge API。其他系列只有精确映射命中后才会变为 local-first,该链不会再进入 fallback Agent。
|
|
23
|
+
|
|
24
|
+
```toml
|
|
25
|
+
[defaults.judge.local.models.codex]
|
|
26
|
+
"openai/gpt-5.4" = "gpt-5.4-high"
|
|
27
|
+
|
|
28
|
+
[defaults.judge.local.models.claude]
|
|
29
|
+
"anthropic/claude-opus-4.1" = "claude-opus-4-1"
|
|
30
|
+
|
|
31
|
+
[defaults.judge.local.models.cursor]
|
|
32
|
+
"x-ai/grok-4" = "grok-4-fast"
|
|
33
|
+
"kimi.k3" = "kimi-k3"
|
|
34
|
+
|
|
35
|
+
[defaults.judge.local.agent]
|
|
36
|
+
name = "claude" # 支持 "claude"、"codex" 或 "cursor"
|
|
37
|
+
model = "claude-sonnet-4-5"
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
未映射且未识别的模型走 API-first。只有原始 API 的可重试错误耗尽后,才会启用 `[defaults.judge.local.agent]` 作为终止型兜底:“配置的本地模型 → 该次尝试发生任何错误时使用同一 Agent 默认模型 → 结束”。不再调用 fallback-model API;外部取消始终立即终止整条链。HTML 报告会展示完整 Judge 尝试链,包括映射/原始配置/默认/兜底来源、重试、失败原因,以及本地 Agent 能上报时的实际模型。
|
|
41
|
+
|
|
42
|
+
CI 和 `pr-run` 均只走 API。本地 Agent 只接收命中的本地模型 slug 或原始 Judge 模型名,以及兼容的 `reasoning_effort`;不会接收 temperature、凭据或 endpoint 设置。Cursor Judge 只为当前单次调用的空临时 Workspace 传入 `--trust`,避免非交互执行停在 Workspace Trust;仍不使用 `--force`/`--yolo`,Yama 也不会修改 Cursor 的全局信任配置。被评测 Agent 的 API 单次请求默认超时为 180 秒;Judge API 单次请求和本地 Judge 进程默认超时均为 120 秒。整条 Step 的超时仍由 `execution.timeout_seconds_per_step` 独立控制,默认 300 秒。
|
|
23
43
|
|
|
24
44
|
## 编写一个 Case
|
|
25
45
|
|
|
@@ -349,6 +349,22 @@ timeout_seconds_per_step = 300
|
|
|
349
349
|
max_tool_rounds_per_step = 10
|
|
350
350
|
repeat = 1
|
|
351
351
|
|
|
352
|
+
# 可选:API 模型名到本地 Agent 模型 slug 的精确映射
|
|
353
|
+
[defaults.judge.local.models.codex]
|
|
354
|
+
"openai/gpt-5.4" = "gpt-5.4-high"
|
|
355
|
+
|
|
356
|
+
[defaults.judge.local.models.claude]
|
|
357
|
+
"anthropic/claude-opus-4.1" = "claude-opus-4-1"
|
|
358
|
+
|
|
359
|
+
[defaults.judge.local.models.cursor]
|
|
360
|
+
"x-ai/grok-4" = "grok-4-fast"
|
|
361
|
+
"kimi.k3" = "kimi-k3"
|
|
362
|
+
|
|
363
|
+
# 可选:仅用于 API-first Judge 重试耗尽后的终止型本地兜底
|
|
364
|
+
[defaults.judge.local.agent]
|
|
365
|
+
name = "claude" # "claude"、"codex" 或 "cursor"
|
|
366
|
+
model = "claude-sonnet-4-5"
|
|
367
|
+
|
|
352
368
|
[plugins."dingding-simple"]
|
|
353
369
|
path = "dingding-simple"
|
|
354
370
|
|
|
@@ -400,6 +416,12 @@ timeout_seconds_per_step = 60
|
|
|
400
416
|
< Case 自己顶层的 model: / execution: 字段
|
|
401
417
|
```
|
|
402
418
|
|
|
419
|
+
`defaults.judge.local` 不参与 Case 的 `model`/`execution` 合并。`models` 是独立的精确、
|
|
420
|
+
大小写敏感 API→本地模型映射;一个 API 名只能属于一个 Agent,内置系列不能跨 Agent
|
|
421
|
+
映射。`agent` 是 API-first 重试耗尽后的可选终止型本地兜底;`name` 只能是 `claude`、
|
|
422
|
+
`codex` 或 `cursor`,`model` 必须是非空本地模型 slug。字段层级、冲突或取值不合法会在
|
|
423
|
+
加载 `yama.toml` 时直接报 `ConfigurationError`。具体触发条件与调用顺序见 12.2 节。
|
|
424
|
+
|
|
403
425
|
**不存在** CLI 对 `model`/`execution`/超时参数的覆盖层——CLI 能覆盖的运行期配置只有
|
|
404
426
|
`--result-dir`(产物根目录)、`--concurrency`(Case 级并发上限)和
|
|
405
427
|
`--run-concurrency`(命令级 run 总上限);后两者都是纯调度参数,不改变 Case 文件。
|
|
@@ -1188,7 +1210,7 @@ Runner 把例如 `__evals__/cases/image-led-mv.yaml` 的相对路径规范化为
|
|
|
1188
1210
|
```yaml
|
|
1189
1211
|
model:
|
|
1190
1212
|
name: grok.4.5
|
|
1191
|
-
timeout:
|
|
1213
|
+
timeout: 180
|
|
1192
1214
|
max_retries: 2
|
|
1193
1215
|
```
|
|
1194
1216
|
|
|
@@ -1197,15 +1219,16 @@ model:
|
|
|
1197
1219
|
```yaml
|
|
1198
1220
|
model:
|
|
1199
1221
|
name: grok.4.5 # 必填,原样传给 chat.completions.create(model=...)
|
|
1200
|
-
timeout:
|
|
1222
|
+
timeout: 180 # 被测 Agent 的有效 SDK transport timeout(秒)
|
|
1201
1223
|
```
|
|
1202
1224
|
|
|
1203
1225
|
`stream` 固定传 `False`,因为 runner 以一次完整 assistant message 驱动 Tool Loop,
|
|
1204
1226
|
没有流式增量解析链路。`provider` 字段和 `YAMA_MODEL_PROVIDER` 不再参与默认真实调用;
|
|
1205
1227
|
若仍直接实例化 legacy `LiteLLMClient`,它保留旧的 LiteLLM 路由行为,但 CLI 不再使用它。
|
|
1206
1228
|
默认 OpenAI-compatible Client 由 Yama 管理 timeout 与 retry:`model.timeout` 是正数
|
|
1207
|
-
|
|
1208
|
-
|
|
1229
|
+
(被测 Agent 默认 180 秒、Judge API 默认 120 秒,boolean 非法)的 SDK transport
|
|
1230
|
+
timeout;每个 Provider attempt 还由
|
|
1231
|
+
`asyncio.wait_for(..., timeout=timeout + 5)` 施加绝对 deadline。`model.max_retries`
|
|
1209
1232
|
是初始 attempt 之后的非负整数重试数(默认 2,boolean 非法),由 Yama 消费并从
|
|
1210
1233
|
`chat.completions.create` 参数中移除。Yama 创建的 `AsyncOpenAI` 始终使用
|
|
1211
1234
|
`max_retries=0`,避免 SDK retry 与 Yama retry 叠加。
|
|
@@ -1239,7 +1262,7 @@ Yama 重试自己的 deadline `TimeoutError`、SDK timeout/connection error、HT
|
|
|
1239
1262
|
"messages": [],
|
|
1240
1263
|
"tools": [],
|
|
1241
1264
|
"stream": false,
|
|
1242
|
-
"timeout":
|
|
1265
|
+
"timeout": 180.0
|
|
1243
1266
|
}
|
|
1244
1267
|
},
|
|
1245
1268
|
"resolved_provider": { "name": "openai-compatible", "model": "grok.4.5" },
|
|
@@ -1698,9 +1721,11 @@ execution:
|
|
|
1698
1721
|
(`RunResult.status = "error"`,`RunResult.passed = False`,`RunResult.error`
|
|
1699
1722
|
记录异常信息),run 直接终止,不会再跑后续 Step。这个 300 秒总预算覆盖该 Step 的
|
|
1700
1723
|
全部 Provider attempts、retry delay、Tool 执行与后续 Tool Loop 请求,不会按 attempt
|
|
1701
|
-
或 Tool round
|
|
1702
|
-
|
|
1703
|
-
|
|
1724
|
+
或 Tool round 重置。被测 Agent 的默认 transport timeout 是 180 秒,每个 attempt 的
|
|
1725
|
+
绝对 deadline 是 185 秒;若包含 retry 的完整 completion chain 超过 300 秒,整 Step
|
|
1726
|
+
deadline 会先
|
|
1727
|
+
取消当前请求,而不是为所有 attempts 额外扩张总预算。Judge 调用仍在这个
|
|
1728
|
+
candidate-Step `wait_for` 之外。`LLMError`(Provider
|
|
1704
1729
|
请求失败、接口异常、脚本回放耗尽等)同样归为 run/case 的 `error` 状态,而不是
|
|
1705
1730
|
hard check/Judge 失败。
|
|
1706
1731
|
这与下面 `max_tool_rounds_per_step` 超限的处理方式(仅本 Step 记为失败、run 继续
|
|
@@ -2598,14 +2623,29 @@ def check(
|
|
|
2598
2623
|
|
|
2599
2624
|
Judge 只评价无法可靠写成确定性规则的质量维度。执行逻辑固定如下:
|
|
2600
2625
|
|
|
2601
|
-
调用路径与被测 Agent 相互独立:被测 Agent 始终走 API。普通非 CI 运行的 Judge
|
|
2602
|
-
|
|
2603
|
-
|
|
2604
|
-
|
|
2605
|
-
|
|
2606
|
-
|
|
2607
|
-
|
|
2608
|
-
|
|
2626
|
+
调用路径与被测 Agent 相互独立:被测 Agent 始终走 API。普通非 CI 运行的 Judge 按
|
|
2627
|
+
解析后的模型分两条互斥路径:
|
|
2628
|
+
|
|
2629
|
+
1. `judge.model.name` 可路由到本地 Agent 时,OpenAI/GPT/o 系列交给 Codex,
|
|
2630
|
+
Claude/Anthropic 系列交给 Claude Code,Grok/xAI 系列交给 Cursor。精确映射命中时把
|
|
2631
|
+
映射值作为本地 `--model`。未映射时三个已识别系列都先把原始 Judge 模型名作为
|
|
2632
|
+
`--model`。其他系列只有精确映射命中后才成为 local-first。凡显式携带映射 slug 或原始
|
|
2633
|
+
模型名的本地尝试发生错误,都省略 `--model` 重试同一 Agent 默认模型;默认模型失败时,
|
|
2634
|
+
使用原始完整 Judge model 对象回退 API。链最终以原始 API 兜底,不进入
|
|
2635
|
+
`defaults.judge.local.agent`。
|
|
2636
|
+
2. `judge.model.name` 未命中内置系列或映射时,先用原始完整 Judge model 对象调用 API。
|
|
2637
|
+
只有可重试错误在 `max_retries` 后仍失败,且 Workspace 显式配置了
|
|
2638
|
+
`defaults.judge.local.agent`,才继续尝试配置的本地 Agent 与模型。该显式模型尝试发生
|
|
2639
|
+
任何错误时,省略 `--model` 使用该 Agent 默认模型重试;默认模型仍失败时直接结束,
|
|
2640
|
+
不再调用 fallback-model API。不可重试的原始 API 错误
|
|
2641
|
+
直接抛出;未配置 `defaults.judge.local.agent` 时不启用这条链。
|
|
2642
|
+
|
|
2643
|
+
外部取消不会触发默认模型或 API 回退。CI 和 `yama pr-run` 的 Judge 只走 API。本地 Agent 尝试只接收兼容的
|
|
2644
|
+
`reasoning_effort`,不接收 `temperature`。Agent 默认模型可能因机器或时间而变化,所以
|
|
2645
|
+
`temperature: 0` 只对 API Judge 提供稳定作用,不能保证本地 Judge 可复现。被测 Agent
|
|
2646
|
+
的 API 单次 attempt 默认 transport timeout 为 180 秒;Judge API 单次 attempt 与本地
|
|
2647
|
+
Judge 进程默认 timeout 均为 120 秒;`execution.timeout_seconds_per_step` 仍是独立的整
|
|
2648
|
+
Step deadline,默认 300 秒。
|
|
2609
2649
|
|
|
2610
2650
|
本地 Codex/Claude 适配器不会直接发送 API 使用的 tuple Judge Schema,而是深拷贝后
|
|
2611
2651
|
转换为两者严格模式都接受的子集:`dimensions` 使用对象型 `items`,`name` 使用字符串
|
|
@@ -2615,6 +2655,11 @@ Agent 默认模型可能因机器或时间而变化,所以 `temperature: 0`
|
|
|
2615
2655
|
`sqlite_home` 覆盖隔离 SQLite 运行状态;`CODEX_HOME`、认证和默认模型选择不变,临时
|
|
2616
2656
|
目录在调用结束后删除。非零进程退出同时保留带标签的 stdout 与 stderr,再经过既有的
|
|
2617
2657
|
单行、长度限制和敏感信息脱敏后打印,避免 stderr warning 隐藏 stdout 的真实错误。
|
|
2658
|
+
Cursor 适配器使用 `agent --trust -p --output-format stream-json`(兼容旧命令名
|
|
2659
|
+
`cursor-agent`);`--trust` 只跳过本次隔离空临时目录的 Workspace Trust 交互,不带
|
|
2660
|
+
`--force`/`--yolo`,也不修改 Cursor 全局信任配置。每个 local/API 逻辑尝试都会写入
|
|
2661
|
+
`StepResult.judge_execution`;HTML 按序显示模型来源、重试、失败和 Agent 上报的实际模型。
|
|
2662
|
+
Claude Code/Cursor 可从 init 事件显示默认实际模型;Codex 默认模型未上报时明确标注。
|
|
2618
2663
|
|
|
2619
2664
|
在调用前,`_resolve_judge_model()` 按三条互斥分支选择模型:省略 `judge.model` 时,
|
|
2620
2665
|
深拷贝完整的 Case `model`(包括每个已配置请求选项);字符串 `judge.model` 是独立的、
|
|
@@ -3113,11 +3158,10 @@ CAPTCHA 也不会误报。其他非 2xx、curl 非零退出、curl 不存在、
|
|
|
3113
3158
|
- 当前 step id 来自 `dsl.workflow.steps`,优先第一条 `status == "in_progress"`,否则取
|
|
3114
3159
|
第一条非 `completed`/`skipped`;若全部完成/跳过、没有 DSL、或步骤缺少 id,则不填充
|
|
3115
3160
|
step。
|
|
3116
|
-
-
|
|
3117
|
-
|
|
3118
|
-
|
|
3119
|
-
|
|
3120
|
-
`steps[0].message_inject`,`position: after_user_message`。
|
|
3161
|
+
- request 中最后一条 `role == "user"` 的消息成为 `steps[0].user`,即使它是纯
|
|
3162
|
+
`<system-reminder>...</system-reminder>`;`context.messages` 截断到这条消息之前,
|
|
3163
|
+
避免运行 Case 时重复发送同一用户回合。`from-thread` 不为这次切分自动生成
|
|
3164
|
+
`message_inject`。
|
|
3121
3165
|
- 从该用户消息之后的 assistant tool calls 和选中 record 的 response message 中收集
|
|
3122
3166
|
Tool 名,按首次出现顺序聚合调用次数,生成带 `times: <count>` 和 `tag: must_pass`
|
|
3123
3167
|
的 `tool_called` hard checks。
|
|
@@ -62,14 +62,14 @@ Case 级模型配置,与 Tool Loop 中驱动被测 Agent 的模型完全对应
|
|
|
62
62
|
| `reasoning_effort` | string | 否 | 无 | 透传给 endpoint 的推理强度选项。 |
|
|
63
63
|
| `temperature` | number | 否 | `0` | 透传给 endpoint 的采样温度。 |
|
|
64
64
|
| `base_url` / `api_base` | string | 否 | 私有默认 endpoint | 自定义 OpenAI-compatible Endpoint;两个字段同义,Case 配置优先于 `YAMA_LLM_BASE_URL`。 |
|
|
65
|
-
| `timeout` | 正数(不能是 boolean) | 否 | `
|
|
65
|
+
| `timeout` | 正数(不能是 boolean) | 否 | `180` | 被测 Agent 单次 Provider attempt 的 OpenAI SDK transport timeout(秒)。Yama 还会以 `timeout + 5` 秒包住该 await,作为绝对 deadline。Judge API 的默认值为 `120`。 |
|
|
66
66
|
| `max_retries` | 非负整数(不能是 boolean) | 否 | `2` | 初始 attempt 之后允许的重试次数,由 Yama 消费;`0` 禁用重试,且该字段不会传给 Provider。 |
|
|
67
67
|
| 其他模型选项 | 任意 JSON 值 | 否 | 无 | 除 `name`、endpoint/client 配置、`stream`、`timeout` 和 `max_retries` 外,非 `null` 选项透传给 `chat.completions.create`。 |
|
|
68
68
|
|
|
69
69
|
```yaml
|
|
70
70
|
model:
|
|
71
71
|
name: grok.4.5
|
|
72
|
-
timeout:
|
|
72
|
+
timeout: 180
|
|
73
73
|
max_retries: 2
|
|
74
74
|
```
|
|
75
75
|
|
|
@@ -87,31 +87,66 @@ timeout/connection error,以及 HTTP `408`、`409`、`429` 和所有 `5xx`;
|
|
|
87
87
|
`LiteLLMClient` 的代码生效,不参与 CLI 默认真实调用。
|
|
88
88
|
|
|
89
89
|
被评测 Agent 的 Tool Loop 无条件使用以上 OpenAI-compatible API;本地路由只属于
|
|
90
|
-
`steps[].assert.judge` 的独立 Judge
|
|
91
|
-
`
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
90
|
+
`steps[].assert.judge` 的独立 Judge 调用。API 的单次 attempt 默认 timeout 是 120 秒;
|
|
91
|
+
本地 Judge 进程未显式设置 `model.timeout` 时也默认等待 120 秒。两者都不改变独立的整
|
|
92
|
+
Step deadline:`execution.timeout_seconds_per_step` 默认仍为 300 秒。
|
|
93
|
+
|
|
94
|
+
普通非 CI 的 Judge 使用解析后的 `judge.model.name` 决定路由:OpenAI/GPT/o 系列走
|
|
95
|
+
Codex,Claude/Anthropic 系列走 Claude Code,Grok/xAI 系列走 Cursor。没有精确映射时,
|
|
96
|
+
三个已识别系列都会先把原始 Judge 模型名原样作为 `--model`。该显式模型尝试发生任何错误
|
|
97
|
+
时,都会省略 `--model` 使用对应 Agent 的默认模型重试。其他系列(例如 `kimi.k3`)只有命中下面的精确、
|
|
98
|
+
大小写敏感映射时才走本地;
|
|
99
|
+
`openrouter/gpt-4.1` 等未命中模型保持 API-first。
|
|
100
|
+
|
|
101
|
+
```toml
|
|
102
|
+
[defaults.judge.local.models.codex]
|
|
103
|
+
"openai/gpt-5.4" = "gpt-5.4-high"
|
|
104
|
+
|
|
105
|
+
[defaults.judge.local.models.claude]
|
|
106
|
+
"anthropic/claude-opus-4.1" = "claude-opus-4-1"
|
|
107
|
+
|
|
108
|
+
[defaults.judge.local.models.cursor]
|
|
109
|
+
"x-ai/grok-4" = "grok-4-fast"
|
|
110
|
+
"kimi.k3" = "kimi-k3"
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
一个 API 模型名最多出现在一个 Agent map;内置系列也只能映射到其固定 Agent。未知
|
|
114
|
+
Agent、跨 Agent 重复、跨系列映射、空值和首尾空白都会在 Workspace 加载时报告配置错误。
|
|
96
115
|
|
|
97
116
|
每次本地 Judge 均在新建的隔离目录中以无会话、只读的受限调用执行,并要求严格的结构化
|
|
98
117
|
输出;Yama 会再次校验其 JSON 和每个 Judge 维度的协议。可选 usage 只有在本地 Agent
|
|
99
|
-
实际返回有效 token 计数时才写入,Yama 不会编造 usage
|
|
100
|
-
|
|
101
|
-
或其他 endpoint
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
`
|
|
107
|
-
|
|
108
|
-
|
|
118
|
+
实际返回有效 token 计数时才写入,Yama 不会编造 usage。本地调用只传入映射命中的模型 slug、
|
|
119
|
+
无映射时的原始 Judge 模型名和该 CLI 支持的 `reasoning_effort`;不会传入 `temperature`、
|
|
120
|
+
凭据、`base_url`/`api_base` 或其他 endpoint 设置。映射模型或原始模型名的本地尝试发生
|
|
121
|
+
任何错误时,Yama 都会写一条已脱敏警告,并省略 `--model` 使用同一 Agent 的默认模型重试
|
|
122
|
+
一次。默认模型重试失败时,用**未改写的完整原始 model 对象**调用 API。该
|
|
123
|
+
local-first 链到此结束,不会进入 Workspace fallback Agent。
|
|
124
|
+
|
|
125
|
+
对于 `openrouter/gpt-4.1` 等不能路由到本地 Agent 的模型,原始 API 只有在可重试错误
|
|
126
|
+
耗尽 `max_retries` 后,才可能启用以下可选 Workspace 兜底;不可重试错误会直接抛出:
|
|
127
|
+
|
|
128
|
+
```toml
|
|
129
|
+
[defaults.judge.local.agent]
|
|
130
|
+
name = "claude" # 支持 "claude"、"codex" 或 "cursor"
|
|
131
|
+
model = "claude-sonnet-4-5"
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
配置存在时,Yama 先以指定 Agent 和模型执行本地 Judge;该次尝试发生任何错误时,省略
|
|
135
|
+
`--model` 使用该 Agent 默认模型重试。默认模型仍失败时直接结束,不会再用配置模型名调用
|
|
136
|
+
API。外部取消立即终止,不触发重试。整个配置表缺失时不会启用这条行为;`name` 不是 `claude`/`codex`/
|
|
137
|
+
`cursor`、`model` 为空或层级不是 TOML table 时,加载 Workspace 即报配置错误。
|
|
138
|
+
|
|
139
|
+
Codex 与 Claude Code 接收一份本地兼容的 Judge Schema 副本:数组使用对象型
|
|
109
140
|
`items`,维度名使用字符串 `enum`;API 路径保持原有调用方式,不受这项本地转换影响。本地返回后,Yama
|
|
110
141
|
继续按原始 Schema 校验维度数量、名称、顺序和字段,因此转换不会放宽最终评分协议。
|
|
111
142
|
Codex 还会把 SQLite 运行状态写入本次隔离目录下的 `codex-state`,而不是
|
|
112
143
|
`~/.codex/state_5.sqlite`;这不改变 `CODEX_HOME` 中的配置、认证或默认模型,目录在调用
|
|
113
144
|
结束后删除。若本地进程失败,Yama 会同时保留 stdout 与 stderr 的已脱敏、有界摘要,
|
|
114
145
|
避免 stderr 启动 warning 掩盖 stdout 中的真实结构化错误,然后按既有规则回退 API。
|
|
146
|
+
Cursor 使用无交互 `agent` 命令(兼容旧名 `cursor-agent`),只为本次隔离空临时目录传入
|
|
147
|
+
`--trust` 以跳过 Workspace Trust 交互,不带 `--force`/`--yolo`,也不修改 Cursor 全局
|
|
148
|
+
信任配置。HTML 报告与序列化结果按顺序保留完整 Judge 尝试链;Claude Code/Cursor 会从
|
|
149
|
+
初始化事件显示实际模型,Codex 默认模型未上报时明确显示“model not reported”。
|
|
115
150
|
|
|
116
151
|
当以下任一 CI 标记的值不是 false-like 值时,本地 Judge 完全禁用:`CI`、
|
|
117
152
|
`GITHUB_ACTIONS`、`GITLAB_CI`、`BUILDKITE`、`TF_BUILD`、`JENKINS_URL`。空字符串、
|
|
@@ -985,11 +1020,12 @@ judge:
|
|
|
985
1020
|
其他选项。想完整复用 Case 模型时应省略 `judge.model`。违反这些约束会在调用 Judge LLM
|
|
986
1021
|
前抛出 `AssertionConfigurationError`。
|
|
987
1022
|
|
|
988
|
-
|
|
989
|
-
`judge.
|
|
990
|
-
|
|
991
|
-
`reasoning_effort
|
|
992
|
-
|
|
1023
|
+
上述本地优先与可选 Workspace 兜底规则仅适用于普通非 CI 的 Judge;它们不改变
|
|
1024
|
+
`judge.model` 的选择、同级 `judge.temperature` 覆盖或原始 API 请求语义。特别是,
|
|
1025
|
+
`temperature` 仍是 API Judge 请求字段,但本地 Agent 不接收它;兼容时才会转发
|
|
1026
|
+
`reasoning_effort`。Case Judge 模型本身可路由到本地 Agent 时,API 回退仍使用原始完整
|
|
1027
|
+
Judge 模型配置;API-first 路径启用 Workspace fallback Agent 后,本地失败即终止,不再
|
|
1028
|
+
调用 fallback-model API。
|
|
993
1029
|
|
|
994
1030
|
`dimensions` 每项:
|
|
995
1031
|
|
|
@@ -210,10 +210,9 @@ config/alias/版本路径和来源 record/commit 告诉用户。
|
|
|
210
210
|
- `description` 写成当前 workflow step id + 原始 `--record-id`。
|
|
211
211
|
- step id 来自 `dsl.workflow.steps`:优先 `status == "in_progress"`;否则取第一条非
|
|
212
212
|
`completed`/`skipped`;全部结束则不填充 step。
|
|
213
|
-
- `steps[0].user` 来自 request
|
|
214
|
-
|
|
215
|
-
-
|
|
216
|
-
`steps[0].message_inject`,`position: after_user_message`。
|
|
213
|
+
- `steps[0].user` 来自 request 里最后一条 `role == "user"` 的消息,即使它是纯
|
|
214
|
+
`<system-reminder>...</system-reminder>`;`context.messages` 会截断到这条 user 之前,
|
|
215
|
+
避免重复发送同一轮用户输入。`from-thread` 不为这次切分自动生成 `message_inject`。
|
|
217
216
|
- 从这条 user 之后的 assistant tool calls 和选中 record 的 response message 里收集
|
|
218
217
|
Tool 名并统计调用次数,生成带 `times: <count>` 和 `tag: must_pass` 的 `tool_called`
|
|
219
218
|
hard checks。
|
|
@@ -264,6 +263,21 @@ yama --preview --json # 向 stdout 打印逐 Case 的 JSON 预览
|
|
|
264
263
|
yama dashboard # 默认 http://127.0.0.1:8765/
|
|
265
264
|
```
|
|
266
265
|
|
|
266
|
+
普通非 CI 运行中,被测 Agent 始终走 API;Judge 的 GPT/o、Claude、Grok 系列分别本地
|
|
267
|
+
优先使用 Codex、Claude Code、Cursor。未配置精确映射时,三个 Agent 都先使用原始 Judge
|
|
268
|
+
模型名;凡显式模型尝试发生任何错误,都再试对应 Agent 默认模型。
|
|
269
|
+
其他模型(如 `kimi.k3`)只有命中 `[defaults.judge.local.models.<agent>]` 的精确 API→本地
|
|
270
|
+
slug 映射才会 local-first。该链最终以原始 Judge API 兜底。
|
|
271
|
+
API-first 只有可重试错误耗尽且配置 `[defaults.judge.local.agent]`(`name` 支持
|
|
272
|
+
`claude`/`codex`/`cursor`)时才尝试 fallback Agent;显式本地模型失败后再试 Agent 默认,
|
|
273
|
+
默认模型仍失败后直接结束,不再调用 fallback-model API。外部取消始终立即终止。CI/`pr-run` 始终 API-only,HTML
|
|
274
|
+
会展示完整 Judge 尝试链和 Agent 能上报的实际模型。
|
|
275
|
+
Cursor Judge 只为每次隔离空临时目录传入 `--trust` 以跳过 Workspace Trust 交互,仍不
|
|
276
|
+
使用 `--force`/`--yolo`,也不修改 Cursor 全局信任配置。
|
|
277
|
+
被测 Agent 的 API 单次 attempt 默认超时为 180 秒;Judge API 单次 attempt 与本地
|
|
278
|
+
Judge 默认超时均为 120 秒,整 Step 默认超时仍为 300 秒。
|
|
279
|
+
完整配置和边界见 [references/case-schema.md](references/case-schema.md)。
|
|
280
|
+
|
|
267
281
|
多个 Case 默认并行执行(最多同时 10 个,`--concurrency N` 调整)。Case 内由
|
|
268
282
|
`execution.repeat` 展开的 run 也默认并行:省略 `execution.repeat_concurrency` 时使用
|
|
269
283
|
展开后的总 run 数,所有 Case 再共享 `--run-concurrency N`(默认 32)的全局上限;
|
{python_yama-0.10.2 → python_yama-0.10.4}/skills/eval-plugin-with-yama/references/case-schema.md
RENAMED
|
@@ -44,6 +44,7 @@ model:
|
|
|
44
44
|
name: grok.4.5 # 原样传给 chat.completions.create(model=...)
|
|
45
45
|
reasoning_effort: medium
|
|
46
46
|
temperature: 0
|
|
47
|
+
timeout: 180 # 可选;被测 Agent 单次 API attempt 默认 180 秒
|
|
47
48
|
base_url: https://... # 可选,与 api_base 二选一;也可用 YAMA_LLM_BASE_URL
|
|
48
49
|
```
|
|
49
50
|
|
|
@@ -468,14 +469,41 @@ judge:
|
|
|
468
469
|
model:
|
|
469
470
|
reasoning_effort: high # invalid: explicit object model requires name
|
|
470
471
|
```
|
|
471
|
-
- 被测 Agent 调用始终走 API
|
|
472
|
-
|
|
472
|
+
- 被测 Agent 调用始终走 API。被测 Agent 的 API 单次 attempt 默认 timeout 为 180 秒;
|
|
473
|
+
Judge API 单次 attempt 与本地 Judge 进程默认 timeout 均为 120 秒;整 Step timeout 仍由
|
|
474
|
+
`execution.timeout_seconds_per_step` 独立控制,默认 300 秒。
|
|
475
|
+
- 普通非 CI 运行的 Judge 会把 OpenAI/GPT/o 系列交给 Codex、Claude/Anthropic 系列交给
|
|
476
|
+
Claude Code、Grok/xAI 系列交给 Cursor。未配置精确映射时三个 Agent 都先使用原始
|
|
477
|
+
Judge 模型名。其他模型只有命中
|
|
478
|
+
`[defaults.judge.local.models.<agent>]` 的大小写敏感精确 API→本地 slug 映射时才走本地。
|
|
473
479
|
CI 和 `yama pr-run` 的 Judge 只走 API。
|
|
474
|
-
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
Agent
|
|
478
|
-
|
|
480
|
+
- 映射 slug 或原始模型名的本地尝试发生任何错误时,Yama 都会向 stderr 警告并省略
|
|
481
|
+
`--model`,使用同一 Agent 默认模型重试一次。默认模型失败时,以原始完整 model 对象回退
|
|
482
|
+
API;外部取消立即终止,不触发重试。本地 Agent 不接收 `temperature`;
|
|
483
|
+
`temperature: 0` 的稳定作用仅限 API Judge。local-first 固定为“主 Agent → 原始 API →
|
|
484
|
+
结束”,不会进入 Workspace fallback Agent。
|
|
485
|
+
- 对未命中内置系列或映射的 Case Judge 模型,只有原始 API 因可重试错误耗尽
|
|
486
|
+
`max_retries`,且 `yama.toml` 配置了下面的完整 table 时才启用额外兜底;未配置或
|
|
487
|
+
原始 API 错误不可重试时不兜底:
|
|
488
|
+
|
|
489
|
+
```toml
|
|
490
|
+
[defaults.judge.local.models.cursor]
|
|
491
|
+
"x-ai/grok-4" = "grok-4-fast"
|
|
492
|
+
"kimi.k3" = "kimi-k3"
|
|
493
|
+
|
|
494
|
+
[defaults.judge.local.agent]
|
|
495
|
+
name = "claude" # "claude"、"codex" 或 "cursor"
|
|
496
|
+
model = "claude-sonnet-4-5"
|
|
497
|
+
```
|
|
498
|
+
|
|
499
|
+
顺序是:配置的本地 Agent + 模型 → 该次尝试发生任何错误时省略 `--model` 使用同一
|
|
500
|
+
Agent 默认模型 → 结束。默认模型失败后不再调用 fallback-model API。`name` 非
|
|
501
|
+
`claude`/`codex`/`cursor`、映射冲突、`model` 为空或 table 层级错误会在 Workspace
|
|
502
|
+
加载时直接报配置错误。
|
|
503
|
+
- HTML 报告会按顺序展示完整 Judge 尝试链、映射/原始配置/默认/兜底来源、API retry 和脱敏失败;
|
|
504
|
+
Claude Code/Cursor 会显示 init 事件上报的实际模型,Codex 默认未上报时明确标注。
|
|
505
|
+
- Cursor Judge 只为当前隔离空临时目录传入 `--trust` 以跳过 Workspace Trust 交互;不带
|
|
506
|
+
`--force`/`--yolo`,也不修改 Cursor 全局信任配置。
|
|
479
507
|
- `judge.model` 只接受非空字符串或对象;字符串必须非空,显式对象必须包含自己的
|
|
480
508
|
非空字符串 `name`,否则会在 LLM 调用前报 `AssertionConfigurationError`。
|
|
481
509
|
- 每维原始分 1..5,规范化 `(score-1)/4` 后按 weight 加权平均得 `overall`(0..1)。
|
{python_yama-0.10.2 → python_yama-0.10.4}/skills/eval-plugin-with-yama/references/debugging.md
RENAMED
|
@@ -108,7 +108,7 @@ CI 若开启 `yama pr-run --report --upload-report --commit-id <sha>`,上传
|
|
|
108
108
|
| --- | --- | --- |
|
|
109
109
|
| `tool has no mock handler: <name>` | 模型调用了未声明的 Tool,`error_kind=framework` | 若该调用合理:补 `context.tools` + `mocks.tools`;若不合理:这本身就是发现的缺陷,改 Prompt/Skill 或用 `tool_not_called` 显式断言并调整 Case 设计 |
|
|
110
110
|
| `mock response sequence exhausted: <name>` | `respond.sequence` 条目数少于实际调用次数,`error_kind=framework` | 补足 sequence 条目,或换 `handler` 按 `context.state` 计数动态返回 |
|
|
111
|
-
| `asyncio.TimeoutError` / 超时相关 | 单 Step 超过 `timeout_seconds_per_step`(默认
|
|
111
|
+
| `asyncio.TimeoutError` / 超时相关 | 单 Step 超过 `timeout_seconds_per_step`(默认 300s),`status=error`。注意:**超时终止整条 run**,与 max_tool_rounds 只失败当前 Step 不同 | 模型陷入长循环?先看 `requests/` 里最后几轮在干什么;确属正常慢则调大 `execution.timeout_seconds_per_step` |
|
|
112
112
|
| Handler 的 Python traceback(`MockImplementationError`) | Mock/Checker 自身抛了未预期异常,或返回值/state 不可 JSON 序列化,`error_kind=framework` | 修 Handler 代码;业务错误应改用 `raise ToolMockError(...)`,那才是模型可见的正常路径 |
|
|
113
113
|
| `requests/request-00N.json` 带 `error` 字段 | LLM 请求失败(认证、路由、限流),`status=error` | 检查必需的 `YAMA_LLM_API_KEY`、`YAMA_LLM_BASE_URL` 或 Case 的 `model.base_url`,以及 `model.name` 是否是 endpoint 支持的模型名;默认 adapter 不读取 `OPENAI_API_KEY` |
|
|
114
114
|
|
|
@@ -186,9 +186,12 @@ Judge:被 tag 容忍的 hard check 失败依然会让该 Step 的 `hard_pass`
|
|
|
186
186
|
级附加门槛。
|
|
187
187
|
- 读 `reason`/`evidence` 判断是回复真的不好,还是 `criteria` 写得含糊让 Judge 理解
|
|
188
188
|
偏了——criteria 应描述可观察的判分标准,而不是抽象形容词。
|
|
189
|
-
- 被测 Agent 调用始终走 API。普通非 CI 运行的 Judge
|
|
190
|
-
|
|
191
|
-
|
|
189
|
+
- 被测 Agent 调用始终走 API。普通非 CI 运行的 Judge 才会本地优先:OpenAI/GPT/o
|
|
190
|
+
系列交给 Codex,Claude/Anthropic 系列交给 Claude Code,Grok/xAI 系列交给 Cursor;
|
|
191
|
+
无精确映射时三个 Agent 都先用原始 Judge 模型名,
|
|
192
|
+
其他模型只有精确映射命中才走本地。CI 和 `yama pr-run` 的 Judge 只走 API。被测 Agent 的 API 单次
|
|
193
|
+
attempt 默认 timeout 为 180 秒;Judge API 单次 attempt 与本地 Judge 进程默认均为
|
|
194
|
+
120 秒,整 Step timeout 仍独立默认为 300 秒。
|
|
192
195
|
- Judge 模型配置报错或与预期不同时,先确认所有权:省略 `judge.model` 才会深拷贝
|
|
193
196
|
完整的 Case `model`(含全部请求选项);`judge.model: gpt-5` 是独立的仅含 `name`
|
|
194
197
|
简写;显式对象必须自行提供非空字符串 `name`,且绝不继承 Case 模型的名称或其他
|
|
@@ -203,17 +206,41 @@ Judge:被 tag 容忍的 hard check 失败依然会让该 Step 的 `hard_pass`
|
|
|
203
206
|
|
|
204
207
|
旧版同级 `judge.temperature` 会覆盖选中模型的 `temperature`;两处都省略时,Yama
|
|
205
208
|
不会补充 temperature 值(does not synthesize a temperature value)。
|
|
206
|
-
-
|
|
207
|
-
`--model
|
|
208
|
-
|
|
209
|
+
- 普通运行中,精确映射的本地 slug 或原始 Judge 模型名的本地尝试发生任何错误时,Yama
|
|
210
|
+
都会先警告并省略 `--model`,使用同一 Agent 默认模型重试一次。这个决定不依赖 Agent
|
|
211
|
+
错误文案;例如 `Cannot use this model: grok.4.5`、超时或输出校验失败都会重试。默认模型
|
|
212
|
+
可能因机器或时间而变化;这次重试失败时,Yama 用原始完整 model 对象回退 API。
|
|
209
213
|
本地两次尝试只使用兼容的 `reasoning_effort`,不接收 `temperature`;因此 Judge
|
|
210
214
|
波动大时仍应用 `execution.repeat` 观察 `pass_rate`,`temperature: 0` 只能稳定 API
|
|
211
|
-
Judge,不能保证本地 Judge 可复现。
|
|
215
|
+
Judge,不能保证本地 Judge 可复现。Case Judge 模型已走这条本地优先路径时,不会再
|
|
216
|
+
使用 Workspace 配置的额外兜底。
|
|
217
|
+
- 未命中内置系列或精确映射的 Case Judge 模型,只有原始 API 因可重试错误耗尽
|
|
218
|
+
`max_retries` 后才检查 `yama.toml` 的可选 `[defaults.judge.local.agent]`。未配置、
|
|
219
|
+
原始错误不可重试或 CI/`pr-run` 环境都不兜底。配置示例:
|
|
220
|
+
|
|
221
|
+
```toml
|
|
222
|
+
[defaults.judge.local.models.cursor]
|
|
223
|
+
"x-ai/grok-4" = "grok-4-fast"
|
|
224
|
+
"kimi.k3" = "kimi-k3"
|
|
225
|
+
|
|
226
|
+
[defaults.judge.local.agent]
|
|
227
|
+
name = "claude" # "claude"、"codex" 或 "cursor"
|
|
228
|
+
model = "claude-sonnet-4-5"
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
触发后依次使用配置的本地 Agent + 模型;该次尝试发生任何错误时省略 `--model` 使用
|
|
232
|
+
同一 Agent 默认模型;默认模型仍失败就直接结束,不再调用 fallback-model API。若观察不到
|
|
233
|
+
预期兜底,先检查错误是否确实可重试、重试是否已经耗尽、配置 table 是否存在,以及
|
|
234
|
+
`name`/`model` 是否有效。
|
|
212
235
|
- 本地 Codex/Claude 会收到兼容其严格模式的 Judge Schema 副本,返回后仍由 Yama 按原始
|
|
213
236
|
Schema 严格检查维度数量、名称和顺序。Codex 的 SQLite 状态放在本次 Judge 临时目录,
|
|
214
237
|
不写 `~/.codex/state_5.sqlite`,也不改变 `CODEX_HOME` 中的认证与默认模型。若仍失败,
|
|
215
238
|
警告会同时摘要 stdout 和 stderr;其中 `invalid_json_schema`、模型拒绝等真实错误通常在
|
|
216
|
-
stdout,插件启动 warning 通常在 stderr
|
|
239
|
+
stdout,插件启动 warning 通常在 stderr。Cursor 使用 `agent`(兼容 `cursor-agent`)的
|
|
240
|
+
stream-json 模式,只为本次隔离空临时目录传入 `--trust` 以跳过 Workspace Trust 交互,
|
|
241
|
+
不带 `--force`/`--yolo`,也不修改 Cursor 全局信任配置。HTML 的 Judge attempts 会显示
|
|
242
|
+
完整调用链、retry、映射/原始配置/默认来源及可获得的实际模型;Codex 默认模型未上报时
|
|
243
|
+
会明确标注。
|
|
217
244
|
- `AssertionConfigurationError: judge returned invalid JSON: ...` 表示 Judge 违反了输出协议,
|
|
218
245
|
常见表现是用 `「」`、`“”` 或单引号给 `reason`/`evidence` 定界。Judge 的系统提示词已
|
|
219
246
|
明确要求所有 key 和字符串值使用 ASCII 双引号;错误仍出现时应保留原始输出用于定位,
|