Run long tasks in Codex using goals
By OpenAI
Key Concepts
- Goal Mode: A persistent operational state in Cortex that allows the AI to work autonomously toward a defined objective over extended periods.
- Steering: The ability to provide real-time feedback or course corrections to the AI while it is actively working on a goal.
- Side Chats: A feature allowing users to query the AI about its progress without disrupting the primary task execution.
- Persistence: The capability of the system to run tasks for hours or days, including the ability to pause and resume operations.
1. Introduction to Goal-Oriented Persistence
Cortex has introduced a new "Goal" functionality, enabling the AI to work persistently on complex tasks for extended durations, ranging from hours to several days. This feature is integrated across the Cortex app, IDE extension, and CLI, allowing for seamless workflow automation.
2. Implementing Goal Mode
To initiate this feature, users must use the /goal command within the message composer.
- Defining the Goal: The input serves two purposes: it acts as the initial instruction set and provides the criteria for the AI to determine when the task is successfully completed.
- Best Practices: The system performs best when goals are concrete and measurable. Users are encouraged to define clear test criteria or specific targets that allow the AI to verify its own success.
- Assistance in Goal Setting: If a user is unsure how to frame a goal, they can:
- Use Plan Mode first to outline the steps, then convert that plan into an implementation goal.
- Request that Cortex interview them to gather necessary details before the AI drafts and sets the goal itself.
3. Managing Long-Running Tasks
Because tasks can span significant timeframes (upwards of 100 hours in some observed cases), Cortex includes management tools to maintain control:
- Steering: Users can send additional messages while the task is running to correct the AI's course or provide updated instructions.
- Side Chats: This allows users to inspect the work-in-progress or ask questions about the AI's current state without interrupting the main execution thread.
- Pause and Resume: This is a critical feature for scenarios where connectivity is lost or the user needs to step away. Users can pause the goal and resume it later, with the added flexibility to edit the goal if requirements have shifted during the downtime.
4. Performance and Real-World Application
The system is designed for high-complexity tasks that require sustained effort. The developers note that they have observed users successfully utilizing this feature to have Cortex make progress on intricate projects for over 100 hours on a single goal. This demonstrates the tool's capability to handle long-term, multi-step development or research processes autonomously.
Synthesis
The new Goal functionality transforms Cortex from a reactive assistant into a persistent agent capable of autonomous, long-term task execution. By combining clear goal definition with real-time steering and the ability to pause/resume, Cortex allows developers to offload complex, time-consuming tasks to the AI. The key to success lies in providing well-defined, measurable objectives, ensuring the AI has a clear "definition of done" to guide its multi-day operations.
Chat with this Video
AI-PoweredLoad the transcript when you're ready to chat so the initial page stays lighter.