Skip to content

Research Lab

Each chapter links a mechanism to an observable result. Use the checks here to verify a claim, identify what remains open, and choose one variable to test.

In the upstream fixture, the model requests exec_command. Codex runs the command and sends the result to the model with the original call_id. This lab checks two reduced teaching examples based on that fixture. The request omits unrelated fields and uses an illustrative wall time. Scripted call and assertion

  1. Save the provider event, next model request, and checker in the same directory.
  2. With Python 3 installed, run this from that directory. The checker should print PASS: exec-command-tool-call matched exit code 0 and output 'tool harness' and exit with status 0.
Terminal window
python3 check.py 01-provider-event.json 02-next-model-request.json
  1. Copy the next request to wrong-call.json. In that copy, change only the call_id of the function_call_output item to other-call. The checker should print that it found zero matching results and exit with a nonzero status.
Terminal window
python3 check.py 01-provider-event.json wrong-call.json

This check runs offline and isolates call-to-result matching. To verify the runtime itself, use the upstream fixture command and pass criteria. That test executes the command through Codex and captures the actual second provider request.

Run the pinned CLI against a scripted provider

Section titled “Run the pinned CLI against a scripted provider”

Download the native Codex CLI 0.172.0 release for your system. Save the runner beside the provider event and checker. Run the checks with Python 3 and pass the path to the extracted executable.

Terminal window
python3 run-with-codex.py tool-call /path/to/codex
python3 run-with-codex.py plan-error /path/to/codex
python3 run-with-codex.py memory /path/to/codex

The runner starts a temporary provider on loopback and gives Codex a fresh home and a read-only shell sandbox. The tool probe scripts a fixed echo tool harness and checks one completed CLI turn, two HTTP requests, and a matching result in the second request. The plan-error probe enables the checklist tool, supplies JSON missing its required plan field, and looks up the parse error by call ID in request two. The memory probe runs two fresh sessions with the same seeded summary and prompt. It changes only memories.use_memories and checks for the marker in the developer input. The scripted provider needs no account or credentials.

All three probes passed with the native 0.172.0 release on arm64 macOS. The memory result was marker present with reads enabled and marker absent with reads disabled. The tool probe needs a host that allows Codex to start its read-only sandbox. In a nested runner that rejected the sandbox, Codex returned the sandbox error under the original call ID.

  1. State the claim. Name the observed behavior and its boundary. For example, “at least one provider request in the parent’s follow-up turn includes the child’s completion notification.”
  2. Name the evidence. Record the CLI version, commit, fixture or command, inputs, and observed result. For source inspection, cite the assertion and state what it measures. For an executed check, record its environment and any skipped cases.
  3. Change one variable. Keep the baseline, task, and metric fixed. Define what result would count against your hypothesis before collecting runs.
  4. Record the result and its scope. Log failures and ambiguous cases as well as successes. Use the result to decide whether to revise the hypothesis or expand the evaluation.
Mechanism Example comparison Outcome to record
Tool failure Generic rejection vs. the same rejection naming the missing field First follow-up call has valid arguments.
Compaction Summary only vs. the same summary plus a structured version field The next action uses the correct file version.
Subagent handoff Prose vs. structured handoff carrying the same evidence Parent cites the evidence and uses the correct version.

Use this checklist with your own inputs and expected outcome.

Question and falsifying result:
Codex version, commit, model and mode:
Evidence source and command:
Inputs, baseline, and one change:
Expected outcome:
Observed outcome and deviations:
What this run supports:

For reproducible harness behavior, start with the fixed provider fixture. To study model behavior, keep the harness and prompts fixed across conditions and record the model, settings, and number of trials.

Continue with Resources for research vocabulary and related work, or Contributing to submit a source trace or a reproducible result.