Feature Request: Long Task Mode
What feature would you like to see?
Long Task Mode Proposal for Codex Cli
Problem Statement
Current codex cli workflow faces interruptions when AI agents encounter operations that require user confirmation, particularly during extended periods of automated coding sessions. This disrupts workflow continuity when users are temporarily unavailable (e.g., meals, breaks, overnight sessions).
While the auto-accept edits feature helps with common operations, it cannot anticipate all operations required by new plans. Even with extensive auto-accept configurations, unexpected operations in each new plan can still cause interruptions, preventing true long-term autonomous execution.
Proposed Solution: Long Task Mode
Long Task Mode enables uninterrupted AI agent execution through dynamic operation whitelists and deferred question handling. This addresses the limitations of current auto-accept features by providing a comprehensive framework for long-term autonomous AI agent execution. AI agents analyze plans and project contexts to predict required operations, allowing users to pre-approve safe operations while maintaining control over high-risk actions.
Key Features
- Dynamic Operation Whitelist
- AI agent analyzes plan and project context to predict required operations
- Users review and modify proposed operation categories before execution
- Operations categorized by risk level (Safe/Moderate/High-risk)
- Visual interface with safety warnings for high-risk operations
- Interrupt Avoidance & Question Batching
- AI agents avoid operations outside the approved whitelist
- Non-critical questions accumulated for consolidated review
- Graceful degradation when user input is unavoidable
- Consolidated question report presented upon completion
- Extended Autonomous Execution
- Uninterrupted coding sessions during user absence
- Support for overnight and extended coding capabilities
- Comprehensive operation tracking and safety controls
Implementation Workflow
User Request → Plan Mode → Long Task Mode Activation → AI Agent Analyzes Plan & Context
↓
Dynamic Whitelist Generation → Whitelist Review → Confirmation
↓
AI Agent Execution (within whitelist) → Question Accumulation → Task Completion
↓
Batched Question Review → User Response → Final Adjustments
Operation Categories
Note: The specific whitelist should be dynamically generated by the AI agent based on plan analysis and project context.
- Safe Operations: File searches, code reading, testing, formatting
- Moderate Operations: Git status/diff, file creation/editing, dependency management
- High-risk Operations: Git commits, file deletion, system commands (always require approval)
Safety & User Experience
- Safety Controls: Time limits, user interruption capability, operation tracking, loop detection
- User Interface: Interactive whitelist review, progress monitoring, completion reports
Loop detection prevents infinite loops by monitoring operation patterns and resource consumption, automatically pausing execution when repetitive or resource-intensive patterns are detected.
Example Scenarios
Long Task Mode enables users to maximize productivity during periods of unavailability:
- Meal Times: Start a complex refactoring task before lunch, return to find it completed
- Evening Sessions: Begin implementing a new feature before dinner, review progress after
- Overnight Work: Launch extensive testing or documentation generation before sleep
- Extended Absences: Initiate multi-hour code analysis or migration tasks before leaving
In each scenario, the AI agent works autonomously within approved boundaries, accumulating non-critical questions for consolidated review upon user return.
Benefits
- Extended Productivity: Uninterrupted coding sessions during user absence
- Better Resource Utilization: Overnight and extended coding capabilities
- Reduced Interruptions: Consolidated question handling and operation whitelisting
- Enhanced Safety: Controlled permissions with user oversight
---
Are you interested in implementing this feature?
_No response_
Additional information
_No response_
3 Comments
I also mentioned this feature in other CLI tools.
https://github.com/anthropics/claude-code/issues/8271
https://github.com/google-gemini/gemini-cli/issues/10078
Thanks for the feature request. It hasn't received any upvotes in over two months, so I'm going to close it. There are some related feature requests that are simpler in concept and have some upvotes.
This request still feels valid as of
codex-cli 0.114.0.The current open bug reports around premature stopping and compaction continuity make the underlying product need more obvious, not less: long-run users need an explicit opt-in mode that keeps executing until blocked or complete, rather than falling back to "continue?" style handoffs even when they intentionally picked permissive execution settings.
In practice I would want this mode to mean: