Add comprehensive Codex CLI usage tips for community#10
Conversation
Document practical tips and lessons learned from integrating Codex CLI: - App Server mode architecture and JSON-RPC protocol - Per-agent instance pattern for multi-agent apps - Session management with thread persistence - MCP server configuration at startup - Configuration tips (disable skills, isolate cwd) - Error handling and session recovery patterns - Performance optimization (pooling, LRU eviction) - Platform-specific notes (Windows, macOS) - Troubleshooting guide and quick reference
PR Review: Codex CLI Usage Tips DocumentationOverall Assessment ✅This is an excellent addition to the documentation! The guide is comprehensive, well-structured, and provides valuable practical insights for developers integrating Codex CLI into production applications. The content is technically accurate based on the codebase implementation. Strengths📚 Comprehensive Coverage
🎯 Well-Organized Structure
🔍 Technical AccuracyVerified against implementation in
💡 Practical Value
Suggestions for Improvement1. Minor Inconsistencies with Existing DocsThe new document uses slightly different terminology than CODEX_CLI_TIPS.md:
codex_app.md:
Suggestion: Align model references or clarify that these are examples. Consider adding: ```python
# Use environment variable for model
model = os.getenv("CODEX_MODEL", "gpt-5.2")3. Section Ordering OptimizationConsider moving "Configuration Tips" earlier (before "Error Handling") since developers need those settings during initial setup: Current: Getting Started → Architecture → App Server → Session → MCP → Config → Error Handling 4. Add Version Compatibility NoteSince Codex CLI is evolving, add a version note at the top: > **Note:** This guide is based on Codex CLI version X.X.X (tested January 2026).
> Some features may vary in different versions.5. Cross-Reference OpportunitiesAdd links to related documentation: ## Related Documentation
- [App Server Integration](./codex_app.md) - Internal architecture details
- [Setup Guide](./SETUP.md) - Initial project setup
- [How It Works](./how_it_works.md) - Third-person perspective design6. Table Formatting EnhancementSome tables could benefit from center alignment for better readability: | Method | Purpose |
|:------:|:--------|
| `thread/start` | Create new conversation thread |
| `thread/resume` | Resume existing thread |Minor IssuesTypos/Grammar
Code Examples
Links
Security Considerations✅ No security concerns identified The document appropriately:
Test CoverageN/A - This is documentation only (no code changes) Performance Considerations✅ Performance guidance is strong:
Suggestion: Add guidance on monitoring: ### Monitoring Pool Performance
```python
# Log pool stats periodically
async def log_pool_stats():
pool = await CodexAppServerPool.get_instance()
stats = {
"active_instances": len(pool._instances),
"total_threads": sum(len(i._threads) for i in pool._instances.values()),
"memory_usage_mb": get_process_memory() / 1024 / 1024,
}
logger.info(f"Pool stats: {stats}") |
Document practical tips and lessons learned from integrating Codex CLI: