Debug issues in Copex, especially streaming, content display, and event handling bugs. Use this when investigating bugs, unexpected behavior, or errors.
Installation
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Debug issues in Copex, especially streaming, content display, and event handling bugs. Use this when investigating bugs, unexpected behavior, or errors.
Debugging Guide for Copex
Common Issues
Stale/Wrong Content Displayed
Symptoms: Response shows previous turn's content, or old message appears instead of new one.
Root Cause: History fallback triggered during streaming mode.
Investigation:
Check if streaming (on_chunk provided)
Verify received_content flag is set when content arrives
Check if history fallback is being used incorrectly
Fix Pattern:
# In client.py - only use history when NOT streamingifnot received_content and on_chunk isNone:
# History fallback OK here
messages = await session.get_messages()
In CLI - prefer streamed content:
final_message = ui.state.message if ui.state.message else response.content
Empty or Missing Content
Symptoms: Response is empty, reasoning missing, or incomplete.