Skip to content

Commit de21189

Browse files
authored
feat: update codex adapter and migrate to base acp prxy for agent (#1480)
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
1 parent 354a624 commit de21189

File tree

7 files changed

+765
-337
lines changed

7 files changed

+765
-337
lines changed

apps/code/scripts/download-binaries.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const DEST_DIR = join(__dirname, "..", "resources", "codex-acp");
1919
const BINARIES = [
2020
{
2121
name: "codex-acp",
22-
version: "0.9.5",
22+
version: "0.11.1",
2323
getUrl: (version, target) => {
2424
const ext = target.includes("windows") ? "zip" : "tar.gz";
2525
return `https://github.com/zed-industries/codex-acp/releases/download/v${version}/codex-acp-${version}-${target}.${ext}`;

0 commit comments

Comments
 (0)