Skip to content

feat: Harden CodexAcpAgent session state and permission handling#1487

Merged
k11kirky merged 1 commit intomainfrom
04-03-harden_codexacpagent_session_state_and_permission_handling
Apr 6, 2026
Merged

feat: Harden CodexAcpAgent session state and permission handling#1487
k11kirky merged 1 commit intomainfrom
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
@charlesvien charlesvien marked this pull request as ready for review April 3, 2026 15:51
@k11kirky k11kirky force-pushed the 04-03-feat_give_codex_permissions_support branch from be8d325 to 2009734 Compare April 6, 2026 16:23
@k11kirky k11kirky force-pushed the 04-03-harden_codexacpagent_session_state_and_permission_handling branch from 4834774 to ee54c05 Compare April 6, 2026 21:16
@k11kirky k11kirky force-pushed the 04-03-feat_give_codex_permissions_support branch from 2009734 to 7669044 Compare April 6, 2026 21:16
Copy link
Copy Markdown
Contributor

k11kirky commented Apr 6, 2026

Merge activity

  • Apr 6, 9:47 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Apr 6, 10:24 PM UTC: Graphite rebased this pull request as part of a merge.
  • Apr 6, 10:33 PM UTC: @k11kirky merged this pull request with Graphite.

@k11kirky k11kirky changed the base branch from 04-03-feat_give_codex_permissions_support to graphite-base/1487 April 6, 2026 22:15
@k11kirky k11kirky changed the base branch from graphite-base/1487 to main April 6, 2026 22:23
@k11kirky k11kirky force-pushed the 04-03-harden_codexacpagent_session_state_and_permission_handling branch from ee54c05 to 6764330 Compare April 6, 2026 22:24
@k11kirky k11kirky merged commit a56b832 into main Apr 6, 2026
16 checks passed
@k11kirky k11kirky deleted the 04-03-harden_codexacpagent_session_state_and_permission_handling branch April 6, 2026 22:33
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