Draft
Conversation
Allow a task to have multiple workspaces, one per repository. This enables cross-repo work (e.g., posthog + posthog-js + posthog.com) in a single conversation. Changes: - DB migration: drop UNIQUE on workspaces.taskId, add label column, add index - WorkspaceRepository: add findAllByTaskId for multi-workspace queries - WorkspaceService: createWorkspace accepts additionalRepos, returns array - Workspace schemas: add label field, RepoWorkspaceConfig, array outputs - Task type: add repositories[] alongside deprecated repository field - Sidebar: add additionalRepositories to TaskData for multi-repo badge - useWorkspace hook: backward-compatible single-workspace access + new useTaskWorkspaces/useAllWorkspaces for multi-repo consumers - Archive/suspension services: handle multi-workspace per task - Fix downstream consumers (code editor, DraggableTab) for array workspace API Generated-By: PostHog Code Task-Id: 230ec8e6-6781-43b4-ae30-ea24faa410dc
Pass additional repository paths from multi-repo workspaces through to the agent session: - ConnectParams: add additionalRepoPaths field - SessionService.createNewLocalSession: forward additionalDirectories to agent.start mutation - TaskCreationSaga: resolve additional workspace paths from workspace.getInfo and pass them as additionalRepoPaths - workspaceEnv: add buildMultiRepoWorkspaceEnv with indexed per-repo env vars (POSTHOG_CODE_REPO_0_NAME, POSTHOG_CODE_REPO_0_PATH, etc.) Generated-By: PostHog Code Task-Id: 230ec8e6-6781-43b4-ae30-ea24faa410dc
- TaskInput: "Add repository" button appears when a primary repo is selected. Each additional repo gets its own folder picker, mode selector, and branch selector. Repos can be removed individually. - AdditionalRepoRow: new component for per-repo configuration rows - TaskItem: renders "+N" badge with tooltip listing additional repos when a task has multiple repositories - useTaskCreation: passes additionalRepos through to TaskCreationSaga - TaskCreationSaga: resolves folders for additional repos and passes them as additionalRepos to workspace.create mutation Generated-By: PostHog Code Task-Id: 230ec8e6-6781-43b4-ae30-ea24faa410dc
Wire the client to send the new `repositories` array format when creating multi-repo tasks. Single-repo tasks still use the legacy `repository` string for backward compat. - posthogClient.createTask: accepts `repositories` field - TaskCreationSaga.createTask: detects additional repos, sends repositories array when multiple repos are present - duplicateTask: preserves repositories array Generated-By: PostHog Code Task-Id: 230ec8e6-6781-43b4-ae30-ea24faa410dc
73db754 to
1f13450
Compare
- Derive additional repos from local workspace data for sidebar badge (works even before API returns repositories array) - Keep multi-repo badge visible on hover instead of hiding it - Search files across all workspace repos in @ file picker - Tighten spacing between repo rows and add-repo button - Skip invite code check for dev region Generated-By: PostHog Code Task-Id: 230ec8e6-6781-43b4-ae30-ea24faa410dc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
At PostHog we work across multiple repos (posthog, posthog.com, posthog-js, posthog-python) that often depend on each other. Currently, tasks only support a single repository, making cross-repo work cumbersome.
Changes
Data model (Stage 1):
Session & agent integration (Stage 2):
additionalDirectoriesTask creation UI (Stage 3):
Sidebar badge (Stage 4):
+Nbadge on sidebar task items for multi-repo tasks with tooltip listing additional reposrepositoriesarray yetFile picker (Stage 5):
@file mention picker searches across all workspace repos, not just the primaryAPI integration (Stage 6):
repositoriesarray to PostHog API for multi-repo tasks (requires feat(tasks): add multi-repo support to Task model posthog#53302)Dev experience:
How did you test this?
@file picker shows files from both reposCreated with PostHog Code