Skip to content

fix(issue-discovery): keep fresh scoring data when open-count fetch fails (#1249)#1312

Closed
jeffrey701 wants to merge 1 commit into
entrius:testfrom
jeffrey701:fix/issue-discovery-soft-fail-open-count-1249
Closed

fix(issue-discovery): keep fresh scoring data when open-count fetch fails (#1249)#1312
jeffrey701 wants to merge 1 commit into
entrius:testfrom
jeffrey701:fix/issue-discovery-soft-fail-open-count-1249

Conversation

@jeffrey701
Copy link
Copy Markdown

Summary

run_issue_discovery makes two mirror calls per miner — one for the scoring payload (since=lookback) and one for the open-issue count. When call 1 succeeds and call 2 fails, the current code calls _restore_issue_discovery_from_cache and continues, discarding the freshly-fetched solved-issue evidence and reverting to stale cached aggregates.

Soft-fail the open-count call: when it raises, fall back to the prior cycle's per-repo total_open_issues via a new helper _open_counts_from_cache(evaluation, evaluation_cache, enabled_names). Scoring then proceeds against the lookback dataset that was already retrieved. Empty fallback ({}) when no cache row exists — still better than dropping the miner entirely.

Implementation matches the issue's "Possible Solution" section.

Closes #1249

Test plan

  • uv run pytest tests/validator/issue_discovery/ — 54/54 pass.
  • Manual reasoning:
    • Path A: both calls succeed → behavior unchanged (_count_open_issues over fresh current_response).
    • Path B: call 1 fails → behavior unchanged (still restore from cache + continue).
    • Path C: call 1 succeeds, call 2 fails → NEW: _open_counts_from_cache returns prior-cycle per-repo counts (or {}), scoring runs over response.issues.

…ails (entrius#1249)

run_issue_discovery makes two mirror calls per miner: one for the
scoring payload (since=lookback) and one for the open-issue count.
When the first succeeds and the second fails, the current code restores
stale cached aggregates and drops the freshly-fetched solved-issue
evidence — penalising miners for transient mirror flakiness on the
supplementary call.

Treat the open-count fetch as soft-fail: when it raises, fall back to
the prior cycle's per-repo total_open_issues (via a new helper,
_open_counts_from_cache) and continue scoring against the lookback
dataset already in hand. Empty fallback when no cache row exists.

Closes entrius#1249
@xiao-xiao-mao xiao-xiao-mao Bot added the bug Something isn't working label May 19, 2026
@jeffrey701 jeffrey701 closed this May 19, 2026
@jeffrey701 jeffrey701 deleted the fix/issue-discovery-soft-fail-open-count-1249 branch May 19, 2026 17:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Issue-discovery drops fresh solved-issue data when the second get_miner_issues call fails (open-count fetch path)

1 participant