← Back to Pull requests

feat(sidebar): T3's Limited and Goal states of a thread (W36, D1306–D1307) #245

Open
unknown opened this pull request with 260 lines diff across 3 files
View on GitHub
unknown unknown commented on Oct 23, 2026 11:03 UTC
Author

W36 slice 2: T3's sidebar states "Limited" and "Goal". Decisions D1306–D1307 in docs/plans/t3-parity.md ("Usage limits and goals in the sidebar (W36)").

This PR is stacked on #241: its base is feat/w36-usage-accounts.

  • D1306: the thread's record keeps lastTurn.failure ({ class: "usage_limit", resetAt? }), set with a failed turn and gone with the next one. It also keeps goalStatus, taken from agent.goal.updated and absent once the goal is cleared. Both are additive: they are in the threads record schema and in ThreadRecord of @jhin/client-api.

  • D1307: T3's resolveSidebarThreadStatus. A turn that failed on a usage limit shows "Limited" in the warning colour instead of "Failed", and the row does not fade. The hover card says "Usage limit reached" instead of "Error occurred". A working thread whose goal is active shows "Goal" instead of "Working", with the working time.
  • These are removed from the Deferred list in providers.md. The Usage page and T3's goal checks count stay there.

    Evidence

    !Limited in the sidebar

    $ vp test run plugins/threads/test/features.test.ts apps/web/test/sidebar-order.test.ts
     Test Files  2 passed (2)        # 28 + 25 tests, incl. the new D1306 and D1307 cases
    $ vp run --filter @jhin/web typecheck && vp run --filter @jhin/plugin-threads typecheck   # clean
    $ npx playwright test tests/composer.spec.ts -g "usage-limit failure"
      ✓  1 [chromium] › tests/composer.spec.ts:486:1 › shows the agent's usage limits on /usage-limits, and a usage-limit failure with its reset time (6.8s)
    

    The e2e now also checks that the sidebar row is labelled …, Limited and that no row says Failed. The "Goal" label is only visible while a turn runs, so it is covered by the unit test (sidebarTopStatus("working", …, goal) === "goal") and by the threads test, which records goalStatus from the fake agent's /goal.

    🤖 Generated with Claude Code

    Diff: 260 lines (+195 / -65) across 3 files Reviewer: claude[bot] Review duration: 5m
    All Vouch review confidence checks passed
    Residual risk 0.22 = Change Risk (0.39) × (1 − Review Confidence (0.44)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.39 · 260 lines diff across 3 files
    0.39
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 91% · Reviewer familiarity: 35%
    44%
    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.333
    Real PR Conversation Timeline
    1 comments
    "Review active on #245"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 44.5% 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: 39.2% (MEDIUM) · Higher = larger blast radius
    39.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: 44.5% · Lower = rushed or shallow review
    44.5%
    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.8% · Safe to merge
    21.8%
    Repository