Skip to content

feat(tracker): bind GitHub intake to user and labels#2527

Open
anirudh5harma wants to merge 3 commits into
AgentWrapper:mainfrom
anirudh5harma:feat/github-issue-intake-v2
Open

feat(tracker): bind GitHub intake to user and labels#2527
anirudh5harma wants to merge 3 commits into
AgentWrapper:mainfrom
anirudh5harma:feat/github-issue-intake-v2

Conversation

@anirudh5harma

Copy link
Copy Markdown
Contributor

Summary

GitHub issue intake is now bound to the authenticated GitHub account, supports repository-native label filters, and previews the number of issues that match before settings are saved. This removes the broad * assignee mode and makes intake scope visible and trustable without moving GitHub logic into Electron.

Related: #2325

What this adds

Backend

  • Resolves the active login through GitHub's GET /user endpoint and uses it for every intake poll; the user is no longer configurable in project state.
  • Fetches the complete repository label catalog through GET /repos/{owner}/{repo}/labels, including pagination, names, colors, and descriptions.
  • Keeps label catalogs fresh with a five-minute service cache, page-aware ETag revalidation in the GitHub adapter, and an explicit refresh path.
  • Persists selected label names in the existing JSON-backed TrackerIntakeConfig; no SQLite migration is required. Multiple labels use AND semantics, while an empty selection means all eligible open issues assigned to the authenticated user.
  • Adds a side-effect-free preview endpoint that counts issues through the same repository, user, state, and label matching rules used by the intake observer.
  • Regenerates the OpenAPI contract and frontend schema from the code-first controller DTOs.

Frontend

  • Shows the repository and authenticated assignee as compact GitHub links in a 50/50 settings row.
  • Adds a searchable, multi-select label popover with repository colors, descriptions, missing-label handling, and manual refresh.
  • Shows the matching open-issue count inline in a highlighted badge and refreshes it as label selections change.
  • Keeps project creation compact: intake is still opt-in and displays the authenticated account without exposing provider credentials or configuration.

Design notes

  • GitHub remains the only provider in this scope; no Linear or Jira behavior is introduced.
  • Label fetching and previewing stay daemon-owned. The Electron frontend only calls typed loopback API routes.
  • Existing v1 configs remain readable. The removed assignee JSON field is ignored, and enabled intake binds to the account currently authenticated with GitHub.
  • Intake remains read-only toward GitHub and retains the existing durable issue/session deduplication behavior.

Validation

  • npm run frontend:typecheck
  • npm --prefix frontend test — 49 files, 475 tests passed
  • cd frontend && npx vite build --config vite.renderer.config.ts
  • cd backend && GOTOOLCHAIN=go1.25.7 go build ./... && GOTOOLCHAIN=go1.25.7 go vet ./...
  • Focused Go suites for tracker adapter, observer, service, controllers, API spec, domain, and shared intake matching — all passed
  • npm run api with no generated OpenAPI or TypeScript schema drift
  • golangci-lint v2.12.2 — 0 issues
  • npm run lint reaches the unchanged kilocode interactive-shell test and times out at TestAuthStatusUnknownWhenKeyOnlyComesFromInteractiveShell; all intake packages pass, and the linter was run separately above.

Post-Deploy Monitoring & Validation

  • Search daemon logs for tracker intake: resolve authenticated user failed, tracker intake: list issues failed, GITHUB_LABELS_FAILED, and GITHUB_PREVIEW_FAILED.
  • Healthy signals: the settings identity matches gh auth, repository labels load or revalidate without exhausting rate limits, preview counts match the observer's eligible set, and repeated polls do not create duplicate sessions.
  • Failure signals: intake polling the wrong assignee, selected labels being ignored, repeated GitHub API failures, or a preview count that diverges from spawned sessions. Immediate mitigation is disabling trackerIntake.enabled for the affected project; roll back if the behavior reproduces across repositories.
  • Validation window: first week after release; owner: Agent Orchestrator maintainers.

Compound Engineering
GPT-5

@whoisasx whoisasx left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review summary:

I found one blocker: the frontend repo preview parser still derives an owner/repo value from non-GitHub remotes, while the daemon rejects those origins. That can show a GitHub link for a GitLab or other remote and make the displayed intake scope misleading.

The rest of the GitHub identity, label catalog, preview, persistence, daemon wiring, and typed client surfaces look consistent to me. I verified the focused backend suites, CLI/daemon wiring suites, frontend typecheck, and changed frontend component tests locally; GitHub checks are also green.

@anirudh5harma, before shipping please also provide backing screenshots and clips for the settings/create flows, label picker, preview count, and the invalid or non-GitHub origin state after the parser mismatch is fixed.

Comment thread frontend/src/renderer/components/ProjectSettingsForm.tsx
@anirudh5harma
anirudh5harma force-pushed the feat/github-issue-intake-v2 branch from e06227f to 22701b2 Compare July 9, 2026 15:59
@anirudh5harma

