Commit 1322271
committed
fix: Resolve UnboundLocalError for 're' module in technical system detection
ISSUE: UnboundLocalError at line 5387: cannot access local variable 're' where it is not associated with a value
ROOT CAUSE:
- Multiple uses of 're.search()' in has_your_system_pattern_rag detection (lines 5387-5393)
- Python detects 're' as a local variable if it's assigned anywhere in the function
- Previous fix only addressed line 3848, but line 5387 also uses 're' module
FIX:
- Import 're' module explicitly as 'regex_module_rag' within the detection block
- Replace all 're.search()' calls with 'regex_module_rag.search()' in has_your_system_pattern_rag
- This ensures no scope conflicts and prevents UnboundLocalError
BENEFITS:
- Fixes chat endpoint crash for technical system questions
- Prevents UnboundLocalError in all code paths
- Consistent with previous fix at line 38481 parent eb1d091 commit 1322271
1 file changed
Lines changed: 7 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5381 | 5381 | | |
5382 | 5382 | | |
5383 | 5383 | | |
| 5384 | + | |
| 5385 | + | |
5384 | 5386 | | |
5385 | 5387 | | |
5386 | 5388 | | |
5387 | | - | |
5388 | | - | |
5389 | | - | |
5390 | | - | |
| 5389 | + | |
| 5390 | + | |
| 5391 | + | |
| 5392 | + | |
5391 | 5393 | | |
5392 | 5394 | | |
5393 | | - | |
| 5395 | + | |
5394 | 5396 | | |
5395 | 5397 | | |
5396 | 5398 | | |
| |||
0 commit comments