Skip to content

fix(code): scope task suggestions to the selected repo#2259

Closed
posthog[bot] wants to merge 1 commit into
mainfrom
posthog-code/scope-suggestions-to-selected-repo
Closed

fix(code): scope task suggestions to the selected repo#2259
posthog[bot] wants to merge 1 commit into
mainfrom
posthog-code/scope-suggestions-to-selected-repo

Conversation

@posthog
Copy link
Copy Markdown
Contributor

@posthog posthog Bot commented May 20, 2026

Problem

Initial task suggestions from the enricher run and the discovery agent run were stored globally and displayed on the new task page regardless of which repo was selected. When a user switched the repo selector on the new-task input, they kept seeing suggestions that were generated against a different codebase — not actionable in the current context.

Changes

  • Added repoPath: string to DiscoveredTask so every suggestion records the repo it was generated against.
  • Stamped repoPath on each suggestion at creation time in SetupRunService:
    • PostHog SDK-health, "not installed", and "finish init" enricher suggestions.
    • Stale-feature-flag enricher suggestions (id is now namespaced by repo + flag key so the same flag in two repos doesn't collide).
    • Agent-discovered tasks at completeDiscovery time.
  • Track discoveryRepoPath / enricherRepoPath in useSetupStore, and scope startDiscovery / completeDiscovery / resetDiscovery so they only touch agent suggestions for the matching repo (other repos' agent suggestions and all enricher suggestions survive).
  • SuggestedTasksPanel accepts a repoPath prop and filters discoveredTasks to that repo. The "running" indicators only render when the in-flight scan targets the current repo. In cloud workspace mode repoPath={null}, so no suggestions render (suggestions are always generated against a local path).
  • TaskInput passes the local selectedDirectory (or null in cloud mode) into the panel.

How did you test this?

  • pnpm --filter code typecheck — clean.
  • pnpm --filter code test — 1345 pass; the 3 failures are pre-existing 5s timeouts in archive/service.integration.test.ts worktree tests in this sandbox, unrelated to these changes.
  • pnpm lint — clean (biome reformatted one line).
  • Did not run the desktop app in this environment; cannot manually verify the UI.

Publish to changelog?

no


Created with PostHog Code

…inst

Suggestions from the enricher and discovery agent runs were displayed on the
new task page regardless of which repo was selected. Tag each suggestion with
the repo path it was generated against and filter the new-task-page panel to
the currently-selected repo, so users only see suggestions relevant to the
repo they're about to create a task in.

Generated-By: PostHog Code
Task-Id: a56f5f3f-10c6-4552-8d10-d5bfc6e861b3
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