anirudh5harma commented Jul 9, 2026

Copy link
Copy Markdown
Contributor Author

Feature demo

github-intake-demo.mp4

@anirudh5harma
anirudh5harma requested a review from whoisasx July 9, 2026 16:30
@whoisasx
whoisasx requested a review from AgentWrapper July 9, 2026 17:25
@anirudh5harma
anirudh5harma force-pushed the feat/github-issue-intake-v2 branch 3 times, most recently from 746fd1e to 0a33776 Compare July 13, 2026 13:42
@illegalcall

Copy link
Copy Markdown
Collaborator

GitHub’s usual multi-label filtering uses AND, while this picker uses OR. Could we add a short hint: “Matches any label; none includes all.”

@anirudh5harma
anirudh5harma force-pushed the feat/github-issue-intake-v2 branch from 0a33776 to 8259ead Compare July 16, 2026 09:59

@whoisasx whoisasx left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requesting changes. The intake flow is close, but the Git remote parser can still mis-scope non-GitHub scp-like origins, and disabling intake can leave stale label config persisted.

Comment thread backend/internal/trackerintake/scope.go Outdated
Comment thread frontend/src/renderer/components/IntakeFields.tsx
Bind GitHub issue intake to the authenticated GitHub account, support
repository-native label filters, and preview the count of matching issues
before settings are saved. Removes the broad free-text assignee mode and
makes intake scope visible without moving GitHub logic into Electron.

Backend:
- resolve the active login via GitHub GET /user and use it for every intake
  poll; the user is no longer configurable in project state
- fetch the full repository label catalog (paginated) with a five-minute
  service cache and page-aware ETag revalidation
- persist selected label names in the JSON-backed TrackerIntakeConfig
  (AND semantics; empty selection means all eligible open issues)
- add a side-effect-free preview endpoint counting issues through the same
  repository, user, state, and label rules the observer uses
- regenerate the OpenAPI contract and frontend schema from the controllers

Frontend:
- show repository and authenticated assignee as compact GitHub links
- searchable multi-select label popover with colors, descriptions,
  missing-label handling, and manual refresh
- inline matching open-issue count that refreshes as labels change
- keep project creation compact and opt-in

Rebased onto upstream/main.
@anirudh5harma
anirudh5harma force-pushed the feat/github-issue-intake-v2 branch from 8259ead to b4ea9a0 Compare July 18, 2026 15:17
@anirudh5harma
anirudh5harma requested a review from whoisasx July 18, 2026 15:26

@whoisasx whoisasx left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the latest head. The previous concerns around non-GitHub remote parsing and disabled-label handling look addressed, but I am requesting changes on two intake correctness issues: selected labels currently behave as OR despite the documented AND contract, and authenticated identity can stay cached across token changes.


// MatchesAnyLabel reports whether the issue has at least one selected label.
// An empty selection means "all labels", so every issue matches.
func MatchesAnyLabel(issueLabels, selected []string) bool {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TrackerIntakeConfig.Labels documents that selected labels must all be present, but this helper returns true when any one selected label matches. Because both the observer and preview call Tracker.List without Labels and then rely on this helper, a config like bug + ready will spawn/count issues that have either label instead of both. Please change this to require every selected label, or update the contract and UI copy to explicitly be OR.

func (t *Tracker) AuthenticatedUser(ctx context.Context) (domain.TrackerUser, error) {
t.identityMu.Lock()
defer t.identityMu.Unlock()
if t.authenticatedUser != nil {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This caches the authenticated user for the lifetime of the tracker, while the daemon token source can refresh gh auth token every five minutes and roundTrip reads the current token for each request. If the user switches GitHub auth while AO is running, intake can keep filtering by the old login while GitHub API calls use the newer token. Please tie the identity cache to token changes or give it a bounded TTL, and align the frontend identity cache with that.

@i-trytoohard

Copy link
Copy Markdown
Contributor

From the NotesBot call on 2026-07-19, this existing pr appears to be relevant.
Match confidence: 0.64 (fuzzy).

Relevant discussion excerpts:

    • Created ~50 GitHub labels and shared list via Notion link; prateek pushed back: “optimize for readability… 10-ish labels,” avoid unnecessary labels (e.g., “browser preview,” “tracker intake,” “progress labels”). - Started a list of tactics to increase GitHub stars by getting listed in “DevTooling” directories; [...]
    • Built a changelog demo/video (shared via DM) intended for landing page; automation partial—text may be automated, but “images and videos… manually.” - Created ~50 GitHub labels and shared list via Notion link; prateek pushed back: “optimize for readability… 10-ish labels,” avoid unnecessary labels (e.g., [...]

Source thread: https://discord.com/channels/1476302178913357958/1528463891200217212/1528463891200217212

Generated by AO Bot based on the transcript from NotesBot.

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.

4 participants