Skip to content

feat: update codex adapter and migrate to base acp prxy for agent#1480

Open
k11kirky wants to merge 1 commit into04-03-feat_codex_5.4_default_and_pass_to_modelfrom
04-03-feat_update_codex_adapter_and_migrate_to_base_acp_prxy_for_agent
Open

feat: update codex adapter and migrate to base acp prxy for agent#1480
k11kirky wants to merge 1 commit into04-03-feat_codex_5.4_default_and_pass_to_modelfrom
04-03-feat_update_codex_adapter_and_migrate_to_base_acp_prxy_for_agent

Conversation

@k11kirky
Copy link
Copy Markdown
Contributor

@k11kirky k11kirky commented Apr 3, 2026

TLDR: upgraded codex acp bin and started moving over to similar proxy agent as claude agent sdk

Problem

The Codex adapter was using a raw stream transformation approach that made it difficult to implement PostHog-specific features like session tracking, usage accumulation, and proper session resume/fork capabilities. This approach also lacked proper interception points for ACP protocol messages.

Changes

Upgraded codex-acp binary from v0.9.5 to v0.11.1 to get the latest features and bug fixes.

Replaced raw stream transformation with proper ACP Agent implementation:

  • Created CodexAcpAgent class that implements the ACP Agent interface
  • Added CodexClient to handle delegation between codex-acp subprocess and upstream PostHog Code client
  • Implemented proper session state tracking with CodexSessionState and CodexSettingsManager
  • Added support for session resume/fork operations (not natively supported by codex-acp)

Enhanced PostHog integration:

  • Proper _posthog/sdk_session notification emission for session tracking
  • Usage accumulation and _posthog/usage_update notifications
  • Session metadata handling for task runs and persistence

Improved architecture:

  • Moved from direct stream manipulation to proper ACP protocol handling
  • Added consistent settings management interface shared with Claude adapter
  • Better error handling and cleanup for subprocess management
  • Proper terminal handle delegation for codex-acp terminal operations

Copy link
Copy Markdown
Contributor Author

k11kirky commented Apr 3, 2026

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants