Skip to main content
The debug command provides debugging utilities for troubleshooting Codex internals, primarily focused on app server communication.

Usage

Subcommands

app-server

Debug app server communication and protocol issues:

send-message-v2

Send a test message to a running app server (V2 protocol):
This is useful for testing app server integrations and debugging JSON-RPC communication.

Examples

Test App Server Connection

Start an app server in one terminal:
In another terminal, send a test message:

Debug Protocol Issues

When debugging IDE integration issues, you can manually send messages to verify the app server is responding correctly.

Use Cases

IDE Integration Development

When building IDE extensions that communicate with the Codex app server:
  1. Start the app server with debug logging
  2. Use debug commands to send test messages
  3. Verify responses match expected schema

Protocol Debugging

Test JSON-RPC message handling:

CI Testing

Verify app server functionality in automated tests:

Internal Use

These commands are primarily intended for internal development and debugging. Regular users typically don’t need these tools.
The debug commands access internal APIs that may change between versions.

codex app-server

Start the app server

App Server API

App server API documentation

Troubleshooting

App Server Not Responding

If the app server doesn’t respond to debug commands:
  1. Verify the app server is running
  2. Check that stdio transport is being used
  3. Review app server logs for errors

Protocol Errors

If you see JSON-RPC protocol errors:
  1. Ensure you’re using the correct protocol version (V2)
  2. Verify message format matches the schema
  3. Check for missing required fields
For more debugging help, see the Tracing guide.