Skip to content

feat(cloud): Add plan mode support for cloud runs#1645

Merged
VojtechBartos merged 1 commit intomainfrom
vojtab/cloud-plan-mode
Apr 15, 2026
Merged

feat(cloud): Add plan mode support for cloud runs#1645
VojtechBartos merged 1 commit intomainfrom
vojtab/cloud-plan-mode

Conversation

@VojtechBartos
Copy link
Copy Markdown
Member

@VojtechBartos VojtechBartos commented Apr 14, 2026

Problem

Plan mode doesn't work in cloud runs. The cloud agent auto-approves all permission requests, so when an agent calls ExitPlanMode, the plan is instantly approved without any human review. The agent skips planning and jumps straight to making changes. There's also no way to switch modes (plan/default/accept edits/bypass) from the desktop app when watching a cloud run.

Prerequisite

PostHog/posthog#54466

Solution

  • Permission relay: When a desktop app is connected to a cloud run, permission requests (plan approvals, edit/bash approvals) are relayed to the desktop via SSE instead of being auto-approved. The user reviews and approves/rejects from the same UI as local sessions.
  • Plan mode enforcement: Cloud runs now route permission checks through the same handler as local sessions, so plan mode restrictions (denying write/bash tools until the agent writes a plan and calls ExitPlanMode) are enforced in cloud too.
  • Initial mode passthrough: The permission mode selected in the desktop app (e.g., "plan") is passed through the API to the cloud sandbox so the agent starts in the correct mode.
  • Cloud mode switcher: Cloud sessions now show the mode selector in the chat UI, allowing users to cycle between modes (shift+tab) including bypass permissions (always available for cloud since it runs in an
    isolated sandbox).
  • Background/web-app safety: Cloud runs without initial_permission_mode default to bypassPermissions so tasks started from the web app or Slack continue to auto-approve without blocking.

Showcase

code-plan-mode.mov

@VojtechBartos VojtechBartos self-assigned this Apr 14, 2026
@VojtechBartos VojtechBartos force-pushed the vojtab/cloud-plan-mode branch 4 times, most recently from b202f75 to 020190d Compare April 14, 2026 20:33
@VojtechBartos VojtechBartos requested a review from a team April 14, 2026 20:35
@VojtechBartos VojtechBartos marked this pull request as ready for review April 14, 2026 20:35
@VojtechBartos VojtechBartos force-pushed the vojtab/cloud-plan-mode branch 2 times, most recently from fab1c2e to 51db70d Compare April 14, 2026 20:38
@VojtechBartos VojtechBartos force-pushed the vojtab/cloud-plan-mode branch from 51db70d to 6b13483 Compare April 15, 2026 13:11
@VojtechBartos VojtechBartos enabled auto-merge (squash) April 15, 2026 13:13
@VojtechBartos VojtechBartos merged commit 9d652c5 into main Apr 15, 2026
15 checks passed
@VojtechBartos VojtechBartos deleted the vojtab/cloud-plan-mode branch April 15, 2026 13:20
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