Skip to content

feat(codex): hand off plans to implementation#3341

Merged
tatoalo merged 1 commit into
mainfrom
posthog-code/feat-codex-plan-mode-handoff
Jul 10, 2026
Merged

feat(codex): hand off plans to implementation#3341
tatoalo merged 1 commit into
mainfrom
posthog-code/feat-codex-plan-mode-handoff

Conversation

@tatoalo

@tatoalo tatoalo commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Problem

Codex Plan mode can stream its proposal outside regular assistant-message deltas, so users could see no plan and never receive the prompt to begin implementation. Cloud runs also downgraded Codex Plan to Read only because the backend contract did not yet accept the native mode.

Stacked on #3340. The cloud API contract is added by PostHog/posthog#69947.

Changes

  • Stream Codex plan deltas as agent prose and replay persisted plan items on reload.
  • Capture both streamed and completed plan proposals.
  • Offer the existing mode-switch approval when a Plan turn completes.
  • Switch to Auto or Full access after approval and immediately run the implementation turn in the same prompt.
  • Loop rejected plans back through feedback, validate offered choices, and handle cancellation safely.
  • Defer the cloud idle signal until the handoff or implementation turn is actually complete.
  • Preserve native Codex Plan mode when creating cloud runs.

@github-actions

github-actions Bot commented Jul 10, 2026

Copy link
Copy Markdown

React Doctor found no issues in the changed files. 🎉

Reviewed by React Doctor for commit f661c53.

@tatoalo tatoalo added the Stamphog This will request an autostamp by stamphog on small changes label Jul 10, 2026
@tatoalo tatoalo marked this pull request as ready for review July 10, 2026 11:25

@stamphog stamphog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Zero reviews on a T1d-complex PR with a behavioral API contract change: plan mode is now passed through to the cloud API as initial_permission_mode: "plan" for Codex task runs instead of being degraded to read-only. The generated.ts edit adds "plan" to the server enum, but it's unclear whether the backend has deployed support for this value. If not, cloud plan-mode task creation will fail with a server validation error.

@stamphog stamphog Bot removed the Stamphog This will request an autostamp by stamphog on small changes label Jul 10, 2026
@greptile-apps

greptile-apps Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Security Review

A pending plan approval can override a newer restrictive mode selection and start the implementation turn with broader permissions.

Reviews (1): Last reviewed commit: "fix(tasks): preserve Codex plan mode in ..." | Re-trigger Greptile

@tatoalo tatoalo force-pushed the posthog-code/fix-codex-auto-mode-approvals branch from 8de4f0d to 94954c3 Compare July 10, 2026 11:28
@tatoalo tatoalo force-pushed the posthog-code/fix-codex-auto-mode-approvals branch from 94954c3 to 2bc836d Compare July 10, 2026 11:37
@tatoalo tatoalo force-pushed the posthog-code/feat-codex-plan-mode-handoff branch from a6444d6 to cbcb0b5 Compare July 10, 2026 11:39
Base automatically changed from posthog-code/fix-codex-auto-mode-approvals to main July 10, 2026 12:41
@trunk-io

trunk-io Bot commented Jul 10, 2026

Copy link
Copy Markdown

Merging to main in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here

@tatoalo tatoalo added the Create Release This will trigger a new release label Jul 10, 2026
@tatoalo tatoalo force-pushed the posthog-code/feat-codex-plan-mode-handoff branch from cbcb0b5 to f661c53 Compare July 10, 2026 12:42
@tatoalo tatoalo merged commit 0ce2dca into main Jul 10, 2026
26 checks passed
@tatoalo tatoalo deleted the posthog-code/feat-codex-plan-mode-handoff branch July 10, 2026 13:17
@github-actions

Copy link
Copy Markdown

Could not verify team-posthog-code membership (GitHub API error). Auto-release is limited to Team PostHog Code members, so this will ship with the next scheduled release instead.

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

Labels

Create Release This will trigger a new release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants