← Back to Pull requests

fix(hub): page title conversation collection past tool-noise windows #2316

Open
unknown opened this pull request with 237 lines diff across 2 files
View on GitHub
unknown unknown commented on Nov 07, 2026 18:30 UTC
Author

Problem

Manual Generate on the session title fails with 422 empty ("No conversation content is available for a title suggestion") on long-running agent sessions, even though the conversation contains plenty of user/assistant text.

TitleSuggestionService.suggestTitle reads a single newest 200-row window (getMessagesByPosition limit 200) and feeds it to buildTitleConversation. On a busy agent session the newest window can be entirely non-conversational rows — tool calls, tool results, reasoning, progress, bookkeeping — so the extraction yields nothing and the request 422s. A long turn easily emits hundreds of such rows; on one production session the last user prompt sat ~550 rows back, far outside the window.

The sibling scans in the same class (hasTitleResponse, hasCompletedFirstTurn) already page backward with a before cursor for exactly this reason — the conversation builder just never did.

Fix

Page backward past non-conversational rows with the same before-cursor pattern, until real user/assistant text enters the collected set, the input budget is reached, or the store is exhausted:

  • Bounded to TITLE_SUGGESTION_MAX_SCAN_PAGES = 25 pages (5,000 rows), so a noise-only session cannot walk unbounded history on every (rate-limited) request.

  • Stops early once the built conversation reaches TITLE_SUGGESTION_MAX_INPUT_CHARS - 2_000 or a short page signals the store end; the input cap and per-line truncation of buildTitleConversation are unchanged.

  • A history with no conversational rows at all still reports the same empty 422 as before.
  • Tests

  • A user/assistant exchange buried under 250 tool-call rows: suggestTitle now succeeds and the provider prompt contains the exchange (previously empty).

  • An all-noise history: still empty 422, provider never called.
  • 🤖 Generated with Claude Code

    Diff: 237 lines (+177 / -60) across 2 files Reviewer: github-actions[bot] Review duration: 8m
    All Vouch review confidence checks passed
    Residual risk 0.22 = Change Risk (0.42) × (1 − Review Confidence (0.47)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.42 · 237 lines diff across 2 files
    0.42
    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.327
    Ai Authored ai_authored
    0.050
    Real PR Conversation Timeline
    1 comments
    "Review active on #2316"
    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: 42.2% (MEDIUM) · Higher = larger blast radius
    42.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: 22.5% · Safe to merge
    22.5%
    Repository