In this article
Output is an observation during execution; command completion and task acceptance are additional states that need their own evidence.
A tool can emit useful output before its process ends. Codex workflows that run tests, builds or development servers need to preserve that lifecycle distinction. Otherwise a reassuring line can be mistaken for completed validation while the relevant process is still running.
Read activity events as lifecycle evidence
Codex exec JSONL output includes item events for command execution. The abbreviated example illustrates an in-progress item followed by completion; consult the installed version’s event schema for its complete fields. Keep the item identity stable as the interface updates the operation.
{"type":"item.started","item":{"id":"cmd_example","type":"command_execution","command":"npm test","status":"in_progress"}}
{"type":"item.completed","item":{"id":"cmd_example","type":"command_execution","command":"npm test","status":"completed"}}
Match the process to its intended role
A build normally has a terminal result, while a development server is expected to keep running. The same rule of waiting for process exit would be unsuitable for both. Describe the intended role before choosing the observation that establishes readiness. For a server, a successful request to the expected page may be relevant while the server process remains active.
Keep output and acceptance distinct
A test runner can announce that it discovered tests before executing them. A compiler can print a module name before reporting a later failure. Those lines are useful progress evidence without being final acceptance. A small observation table keeps the distinction visible in the agent’s reasoning and final report.
| Observation | Supported interpretation | Still separate |
|---|---|---|
| Output text arrived | The process emitted that text | Whether the process has ended. |
| Process completed | Execution reached its terminal state | Whether the application behavior satisfies the task. |
| A fixture passed | The tested expectation held for that run | Coverage of cases the fixture did not exercise. |
Retain the command context
The working directory, selected test target and relevant environment determine what a command actually checks. Running the same spelling elsewhere can exercise different files. A reproducible handoff names those conditions alongside the observed terminal result. This matters when Codex uses several worktrees or when an application starts tool processes in a directory different from the user’s visible editor project.
Return the smallest sufficient completion record
For a bounded test command, record what ran, its terminal result and the behavior covered by the fixture. For a long-lived server, record the readiness observation and how the user can reach it. These records differ because the processes serve different purposes. Neither requires dumping every output line, but both should preserve enough evidence for another person to understand what was actually established.
Documentation and further study
Related engineering guides: Reproducible inference stacks: preserving a GPU pilot’s result; Choose a local AI stack: desktop chat, shared UI or coding agent.
Earn rental income from GPUs
Have idle GPUs or looking to fund AI infrastructure? Retrivium finds a rental platform, sets up the server and helps you assess income and costs with a pilot.