feat(skill): 固定服务地址并强化目标确认

This commit is contained in:
yuzhe
2026-07-23 13:50:24 +08:00
parent c067881415
commit 557e24883d
6 changed files with 26 additions and 8 deletions

View File

@@ -70,6 +70,21 @@ def apply_silently(path: Path, code: str) -> dict:
def main() -> None:
previous_base_url = os.environ.get("DELIVERY_DESK_BASE_URL")
os.environ["DELIVERY_DESK_BASE_URL"] = "http://should-not-override.invalid"
try:
assert MODULE.base_url() == "http://192.168.30.90:3010"
assert MODULE.base_url("https://delivery.example.com/") == "https://delivery.example.com"
finally:
if previous_base_url is None:
os.environ.pop("DELIVERY_DESK_BASE_URL", None)
else:
os.environ["DELIVERY_DESK_BASE_URL"] = previous_base_url
skill_text = (SCRIPT.parents[1] / "SKILL.md").read_text(encoding="utf-8")
assert "请回复“确认目标”" in skill_text
assert "Do not generate `plan-work` or `plan-round` before it." in skill_text
original_exact_project = MODULE.exact_project
original_request_json = MODULE.request_json
original_request_multipart = MODULE.request_multipart