core: Snapshot active_conversation_info in typing-notification loop. #1656
All Vouch review confidence checks passed
Residual risk 0.24 = Change Risk (0.43) × (1 − Review Confidence (0.45)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.43 · 194 lines diff across 2 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
Shallow Review Depth
shallow_review_depth
0.344
Diff Size
diff_size
0.315
Real PR Conversation Timeline
1 comments
"Review active on #1656"
general
weight: 0.35
Adarsh-Me
Fixes: #1501
Root cause:
Controller.show_typing_notification(core.py) runs on its own thread (via@asynch) and readself.active_conversation_infotwice per loop iteration — once in thewhilecondition, once to subscript["sender_name"]. The model thread (_handle_typing_event) reassigns that attribute to a new{}on a typingstopevent. If the reset lands between the two reads, the subscript raisesKeyError: 'sender_name', killing the notification thread instead of exiting the loop cleanly. That is the intermittenttest_show_typing_notificationfailure — and a latent crash in real usage, not just a test artifact.Fix: read the attribute once per iteration into a local (
conversation_info) and test/subscript only that snapshot. A concurrent reset then either still shows the previous dict (which always carries the key) or an empty dict that exits the loop.Test hardening:
test_show_typing_notificationnow joins the notification thread (with timeout) before asserting — asserting while the thread was still starting up raced it under CI load and failed the footer-text assertions intermittently.Verification:
KeyErrorin 2000/2000 trials; fixed snapshot in 0/2000.tests/core/test_core.py -k typing: 2 passed, repeated 5x, stable.tests/core/test_core.py+tests/model/test_model.py: 1033 passed.