docs: backfill env template and migration notes for M2

This commit is contained in:
2026-07-21 01:28:33 -04:00
parent 9aa97a61ae
commit 724dc3c328
10 changed files with 59 additions and 30 deletions
@@ -56,9 +56,7 @@ def _advance_dependent_cases() -> set[str]:
def test_meta_variants_cover_all_time_cases():
"""完整性守卫: 契约的时间用例集合 == 本文件变体集合(1:1 映射表机械化)。"""
variants = {
name.removeprefix("test_variant_")
for name in globals()
if name.startswith("test_variant_")
name.removeprefix("test_variant_") for name in globals() if name.startswith("test_variant_")
}
assert variants == _advance_dependent_cases()
+2 -6
View File
@@ -94,14 +94,10 @@ class TestEmbedTransport:
assert payload == {"model": "embed-1", "input": ["a", "b"]}
return httpx.Response(
200,
json=_ok_body(
[[1.0, 0.0], [0.0, 1.0]], usage={"prompt_tokens": 5}, shuffle=True
),
json=_ok_body([[1.0, 0.0], [0.0, 1.0]], usage={"prompt_tokens": 5}, shuffle=True),
)
result = await _transport_with(handler).embed(
texts=["a", "b"], source=_src(), call_id="c"
)
result = await _transport_with(handler).embed(texts=["a", "b"], source=_src(), call_id="c")
assert result.vectors == [[1.0, 0.0], [0.0, 1.0]] # 乱序响应按 index 重排
assert result.dim == 2
assert result.prompt_tokens == 5 and result.usage_source == "measured"
+5 -2
View File
@@ -28,8 +28,11 @@ def _mini_harness_db(path):
" completion_tokens INTEGER, stop_reason TEXT, steps_json TEXT)"
)
steps = [
{"thought": f"思考{i}", "tool_call": {"tool": "view_node", "args": {"i": i}},
"tool_output": f"输出{i}" * 50}
{
"thought": f"思考{i}",
"tool_call": {"tool": "view_node", "args": {"i": i}},
"tool_output": f"输出{i}" * 50,
}
for i in range(3)
]
conn.execute(