This is an automated email from the ASF dual-hosted git repository.

zyxxoo pushed a commit to branch refactor/rust-rewrite-design
in repository https://gitbox.apache.org/repos/asf/hugegraph.git


The following commit(s) were added to refs/heads/refactor/rust-rewrite-design 
by this push:
     new 72e93e01d chore(codex): add locked logged automation runner
72e93e01d is described below

commit 72e93e01d55bd1bca523fc7057b144228b510b51
Author: vaughn <[email protected]>
AuthorDate: Sun Sep 13 18:38:50 2026 +0800

    chore(codex): add locked logged automation runner
---
 tools/run-codex-loop.sh | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/tools/run-codex-loop.sh b/tools/run-codex-loop.sh
index 5ccfee5cb..5b12f4f09 100755
--- a/tools/run-codex-loop.sh
+++ b/tools/run-codex-loop.sh
@@ -1,16 +1,21 @@
 #!/usr/bin/env bash
-set -u
+set -euo pipefail
 
 repo_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
 sentinel="${CODEX_LOOP_SENTINEL:-/tmp/hugegraph-rust-rewrite-go}"
 prompt="继续原目标。不要询问是否继续,不要只汇报状态。只要还有可执行工作,就立刻修改、测试、归档证据、提交或推送。不要调用 blocked。只有 
Go/No-Go 清单明确为 GO 后,创建 ${sentinel} 并停止。"
+lock_file="${CODEX_LOOP_LOCK:-/tmp/hugegraph-rust-rewrite-codex.lock}"
+log_file="${CODEX_LOOP_LOG:-${repo_dir}/docs/evidence/rust-rewrite/codex-loop.log}"
 
 cd "$repo_dir" || exit 1
 command -v codex >/dev/null || { echo "codex CLI not found" >&2; exit 127; }
+exec 9>"$lock_file"
+flock -n 9 || { echo "another Codex loop is already running: $lock_file" >&2; 
exit 2; }
 while [[ ! -e "$sentinel" ]]; do
+    date -u +"%Y-%m-%dT%H:%M:%SZ loop-start" | tee -a "$log_file"
     codex resume --last \
         --dangerously-bypass-approvals-and-sandbox \
-        "$prompt"
+        "$prompt" 2>&1 | tee -a "$log_file"
     status=$?
     [[ -e "$sentinel" ]] && break
     echo "codex session exited with status $status; resuming in 2s" >&2

Reply via email to