docs: 为全部代码补充中文注释并加入 AGENTS 注释规范

This commit is contained in:
cat-shark
2026-08-13 22:09:55 +08:00
parent 77e9ac6b7e
commit ac41a9a6da
29 changed files with 472 additions and 2 deletions
+7
View File
@@ -1,3 +1,9 @@
"""失败调用节点夹具。
健康检查成功但 /invoke 始终返回 500,支持通过 WOV_FAIL_INVALID_JSON 环境变量
切换为非法 JSON,用于验证 NodeManager 的错误响应解析分支。
"""
import http.server
import json
import os
@@ -19,6 +25,7 @@ class Handler(http.server.BaseHTTPRequestHandler):
if os.environ.get("WOV_FAIL_INVALID_JSON") == "1":
body = b"not-json"
else:
# 默认返回协议格式的失败 JSON,验证错误信息透传。
body = json.dumps({"status": "failed", "error": "boom"}).encode("utf-8")
self.send_header("Content-Length", str(len(body)))
self.end_headers()