ai-agent-book 精选快照(<2MB 代码与文档,来自 github.com/bojieli/ai-agent-book)
Build latest book artifacts / build (push) Canceled after 0s
dependency resolution / resolve (3.11) (push) Canceled after 0s
dependency resolution / resolve (3.13) (push) Canceled after 0s
deploy-pages / build (push) Canceled after 0s
deploy-pages / deploy (push) Canceled after 0s
i18n consistency check / check (push) Canceled after 0s
provider adoption tests / test (chapter2/context-compression) (push) Canceled after 0s
provider adoption tests / test (chapter2/prompt-injection) (push) Canceled after 0s
provider adoption tests / test (chapter2/system-hint) (push) Canceled after 0s
provider adoption tests / test (chapter3/log-sanitization) (push) Canceled after 0s
web-search-agent tests / test (push) Canceled after 0s
web-search-agent tests / agentbook (push) Canceled after 0s
Build latest book artifacts / build (push) Canceled after 0s
dependency resolution / resolve (3.11) (push) Canceled after 0s
dependency resolution / resolve (3.13) (push) Canceled after 0s
deploy-pages / build (push) Canceled after 0s
deploy-pages / deploy (push) Canceled after 0s
i18n consistency check / check (push) Canceled after 0s
provider adoption tests / test (chapter2/context-compression) (push) Canceled after 0s
provider adoption tests / test (chapter2/prompt-injection) (push) Canceled after 0s
provider adoption tests / test (chapter2/system-hint) (push) Canceled after 0s
provider adoption tests / test (chapter3/log-sanitization) (push) Canceled after 0s
web-search-agent tests / test (push) Canceled after 0s
web-search-agent tests / agentbook (push) Canceled after 0s
This commit is contained in:
@@ -0,0 +1,71 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Continue the canonical Hermes session with independent review feedback."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import os
|
||||
from pathlib import Path
|
||||
import re
|
||||
import subprocess
|
||||
import sys
|
||||
import argparse
|
||||
|
||||
|
||||
ROOT = Path(__file__).resolve().parent
|
||||
RUN_ID = "exp9-8-hermes-gpt56luna-20260802-v1"
|
||||
MODEL = "openai/gpt-5.6-luna"
|
||||
SECRET_PATTERNS = (
|
||||
re.compile(r"sk-or-v1-[A-Za-z0-9_-]{20,}"),
|
||||
re.compile(r"sk-[A-Za-z0-9_-]{20,}"),
|
||||
)
|
||||
|
||||
|
||||
def parse_args() -> argparse.Namespace:
|
||||
parser = argparse.ArgumentParser(description=__doc__)
|
||||
parser.add_argument("--run-id", default=RUN_ID)
|
||||
parser.add_argument("--model", default=MODEL)
|
||||
parser.add_argument("--task", default="review_task.md")
|
||||
parser.add_argument("--output", default="hermes-review-transcript.txt")
|
||||
return parser.parse_args()
|
||||
|
||||
|
||||
def main() -> int:
|
||||
args = parse_args()
|
||||
if not os.getenv("OPENROUTER_API_KEY"):
|
||||
print("OPENROUTER_API_KEY is required", file=sys.stderr)
|
||||
return 2
|
||||
source = ROOT / "worktree" / "hermes-agent"
|
||||
output = ROOT / "validation" / args.run_id / "raw" / args.output
|
||||
env = os.environ.copy()
|
||||
env.update(
|
||||
{
|
||||
"HERMES_HOME": str(ROOT / ".hermes-home" / args.run_id),
|
||||
"HERMES_YOLO_MODE": "1",
|
||||
"PYTHONUNBUFFERED": "1",
|
||||
}
|
||||
)
|
||||
prompt = (ROOT / args.task).read_text(encoding="utf-8")
|
||||
result = subprocess.run(
|
||||
[
|
||||
"uv", "run", "hermes", "chat", "--continue",
|
||||
"--provider", "openrouter", "--model", args.model,
|
||||
"--toolsets", "terminal,skills", "-q", prompt,
|
||||
],
|
||||
cwd=source,
|
||||
env=env,
|
||||
text=True,
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.STDOUT,
|
||||
check=False,
|
||||
)
|
||||
text = result.stdout or ""
|
||||
if any(pattern.search(text) for pattern in SECRET_PATTERNS):
|
||||
raise RuntimeError("credential-shaped value detected in review transcript")
|
||||
output.parent.mkdir(parents=True, exist_ok=True)
|
||||
output.write_text(text, encoding="utf-8")
|
||||
print(text)
|
||||
return result.returncode
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
raise SystemExit(main())
|
||||
Reference in New Issue
Block a user