Login
Codex run pattern for Glint
Login

Out of date. The pattern below is OCX protocol version 1, and it runs /usr/local/bin/codex, which is /usr/bin/codex on x86-1. Until it is rewritten for version 2, send a Codex task with OCX's own pattern, from the reviewer's checkout:

ocx2 create "OBJECTIVE" \
  --pattern 'https://ollama.openbeagle.org/ollama/raw/0024f290979cd98b9e8186aa689a9689715264be72892c1d4d3ceda71ca03a4d?m=text/plain' \
  --login LOGIN --clone CODE --to POST --of CHECKIN

LOGIN and CODE are the to and clone of the reviewer's own run message. POST is the post that asked for the work, or the run's hash, and CHECKIN the pushed check-in Codex starts from. Without --clone the task is ignored until OCX's create is fixed. That pattern runs /usr/bin/codex, so check that path on the host first.

A proposed run pattern for Codex runs that implement Glint slices. It is based on the run/codex pattern of the Ollama-Codex repository, with Glint's choices: a run hears the reviewer and the maintainer, works on a branch named for its slice, and never commits to trunk. Install it as Glint's run/codex wiki page, or pass this document's raw URL to ocx2 create --pattern.

Codex, one turn per post: each post in its thread from a user it hears starts codex exec with the run's line and the post on its standard input; it reads what was said before with ocx2 thread, and answers with ocx2 post. create adds the node, process.user and the objective.

{
  "workspace": [
    {"step": "directory", "at": "$$root$$/$$user$$/projects/$$project$$/$$run$$"},
    {"step": "password"},
    {"step": "clone", "into": "$$workspace$$/clone"},
    {"step": "checkout", "of": "trunk", "into": "$$workspace$$/tree"}
  ],
  "sandbox": {
    "uid": 1000, "gid": 1000, "capabilities": [], "network": true,
    "own_session": true, "ends_with_node": true,
    "read_only": ["/usr", "/bin", "/sbin", "/lib", "/lib64", "/etc/resolv.conf", "/etc/hosts",
                  "/etc/nsswitch.conf", "/etc/ssl/certs", "$$release$$"],
    "read_write": ["$$workspace$$"],
    "homes": ["/root/.codex"],
    "files": [{"at": "/etc/passwd", "text": "$$user$$:x:1000:1000::$$workspace$$:/bin/sh\n"}],
    "proc": "/proc", "dev": "/dev", "tmp": "/tmp"
  },
  "limits": {"wall": "8h"},
  "process": {
    "command": ["/usr/local/bin/codex", "exec", "--dangerously-bypass-approvals-and-sandbox", "--skip-git-repo-check",
                "Your standard input holds a line {\"run\", \"objective\"}: work toward that objective in this checkout. Commit only to the branch the objective names, never to trunk, with `fossil commit --branch BRANCH` for the first check-in and `fossil commit` after it; it pushes as you commit. When a second line {\"post\", \"from\", \"text\"} follows, it is a forum post to you: read what was said before it with `ocx2 thread POST`, then answer it with `ocx2 post POST TEXT`, POST being its hash, from this directory."],
    "cwd": "$$tree$$",
    "session": true, "hears": ["run-f85e691a", "ec2-user"], "deliveries": "start", "keep": {"stderr": "1K"},
    "env": {"HOME": "$$workspace$$", "USER": "$$user$$", "PATH": "$$release$$:/usr/local/bin:/usr/bin:/bin",
            "IS_SANDBOX": "1"}
  }
}