fix(tui): refresh task output previews #2357
All Vouch review confidence checks passed
Residual risk 0.16 = Change Risk (0.40) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.40 · 295 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 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.340
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #2357"
general
weight: 0.35
ousamabenyounes
Related Issue
Resolves #2341
Problem
The
/tasksPreview Output loaded only when the selection changed. Running process output and background-agent results could therefore remain stale, and an output-loading failure was displayed as if the task had produced no output.What changed
Rshortcut while keeping one request in flight per selection.Test verification (RED → GREEN)
Upstream RED (
origin/mainwith regression tests only):The failures showed the error as
[no output captured], left the selected preview stale after a task event, and did not retry the preview throughR.Patched GREEN:
Additional validation:
Checklist
gen-changesets; added a patch changeset for@moonshot-ai/kimi-code.gen-docs; no documentation update is needed because the existing reference only lists/tasksand does not describe preview refresh behavior.Review feedback verification
The periodic poll now skips output reads for terminal tasks while event-driven final reloads and manual
Rretries remain enabled. A stale-running-poll regression test failed with 3 output reads before the follow-up fix and passes with exactly 2 afterward.The follow-up terminal-event race test failed because the final reload was missing, then a strengthened variant failed because a repeated repaint caused a third read that overwrote the final output. Both now pass with exactly one final automatic reload.
The refreshed-status regression test failed with 2 output reads instead of 1 when only
listBackgroundTasksobserved termination; it now passes and polling stops when either status source is terminal.