Overview
Use a Codex scheduled task in the ChatGPT desktop app to refresh a repository's AGENTS.md and tracker file and run its API tests on a cadence, with changes kept in a worktree for you to review.
Problem or Objective
- Which agents write or run tests against an application?
- Which agents run multi-step workflows across your apps?
More in Coding and Code Review
AI Agents and Models
Tools and Integrations
- Tools
- Codex · ChatGPT desktop app
- Prerequisites
- The ChatGPT desktop app with Codex, a local Git repository with an API test suite, and a computer left on with the app running. Check that scheduled tasks are available on your plan and workspace; Codex usage limits vary by plan.
How It Works
Open the repository as a project in the ChatGPT desktop app with Codex. If it has no AGENTS.md yet, run /init to generate a scaffold and edit it. Add a plain tracker file, such as docs/status.md, listing open work. Create a scheduled task for the project, choose to run it on a new worktree so it stays apart from your unfinished work, and set a weekly or nightly cadence. In the prompt, ask Codex to bring AGENTS.md up to date with the current build and test commands and folder layout, update the tracker from commits since the last run, run the API test suite, and report failures with the failing request and output. Tell it not to commit, push or open pull requests. Keep the default sandbox and grant network access only if the API tests need it. Read each run in Scheduled, look at the diff in the worktree and commit what you accept yourself.
Implementation Workflow
Steps assembled from the agents, tools and prompt of this entry. Adapt them to your own setup.
- Choose the agentSet up Codex CLI.
- Connect the toolsConnect the tools this workflow relies on: Codex, ChatGPT desktop app.
- Check the prerequisitesThe ChatGPT desktop app with Codex, a local Git repository with an API test suite, and a computer left on with the app running. Check that scheduled tasks are available on your plan and workspace; Codex usage limits vary by plan.
- Gather your detailsCollect what the prompt asks for: Tracker file in the repository, Command that runs the API tests, Address of a test server, not production.
- Run the starter promptPaste the starter prompt below into Codex CLI and adapt it to your case.
- Check against the documentationCompare what you get with the documentation at developers.openai.com before you rely on it.
Practical Starter Prompt: Refresh project docs and run API checks
Fill the fields to adapt the prompt. Empty fields stay as visible [placeholders].
In this project, update AGENTS.md so its build and test commands and folder layout match the current code. Update [Tracker file in the repository] from the commits since the last run, marking finished items and adding new open ones. Then run [Command that runs the API tests] against [Address of a test server, not production] and report each failure with the request, the expected result and the actual output. Do not commit, push or open a pull request; leave every change in the worktree and summarise it for my review.Run it on a new worktree, read each run in Scheduled, review the diff and commit what you accept yourself.
Expected Results and Benefits
This is a suggested workflow, not a reported result. The points below are what the cited documentation says the tools can do.
This is a suggested workflow, not a reported outcome. OpenAI's scheduled tasks page says that in the ChatGPT desktop app scheduled tasks can work with local projects and run in the project directory or an isolated worktree, run unattended with your default sandbox settings, and report runs with findings in Scheduled; it gives reports about recent codebase changes as an example. The help page documents /init for an AGENTS.md scaffold. No page measures how accurate the refreshed files or test reports are, so each run is reviewed before anything is committed.
Limitations and Considerations
For project-scoped scheduled tasks, the page says to keep the machine powered on and the ChatGPT desktop app running. Scheduled tasks run unattended with your default sandbox settings, so start with the narrowest access and add network access only for the API tests; point them at a test server, not production. Frequent schedules on worktrees can leave many worktrees behind, so archive runs you no longer need. Check that scheduled tasks are available on your plan and workspace, and that each run fits your Codex usage limits. Nothing is committed until you review the diff. Results depend on your setup and were not independently reproduced by Top 200 Repos.
GitHub Repositories
AI Agent Repository
Source code of the agent that does the work.
Related Videos
About openai/codex
Meet the New Codex CLI (opens in a new tab)
Published by the project’s official channel.
Watch on YouTube (opens in a new tab)Independent creators. Listing a video implies no endorsement, sponsorship or partnership.
Sources
- Scheduled tasks | ChatGPT Learn (opens in a new tab)
Project documentation · developers.openai.com · Undated · Source checked 27 Nov 2026, 09:45 UTC
What this source supports
- In the ChatGPT desktop app, scheduled tasks can work with local projects and run in the project directory or an isolated worktree.
- For example, schedule a task to evaluate telemetry errors and submit fixes, or to create reports about recent codebase changes.
- Scheduled tasks run unattended with your default sandbox settings.
- The Scheduled view acts as your inbox.
- Using Codex with your ChatGPT plan | OpenAI Help Center (opens in a new tab)
Project documentation · help.openai.com · Undated · Source checked 26 Nov 2026, 17:27 UTC
What this source supports
- Use /init in the ChatGPT desktop app while using Codex to generate an AGENTS.md scaffold for the current project.
