feat(frontend): return optional activation scores with generated tokens #19723
All Vouch review confidence checks passed
Residual risk 0.34 = Change Risk (0.64) × (1 − Review Confidence (0.47)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.64 · 313 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
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
Diff Size
diff_size
0.344
Shallow Review Depth
shallow_review_depth
0.344
Sensitive Paths
sensitive_paths
0.064
Real PR Conversation Timeline
1 comments
"Review active on #19723"
general
weight: 0.35
neilkg
Overview
Clients that display a score beside each generated token otherwise have to join two streams themselves. Single-choice chat and text completions can now return both together. Scores follow token positions, even when the same token ID occurs twice.
Request extension
Response excerpt
Key Changes
Validation
The chat and text HTTP test checks repeated IDs, streaming, and a stalled scorer. In a two-node H200 SGLang run, the first request returned eight inline nulls. Its handle recovered all eight scores. The next three requests delivered all 24 scores inline.
Issues and Ongoing Work
Builds on #19720. Inline delivery requires frontend tokenization. A scorer that falls behind generation can still produce inline nulls.
<details>
<summary>Pull Request Checklist</summary>
/pr-checklistskill.</details>
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
<!-- coderabbit-ai-generated:v1 -->
Summary by CodeRabbit
New Features
Added support for requesting activation scores inline with generated tokens or receiving a handle to retrieve scores later.
Added a monitor-scores endpoint that routes score lookups to configured scorer services.
Added support for activation-score requests in SGLang and vLLM, with validation for unsupported request configurations.
Bug Fixes
Improved SGLang token-budget calculation by using the configured maximum request length when available.
Documentation
Documented activation-score requests, score lookup, configuration, and unavailable-score behavior.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->