You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bug report: desktop - setup script doesn't run until the Setup tab is clicked #115533
In PostHog Desktop, an environment's setup script does not start when a new worktree task is created. The task shows a Setup: <environment name> tab with a loading spinner, but the script only begins running once that tab is clicked. The environment settings say the script "Runs in the worktree root right after it's created, before the agent starts." The agent also starts without waiting for the setup script to finish.
How to reproduce
In PostHog Desktop, go to Settings > Environment and create an environment named default for a local repository, with the setup script date > setup-ran.txt.
Create a new local task in a worktree, pick the default environment in the worktree picker, and approve the setup script prompt.
Stay on the task's chat. The "Setup: default" tab shows a spinner, setup-ran.txt does not appear in the worktree, and the agent starts working.
Click the "Setup: default" tab. The script starts running and setup-ran.txt appears.
Additional context
From support ticket 69215
Reported on desktop-v0.61.22 (macOS). The setup dispatch code is unchanged on master as of desktop-v0.61.671. It starts at dispatchEnvironmentSetup in taskCreationSaga.ts.
Activity
posthog commentedon Oct 12, 2026
PostHog self-driving picked up this issue and researched it. Somebody may already be working on it, so ask before you start a fix.
Report (team access only): https://us.posthog.com/project/2/inbox/reports/01a130af-9a1c-7469-bcac-4d469a77333a?link_source=github_comment