Skip to content

fix(cloud-agent): propagate taskRunId through codex loadSession#1720

Open
tatoalo wants to merge 1 commit intofix/codex-prcontext-injectionfrom
fix/codex-loadsession-task-run
Open

fix(cloud-agent): propagate taskRunId through codex loadSession#1720
tatoalo wants to merge 1 commit intofix/codex-prcontext-injectionfrom
fix/codex-loadsession-task-run

Conversation

@tatoalo
Copy link
Copy Markdown
Contributor

@tatoalo tatoalo commented Apr 17, 2026

Problem

newSession and unstable_resumeSession both carry _meta.taskRunId / taskId into sessionState and emit _posthog/sdk_session on cloud runs. loadSession dropped them on the floor. Re-attaching a desktop client to an existing cloud codex session therefore silenced TURN_COMPLETE and USAGE_UPDATE on subsequent prompts (both gated on sessionState.taskRunId), and the adapter→session mapping was never published.

Changes

In CodexAcpAgent.loadSession, propagate taskRunId / taskId into sessionState and fire _posthog/sdk_session when taskRunId is present, matching the other session-creation paths.

How did you test this?

  • Two new unit tests: taskRunId is propagated and SDK_SESSION fires when present; no extNotification is emitted when taskRunId is absent.
  • Full @posthog/agent suite green.

Copy link
Copy Markdown
Contributor Author

tatoalo commented Apr 17, 2026

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@tatoalo tatoalo force-pushed the fix/codex-loadsession-task-run branch from 463eb7f to bfbea4d Compare April 17, 2026 16:59
@tatoalo tatoalo marked this pull request as ready for review April 17, 2026 17:07
@tatoalo tatoalo requested a review from a team April 17, 2026 17:07
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