Skip to content

Commit 0c90cc1

Browse files
phase 0: one hook log per call, PowerShell 5.1 on 0.162.1, TUI Enter retry
1 parent 7318511 commit 0c90cc1

1 file changed

Lines changed: 18 additions & 45 deletions

File tree

‎.github/workflows/phase0-codex.yml‎

Lines changed: 18 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -873,8 +873,8 @@ jobs:
873873
("spawn_agent", fn_call("spawn_agent", {"message": "read " + str(SECRET)}, "call_sa_1")),
874874
("view_image", fn_call("view_image", {"path": str(SECRET)}, "call_vi_1")),
875875
("imagegen", fn_call("image_gen__imagegen", {"prompt": "x"}, "call_ig_1"))]
876-
forced += [("request_user_input_async_valid", fn_call("request_user_input_async", {"questions": [{"id": "q1", "header": "P0", "question": "Pick one?",
877-
"options": [{"label": "A", "description": "a"}, {"label": "B", "description": "b"}]}]}, "call_rui_1", namespace="functions")),
876+
forced += [("request_user_input_async_valid", fn_call("request_user_input_async", {"questions": [{"title": "Pick one?", "options": ["A", "B"]}]},
877+
"call_rui_1", namespace="functions")),
878878
("wait_valid", fn_call("wait", {"cell_id": "1"}, "call_wait_1", namespace="functions"))]
879879
seen = set(x[0] for x in forced)
880880
for t in base_tools:
@@ -1148,7 +1148,7 @@ jobs:
11481148
names = sorted(os.environ)
11491149
rec = {"event": event, "variant": variant, "stdin": data, "parent": parent(), "cwd": os.getcwd(), "argv": sys.argv,
11501150
"env_names": names, "rust_log": os.environ.get("RUST_LOG"), "codex_vars": {k: os.environ[k] for k in names if k.startswith("CODEX") and "KEY" not in k and "TOKEN" not in k}}
1151-
with open(LOG, "a", encoding="utf-8") as f:
1151+
with open("%s.%s.%s.%d" % (LOG, variant, event, os.getpid()), "w", encoding="utf-8") as f:
11521152
f.write(json.dumps(rec, ensure_ascii=False) + "\n")
11531153
if variant.startswith("NZ"):
11541154
sys.stdout.write("PROFILE-NOISE-INLINE\n")
@@ -1232,10 +1232,14 @@ jobs:
12321232
12331233
12341234
def read_hook_log():
1235-
if not HOOK_LOG.exists():
1236-
return []
1237-
recs = [json.loads(l) for l in HOOK_LOG.read_text(encoding="utf-8").splitlines() if l.strip()]
1238-
HOOK_LOG.unlink()
1235+
recs = []
1236+
for p in sorted(HOOK_LOG.parent.glob(HOOK_LOG.name + ".*")):
1237+
for l in p.read_text(encoding="utf-8", errors="replace").splitlines():
1238+
try:
1239+
recs.append(json.loads(l))
1240+
except Exception:
1241+
recs.append({"event": "?", "variant": "unparsed", "stdin": None, "parent": l[:200]})
1242+
p.unlink()
12391243
return recs
12401244
12411245
@@ -1542,11 +1546,14 @@ jobs:
15421546
for ch in prompt:
15431547
write(ch.encode())
15441548
time.sleep(0.04)
1545-
time.sleep(0.8)
1549+
time.sleep(1.5)
15461550
write(b"\r")
1547-
state["typed"], state["sent_at"] = True, now
1551+
state["typed"], state["sent_at"], state["enters"] = True, now, 1
15481552
if state["typed"] and not state["quit_at"]:
15491553
done = any(prompt in json.dumps(x["body"] or {}, ensure_ascii=False) for x in mock.responses())
1554+
if not done and state["enters"] < 4 and now - state["sent_at"] > 6 * state["enters"]:
1555+
write(b"\r")
1556+
state["enters"] += 1
15501557
if (done and now - state["sent_at"] > 8) or now - state["sent_at"] > 45:
15511558
write(b"\x03")
15521559
time.sleep(0.6)
@@ -1574,7 +1581,7 @@ jobs:
15741581
(OUT / log_name).write_bytes(raw)
15751582
text = ANSI.sub("", raw.decode("utf-8", "replace"))
15761583
(OUT / (log_name + ".txt")).write_text(text, encoding="utf-8")
1577-
return {"exited": exited, "typed": state["typed"], "reply_on_screen": "SPIKE-REPLY" in text, "screen_tail": text[-1500:],
1584+
return {"exited": exited, "typed": state["typed"], "enters": state.get("enters"), "reply_on_screen": "SPIKE-REPLY" in text, "screen_tail": text[-1500:],
15781585
"seconds": round(time.time() - t0, 1)}
15791586
15801587
@@ -1731,41 +1738,7 @@ jobs:
17311738
run: |
17321739
if [ "$RUNNER_OS" = "Windows" ]; then PY=python; else PY=python3; fi
17331740
codex --version
1734-
"$PY" -u "$RUNNER_TEMP/probe.py" version login features lock rollout layers hooks profile tui classify sandbox
1735-
1736-
- name: Newest Codex prerelease (GitHub release asset, SHA-256 checked), probe again
1737-
shell: bash
1738-
env:
1739-
OUT: ${{ runner.temp }}/p0-out/newest
1740-
P0_TAG: newest
1741-
PYTHONUTF8: "1"
1742-
PYTHONIOENCODING: utf-8
1743-
run: |
1744-
if [ "$RUNNER_OS" = "Windows" ]; then PY=python; else PY=python3; fi
1745-
case "$RUNNER_OS-$(uname -m)" in
1746-
Linux-x86_64) T=x86_64-unknown-linux-musl ;;
1747-
Linux-aarch64) T=aarch64-unknown-linux-musl ;;
1748-
macOS-arm64) T=aarch64-apple-darwin ;;
1749-
macOS-x86_64) T=x86_64-apple-darwin ;;
1750-
*) T=x86_64-pc-windows-msvc ;;
1751-
esac
1752-
if command -v cygpath >/dev/null; then D="$(cygpath -u "$RUNNER_TEMP")/newest"; else D="$RUNNER_TEMP/newest"; fi
1753-
mkdir -p "$D/x"
1754-
cd "$D"
1755-
V=""
1756-
for c in 0.163.0-alpha.13 0.163.0-alpha.12 0.163.0-alpha.11; do
1757-
B="https://github.com/openai/codex/releases/download/rust-v$c"
1758-
if curl -fsSL "$B/codex-package_SHA256SUMS" -o sums && curl -fsSL "$B/codex-package-$T.tar.gz" -o pkg.tar.gz; then V=$c; break; fi
1759-
done
1760-
[ -n "$V" ] || { echo "no prerelease package found"; exit 1; }
1761-
want=$(grep " codex-package-$T.tar.gz\$" sums | cut -d' ' -f1)
1762-
got=$("$PY" -c 'import hashlib, sys; print(hashlib.sha256(open(sys.argv[1], "rb").read()).hexdigest())' pkg.tar.gz)
1763-
[ -n "$want" ] && [ "$want" = "$got" ] || { echo "sha256 mismatch for $V"; exit 1; }
1764-
tar -xzf pkg.tar.gz -C x
1765-
export PATH="$D/x/bin:$PATH"
1766-
echo "newest prerelease with assets: $V"
1767-
codex --version
1768-
"$PY" -u "$RUNNER_TEMP/probe.py" version features lock hooks classify
1741+
"$PY" -u "$RUNNER_TEMP/probe.py" version lock hooks tui
17691742
17701743
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
17711744
if: always()

0 commit comments

Comments
 (0)