From b290531369e2c2d285e87d3409853a0e5fea8e71 Mon Sep 17 00:00:00 2001 From: host Date: Mon, 26 Oct 2026 02:49:58 +0800 Subject: [PATCH 1/3] Ignore host-state backup files host-state-real.json.bak* kept appearing as untracked files in git status (the base names were ignored, the .bak rotations were not). Ignore the rotation files so a future git add does not accidentally commit local state backups. --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index ce5deac..32e9aae 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,4 @@ __pycache__/ *.tmp.* host-config.json host-config-real.json +host-state-real.json.bak* From 50bc03cd5140e2d5720e680db6ecaf87d9756419 Mon Sep 17 00:00:00 2001 From: host Date: Mon, 26 Oct 2026 02:59:06 +0800 Subject: [PATCH 2/3] Make host tests independent of global git identity CI failed on the first real PR because five test commits relied on a global user.name/user.email, which GitHub runners do not set. Pass -c user.name=Test -c user.email=test@example.com on every test commit, matching the helper that already does this for the other tests. host.py worktree commits inherit the repo config set by _init_git_repo, so they needed no change. --- tests/test_host.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/test_host.py b/tests/test_host.py index 844f8f4..304a9e1 100644 --- a/tests/test_host.py +++ b/tests/test_host.py @@ -93,7 +93,7 @@ class MergeVerifyTest(unittest.TestCase): " self.assertEqual(f(), 1)\n") (tests_dir / "test_mod.py").write_text(body, encoding="utf-8") subprocess.run(["git", "add", "-A"], cwd=tmp, check=True) - subprocess.run(["git", "commit", "-qm", "initial"], cwd=tmp, + subprocess.run(["git", "-c", "user.name=Test", "-c", "user.email=test@example.com", "commit", "-qm", "initial"], cwd=tmp, check=True) # worktree 手动建:模拟 host 的 worktree/分支 subprocess.run(["git", "worktree", "add", os.path.join(tmp, "wt"), @@ -142,7 +142,7 @@ class MergeVerifyTest(unittest.TestCase): Path(tmp, "mod.py").write_text("def f():\n return 1\n", encoding="utf-8") subprocess.run(["git", "add", "-A"], cwd=tmp, check=True) - subprocess.run(["git", "commit", "-qm", "initial"], cwd=tmp, + subprocess.run(["git", "-c", "user.name=Test", "-c", "user.email=test@example.com", "commit", "-qm", "initial"], cwd=tmp, check=True) # 分支1:加 add2 subprocess.run(["git", "worktree", "add", @@ -458,7 +458,7 @@ class GithubPRTest(unittest.TestCase): _init_git_repo(tmp) Path(tmp, "f.txt").write_text("x\n") subprocess.run(["git", "add", "-A"], cwd=tmp, check=True) - subprocess.run(["git", "commit", "-qm", "initial"], + subprocess.run(["git", "-c", "user.name=Test", "-c", "user.email=test@example.com", "commit", "-qm", "initial"], cwd=tmp, check=True) task = {"name": "t", "branch": "host/t", "status": "completed", "prompt": "do it"} @@ -473,12 +473,12 @@ class GithubPRTest(unittest.TestCase): _init_git_repo(repo) Path(repo, "f.txt").write_text("x\n") subprocess.run(["git", "add", "-A"], cwd=repo, check=True) - subprocess.run(["git", "commit", "-qm", "initial"], + subprocess.run(["git", "-c", "user.name=Test", "-c", "user.email=test@example.com", "commit", "-qm", "initial"], cwd=repo, check=True) subprocess.run(["git", "checkout", "-qb", "host/t1"], cwd=repo, check=True) Path(repo, "f.txt").write_text("y\n") - subprocess.run(["git", "commit", "-qam", "change"], + subprocess.run(["git", "-c", "user.name=Test", "-c", "user.email=test@example.com", "commit", "-qam", "change"], cwd=repo, check=True) remote = os.path.join(tmp, "remote.git") subprocess.run(["git", "init", "--bare", "-q", remote], From 19cf44551a9f501f3c0b23b3d5057b276fec941b Mon Sep 17 00:00:00 2001 From: host Date: Mon, 26 Oct 2026 03:00:30 +0800 Subject: [PATCH 3/3] Skip server-restart test when codex binary is absent CI failed on the first real PR with FileNotFoundError: 'codex': the test starts the real app-server, but GitHub runners have no codex binary on PATH (locally it passes because the VM has one). Skipping when shutil.which('codex') is None keeps CI green on runners while the test still runs wherever the binary exists. --- tests/test_host.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/test_host.py b/tests/test_host.py index 304a9e1..ccb7698 100644 --- a/tests/test_host.py +++ b/tests/test_host.py @@ -1,5 +1,6 @@ import json import os +import shutil import subprocess import sys import tempfile @@ -273,9 +274,12 @@ class StateVersionTest(unittest.TestCase): class ServerRestartTest(unittest.TestCase): + @unittest.skipUnless(shutil.which("codex"), + "codex binary not on PATH (e.g. GitHub runner)") def test_kill_then_ensure_alive(self): # 不跑模型:只验证 server 进程死了能重拉、list 能通。 # 用配对二进制(VM 本机补丁),隔离 CODEX_HOME。 + # Runner 上没有 codex 二进制时跳过,而不是失败。 import host as host_mod with tempfile.TemporaryDirectory() as tmp: codex_home = os.path.join(tmp, "codex-home")