Skip to content

feat: Harden CodexAcpAgent session state and permission handling#1487

Open
charlesvien wants to merge 1 commit into04-03-feat_give_codex_permissions_supportfrom
04-03-harden_codexacpagent_session_state_and_permission_handling
Open

feat: Harden CodexAcpAgent session state and permission handling#1487
charlesvien wants to merge 1 commit into04-03-feat_give_codex_permissions_supportfrom
04-03-harden_codexacpagent_session_state_and_permission_handling

Conversation

@charlesvien
Copy link
Copy Markdown
Member

@charlesvien charlesvien commented Apr 3, 2026

Changes

  1. Initialize sessionState and codexConnection eagerly in the constructor instead of using ! assertions
  2. Pass permissionMode, taskRunId and taskId from meta into createSessionState for all session creation paths (load, new, fork)
  3. Fix double-counting of token usage by relying on sessionUpdate notifications instead of also adding response.usage
  4. Remove redundant cancel() override, use inherited interrupt() and base class cancellation state
  5. Use POSTHOG_NOTIFICATIONS.USAGE_UPDATE constant instead of hardcoded string
  6. Escape newlines in system instructions passed to codex CLI args
  7. Abort the session's AbortController on closeSession for proper async cleanup

How did you test this?

Manually

@charlesvien charlesvien changed the title Harden CodexAcpAgent session state and permission handling feat: Harden CodexAcpAgent session state and permission handling Apr 3, 2026
Copy link
Copy Markdown
Member Author

@charlesvien charlesvien marked this pull request as ready for review April 3, 2026 15:51
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.

1 participant