Skip to content

Nightshift: consider priority labels when ordering issues #632

Description

@mickume

Feature Request

Nightshift should consider priority:high, priority:medium, and priority:low labels when determining issue processing order, so that high-priority issues are worked on before lower-priority ones.

Current Behavior

Nightshift fetches issues with the af:fix label and orders them by:

  1. Issue number (ascending — oldest first)
  2. Explicit text dependencies (depends on #N, blocked by #N)
  3. GitHub cross-reference metadata
  4. AI triage recommendations (for batches of 3+)
  5. Topological sort with tie-breaking by issue number

Priority labels on issues are completely ignored. A priority:high issue created after a priority:low issue will always be processed second.

Desired Behavior

After dependency ordering is resolved, issues at the same dependency depth should be sorted by priority label:

  1. priority:high — processed first
  2. priority:medium (or no priority label) — default
  3. priority:low — processed last

Suggested Implementation

The change would be in the topological sort tie-breaking logic in packages/agentfox/agentfox/nightshift/dep_graph.py (lines 70-83). Currently ties are broken by ascending issue number. Instead, ties should be broken by:

  1. Priority label (high > medium/none > low)
  2. Issue number (ascending, as current fallback)

The priority label would need to be extracted from the issue's labels list during the ordering phase in packages/agentfox/agentfox/nightshift/engine.py.

Affected Files

  • packages/agentfox/agentfox/nightshift/dep_graph.py — tie-breaking in topological sort
  • packages/agentfox/agentfox/nightshift/engine.py — pass label info into the ordering pipeline
  • packages/agentfox/agentfox/platform/labels.py — define priority label constants

Metadata

Metadata

Assignees

No one assigned

    Labels

    af:fixIssues ready to be implementedaf:fixedenhancementNew feature or request

    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