#!/bin/bash # Codex resume cron - runs every 6h for 2 days # Session: 019d4629-0c5e-7620-8abd-54f92c49ca00 # Auto-expires: 2026-04-05 (remove crontab entry after this date) set -euo pipefail REPO="/mnt/HC_Volume_103713257/tilbudgivern" SESSION_ID="019d4629-0c5e-7620-8abd-54f92c49ca00" LOGFILE="$REPO/logs/codex-resume-cron.log" EXPIRE_DATE="2026-04-05" # Stop if past expiry if [[ "$(date -u +%Y-%m-%d)" > "$EXPIRE_DATE" ]]; then echo "$(date -u --iso-8601=seconds) [INFO] Past expiry $EXPIRE_DATE — skipping run" >> "$LOGFILE" exit 0 fi # Ensure log dir exists mkdir -p "$(dirname "$LOGFILE")" # Set PATH to include nvm node export PATH="/home/alex/.nvm/versions/node/v22.22.0/bin:$PATH" export HOME="/home/alex" cd "$REPO" echo "$(date -u --iso-8601=seconds) [INFO] Starting codex resume for session $SESSION_ID" >> "$LOGFILE" PROMPT="Continue working on the Ordrestyring Heartblood plan. Read docs/plans/ORDRESTYRING_HEARTBLOOD_PLAN_2026-04-02.md and run 'git log --oneline -20' to see current state. Then continue implementing whatever is not yet done: Spor A (GROUP_CONCAT fix + staging-swap i syncCaseFeatures), Spor B (offer snapshots fejlhåndtering), Spor C (prisfriskhed). Kør unit tests hvor muligt og commit + push hvert afsluttet spor til main." codex exec resume "$SESSION_ID" "$PROMPT" \ --full-auto \ >> "$LOGFILE" 2>&1 EXIT_CODE=$? echo "$(date -u --iso-8601=seconds) [INFO] codex exited with code $EXIT_CODE" >> "$LOGFILE" exit $EXIT_CODE