# models.env: model routing for the scheduled run. LAB-AGNOSTIC: sourced by run.sh and agent-run.sh. # # Why two phases (enforced by the shell, not by prose): # One top-model session doing everything (pull, triage hundreds of items, route, write) re-sends a # huge context on every call. One such run cost a double-digit percentage of a WEEKLY plan limit, # every night. So: # Phase 1 INGEST a capable orchestrator that DELEGATES per-chunk triage to cheaper sub-agents, # routes into the wiki, and writes a compact BRIEF (raw/_index/digest-brief-DAY.md). # Phase 2 WRITE the best writer, in a FRESH session, reads only the brief and writes the digest. # Agents generally do NOT delegate unless explicitly told to, so the ingest prompt carries a # delegation clause (build_prompt.py fills @@DELEGATION@@). # # Backends: "claude" (claude -p) or "codex" (codex exec). Override anything per run from the env, # e.g. NIGHTLY_BACKEND=codex scripts/nightly/run.sh NIGHTLY_BACKEND="${NIGHTLY_BACKEND:-claude}" # ingest + helpers NIGHTLY_FAILOVER="${NIGHTLY_FAILOVER:-codex}" # used if the primary fails its probe or writes nothing; "" = none NIGHTLY_WRITER="${NIGHTLY_WRITER:-}" # phase-2 writer backend if different from the primary; "" = primary # Model ids per backend and role. Fill in the ids you have access to. CLAUDE_INGEST_MODEL="${CLAUDE_INGEST_MODEL:-}" CLAUDE_SUBAGENT_MODEL="${CLAUDE_SUBAGENT_MODEL:-}" CLAUDE_SUBAGENT_MODEL_ID="${CLAUDE_SUBAGENT_MODEL_ID:-}" CLAUDE_WRITER_MODEL="${CLAUDE_WRITER_MODEL:-}" CLAUDE_PROBE_MODEL="${CLAUDE_PROBE_MODEL:-}" CODEX_INGEST_MODEL="${CODEX_INGEST_MODEL:-}" CODEX_SUBAGENT_MODEL="${CODEX_SUBAGENT_MODEL:-}" CODEX_WRITER_MODEL="${CODEX_WRITER_MODEL:-}" CODEX_PROBE_MODEL="${CODEX_PROBE_MODEL:-}" INGEST_EFFORT="${INGEST_EFFORT:-medium}" WRITER_EFFORT="${WRITER_EFFORT:-high}" REPAIR_EFFORT="${REPAIR_EFFORT:-medium}" INGEST_TIMEOUT="${INGEST_TIMEOUT:-5400}" # seconds; also capped by DIGEST_WRITER_START WRITER_TIMEOUT="${WRITER_TIMEOUT:-2400}" REPAIR_TIMEOUT="${REPAIR_TIMEOUT:-1200}" DIGEST_WRITER_START="${DIGEST_WRITER_START:-06:00}" # the writer starts by this time no matter what ingest is doing