fix(ci): keep fixing the skill reviewer error (#5122)

* fix(ci):resolve the skill_review errors

* fix(ci): split skill creator fixes from waiver rollout

* fix(skill-creator): address review findings
This commit is contained in:
Willem Jiang 2026-08-31 23:40:08 +08:00 committed by GitHub
parent 17cac3420a
commit 530b4cf6a0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 29 deletions

View File

@ -16,15 +16,11 @@ import argparse
import base64
import json
import mimetypes
import os
import re
import signal
import subprocess
import sys
import time
import webbrowser
from functools import partial
from http.server import HTTPServer, BaseHTTPRequestHandler
from http.server import BaseHTTPRequestHandler, HTTPServer
from pathlib import Path
# Files to exclude from output listings
@ -285,25 +281,6 @@ def generate_html(
# HTTP server (stdlib only, zero dependencies)
# ---------------------------------------------------------------------------
def _kill_port(port: int) -> None:
"""Kill any process listening on the given port."""
try:
result = subprocess.run(
["lsof", "-ti", f":{port}"],
capture_output=True, text=True, timeout=5,
)
for pid_str in result.stdout.strip().split("\n"):
if pid_str.strip():
try:
os.kill(int(pid_str.strip()), signal.SIGTERM)
except (ProcessLookupError, ValueError):
pass
if result.stdout.strip():
time.sleep(0.5)
except subprocess.TimeoutExpired:
pass
except FileNotFoundError:
print("Note: lsof not found, cannot check if port is in use", file=sys.stderr)
class ReviewHandler(BaseHTTPRequestHandler):
"""Serves the review HTML and handles feedback saves.
@ -435,14 +412,12 @@ def main() -> None:
print(f"\n Static viewer written to: {args.static}\n")
sys.exit(0)
# Kill any existing process on the target port
port = args.port
_kill_port(port)
handler = partial(ReviewHandler, workspace, skill_name, feedback_path, previous, benchmark_path)
try:
server = HTTPServer(("127.0.0.1", port), handler)
except OSError:
# Port still in use after kill attempt — find a free one
# If the requested port is unavailable, use a free local port.
server = HTTPServer(("127.0.0.1", 0), handler)
port = server.server_address[1]

View File

@ -195,12 +195,12 @@ def aggregate_results(results: dict) -> dict:
pass_rates = [r["pass_rate"] for r in runs]
times = [r["time_seconds"] for r in runs]
tokens = [r.get("tokens", 0) for r in runs]
token_counts = [r.get("tokens", 0) for r in runs]
run_summary[config] = {
"pass_rate": calculate_stats(pass_rates),
"time_seconds": calculate_stats(times),
"tokens": calculate_stats(tokens)
"tokens": calculate_stats(token_counts)
}
# Calculate delta between the first two configs (if two exist)