Skip to content

upstream: harden trackerIntake — label filter + per-project concurrency cap #49

Description

@polymath-orchestrator

Goal

Upstream-shaped feature (vanilla rule: issue here + upstream PR, we carry the delta): harden ao's trackerIntake loop with two missing controls:

  1. Label filteringTrackerIntakeConfig gains include/exclude label rules (e.g. labels: ["agent-ok"], excludeLabels: ["agent:noauto"]) applied in issueMatchesConfig alongside the existing assignee rule.
  2. Concurrency capmaxConcurrent per project: intake skips spawning when the project's live intake-spawned worker count is at the cap, and picks the issue up on a later tick once a slot frees (no permanent skip).

How we got here

We are adopting trackerIntake (merged upstream AgentWrapper#2325, in our tree) as the sole dispatcher for this repo, with an assignee rule as the go-signal. Two gaps surfaced in review of backend/internal/observe/trackerintake/observer.go:

  • issueMatchesConfig filters on assignees only — there is no label opt-out, so policies like our previous agent:noauto cannot be expressed.
  • The poll loop spawns one worker per matching issue with no concurrency bound; a bulk filing-and-assignment burst would spawn unbounded workers. Our fleet policy caps concurrent workers per project (we use 4).

Both are generally useful upstream, not Polymath-specific. Interim mitigation on our side: assignment-as-opt-in keeps a deliberate finger on the throttle, but nothing enforces the cap.

Acceptance criteria

  • TDD: label include/exclude fields on TrackerIntakeConfig (domain + validation + issueMatchesConfig) with tests
  • TDD: maxConcurrent honored by the intake loop — at-cap issues are deferred, not dropped; picked up when a slot frees; tests cover the boundary
  • OpenAPI spec / DTOs / frontend schema regenerated where the config is exposed
  • Backend gates green: cd backend && go build ./... && go vet ./... && go test ./...
  • Verified live on a test project: excluded-label issue never spawns; cap of N holds under N+2 eligible issues
  • Upstream PR opened against AgentWrapper/agent-orchestrator; our PR references it
  • PARK the merge for a human if the diff touches backend/internal/daemon/** (wiring lives at backend/internal/daemon/tracker_intake_wiring.go); observe/trackerintake itself is not on the sensitive list

Context / pointers

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureNew capability

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions