← Back to Pull requests

feat(dashboard): allow failed task lookback up to 30 days #160

Open
unknown opened this pull request with 306 lines diff across 3 files
View on GitHub
unknown unknown commented on Nov 22, 2026 20:02 UTC
Author

Summary

The failed tasks card on the dashboard only offers 12h, 1d, 2d and 3d. Teams that look at failures weekly or after a long weekend can't see older ones, even though failed tasks are kept for 30 days by default.

  • Replaces the tabs with a select: 12h, 1d, 2d, 3d, 7d, 14d, 30d. The choice is still saved as the task_issue_summary.lookback_hours setting.

  • Raises the backend limit from 168 to 720 hours in all three places that enforced it: the hours query of GET /api/tasks/failed/recent, the setting definition, and TaskIssueConfig. They now share TASK_ISSUE_LOOKBACK_MAX_HOURS in models.py.

  • Shows the selector only on the failed tasks card. The orphaned tasks card displayed the same tabs, but they changed the failed tasks window and had no effect on orphans, which are listed regardless of age.
  • Testing

  • New unit tests: a 30 day lookback is accepted and returned by the config snapshot, and 721 hours is rejected. The snapshot assertion fails without the TaskIssueConfig change, which otherwise made GET /api/config return 500 after saving 30d.

  • pytest in agent/: 218 passed. nuxt generate builds.

  • Ran the app locally on SQLite with seeded data plus failed tasks aged 2h, 30h, 60h, 5d, 10d, 20d and 40d:

  • - The API returns exactly the expected tasks for each window, and hours=721 answers 422.
    - In the dashboard, 7d shows up to the 5 day failure, 30d up to the 20 day failure (not 40d), and switching back to 12h shows only the 2h failure. The title follows the selection.
    - The selection survives a page reload.
    - The orphaned tasks card has no selector and still lists a 10 day old orphan.
    - Checked at desktop and tablet widths.

    Note

    GET /api/tasks/failed/recent still defaults to limit=50, and the dashboard doesn't override it. With a 30 day window, more than 50 unresolved failures are cut off. I left that unchanged here.

    🤖 Generated with Claude Code

    <!-- This is an auto-generated comment: release notes by coderabbit.ai -->

    <!-- coderabbit-ai-generated:v1 -->

    Summary by CodeRabbit

    New Features
    Expanded the task-issue lookback period to include options of up to 30 days, alongside shorter hourly and daily intervals.
    * The default lookback remains 24 hours. You can configure a period up to 720 hours; values above that limit are rejected.

    <!-- end of auto-generated comment: release notes by coderabbit.ai -->

    Diff: 306 lines (+229 / -77) across 3 files Reviewer: coderabbitai[bot] Review duration: 9m
    All Vouch review confidence checks passed
    Residual risk 0.21 = Change Risk (0.40) × (1 − Review Confidence (0.47)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.40 · 306 lines diff across 3 files
    0.40
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    46%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Shallow Review Depth shallow_review_depth
    0.344
    Diff Size diff_size
    0.343
    Real PR Conversation Timeline
    1 comments
    "Review active on #160"
    general weight: 0.35
    Assignees
    Unassigned
    Labels
    risk: low confidence: 46.7% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 40.2% (MEDIUM) · Higher = larger blast radius
    40.2%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 46.7% · Lower = rushed or shallow review
    46.7%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 21.4% · Safe to merge
    21.4%