Skip to content

feat(code): scope initial task suggestions by repo#2258

Closed
posthog[bot] wants to merge 2 commits into
mainfrom
posthog-code/scope-task-suggestions-by-repo
Closed

feat(code): scope initial task suggestions by repo#2258
posthog[bot] wants to merge 2 commits into
mainfrom
posthog-code/scope-task-suggestions-by-repo

Conversation

@posthog
Copy link
Copy Markdown
Contributor

@posthog posthog Bot commented May 20, 2026

Problem

Initial task suggestions produced by the enricher run and the discovery agent run are stored globally and shown on every new task view regardless of which repo is currently selected. When users switch repos in the workspace selector, they still see suggestions generated for a different codebase, which are not actionable in the current context.

Changes

  • Added an optional repoPath field to DiscoveredTask that records the repo a suggestion was generated for (local filesystem path for local workspaces, org/repo for cloud).
  • Stamped repoPath = directory on every suggestion as it enters the store from SetupRunService:
    • The PostHog SDK health, "not installed", and "no init" enricher suggestions.
    • Stale-feature-flag enricher suggestions.
    • The agent's discovered tasks at completeDiscovery time.
  • SuggestedTasksPanel now accepts a repoPath prop. It filters discoveredTasks and only renders entries whose repoPath matches the current selection. Entries without repoPath (persisted before this change) keep showing for one upgrade cycle so existing users do not lose their pending suggestions.
  • TaskInput passes the existing effectiveRepoPath (cloud repo string or local path) into the panel so filtering tracks the repo selector on the page.

How did you test this?

  • Read through the suggestion code paths and verified each entry into the store is now stamped with directory.
  • Verified the filter in SuggestedTasksPanel correctly drops mismatched suggestions and gracefully passes through older entries without repoPath.
  • Ran pnpm exec biome check --write over the touched files — formatted clean.
  • TypeScript check on the touched files surfaces no new errors (the repo has unrelated pre-existing errors from un-built workspace packages in this scratch environment).

Publish to changelog?

no


Created with PostHog Code

PostHog Code added 2 commits May 20, 2026 15:40
Stamp each enricher- and discovery-agent-produced suggestion with the
repo it was generated for, and filter `SuggestedTasksPanel` on the new
task page so only suggestions matching the currently selected repo are
shown. Suggestions persisted before this change have no `repoPath` and
remain visible for backward compatibility until the next discovery run.

Generated-By: PostHog Code
Task-Id: a1a33388-f634-43c0-b2df-a732145fb162
Generated-By: PostHog Code
Task-Id: a1a33388-f634-43c0-b2df-a732145fb162
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