Skip to content

feat(code): execute inline !bash commands in cloud sandbox#1707

Open
VojtechBartos wants to merge 1 commit intomainfrom
posthog-code/sandboxed-bash
Open

feat(code): execute inline !bash commands in cloud sandbox#1707
VojtechBartos wants to merge 1 commit intomainfrom
posthog-code/sandboxed-bash

Conversation

@VojtechBartos
Copy link
Copy Markdown
Member

Problem

Inline !command bash was disabled for cloud runs — the handler used the local Shell service (node-pty) which can't reach the sandbox container.

Solution

Added a shell_execute JSON-RPC method on the agent-server that spawns bash -c <command> inside the sandbox and streams stdout/stderr as SSE notifications. Renderer pre-generates an executionId, sends the command via CloudTaskService.sendCommand, and resolves when shell_exit arrives. Requires a paired backend PR to allowlist the new method.

Prerequisites

PostHog/posthog#55064

Showcase

code-bash-cloud.mov

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