Repository navigation
fix(sync): guard KeyError and None person fields during speaker identification - #19009
Conversation
Bounty Program Claim
|
6eada76 to
4a2657c
Compare
|
Thanks @kduailabs — verified against the pipeline code and this fix is correct. backend/utils/sync/pipeline.py
backend/tests/unit/test_sync_pipeline_contact_guards.py
Also confirmed main still has the unguarded by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with |
kodjima33
left a comment
There was a problem hiding this comment.
Trusted backend fixer (kduailabs), scoped KeyError/None guard in speaker sync with tests, CI green; mergeStateStatus UNKNOWN so approve-only.
4a2657c to
976dc95
Compare
|
Post-rebase check on by AI on behalf of David |
aryanorastar
left a comment
There was a problem hiding this comment.
976dc95a34db6c3466cf3ec683b883275ef57222 backend/utils/sync/speaker_identity.py a person missing id or name still raises KeyError. test_sync_pipeline_contact_guards.py pins that hole. Hygiene passed.
…ification Resolves BasedHardware#19008 Failure-Class: none
|
Rebased onto current Resolved by keeping main's newer additions and layering this PR's guards on top:
Tests: |
976dc95 to
af99d08
Compare
|
Verified against the current head (af99d08): backend/utils/sync/speaker_identity.py
backend/tests/unit/test_sync_pipeline_contact_guards.py
One merge-logistics note: both approvals (kodjima33 on 4a2657c, aryanorastar on 976dc95) predate the current head af99d08, which added the test suite and rebased — a quick maintainer re-confirm on this head before merging would be good. Nothing blocking from my side; nice defensive fix with solid regression coverage. by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with |
These tests arrived from main (#19009) and exercise naming other people in sync, which this branch gates on the plan. Without a declared plan they read the subscription and hit the blocked network. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Resolves #19008
Summary of Changes
backend/utils/sync/pipeline.py:build_person_embeddings_cache, guardperson.get('id')and fallbacknametoperson.get('name') or 'Unknown', preventing unhandledKeyError: 'name'orKeyError: 'id'.identify_speakers_for_segments, guardif person and person.get('id'):and fallback speaker name toperson.get('name') or detected_name.backend/tests/unit/test_sync_pipeline_contact_guards.py:build_person_embeddings_cachehandles missingid, missingname, andname: None.identify_speakers_for_segmentshandles person documents without anamekey during text-based speaker detection.Verification
pytest backend/tests/unit/test_sync_pipeline_contact_guards.py backend/tests/unit/test_sync_speaker_evidence.py backend/tests/unit/test_sync_ordered_assignment.py backend/tests/unit/test_sync_cross_job_assignment.py(73 passed).Product invariants affected
none
Failure-Class: none