-
Notifications
You must be signed in to change notification settings - Fork 11
Open
Labels
Description
Description
The application uses a global variable to_say that's modified across multiple endpoints. When multiple farmers call simultaneously, their responses get mixed up because all calls share the same global variable. This is a critical production bug.
Example of the Problem:
Farmer A calls: "Tell me about PM-KISAN"
Farmer B calls: "Weather forecast please"
Agent sets to_say = "PM-KISAN gives Rs. 6000..."
Agent sets to_say = "Today's weather is sunny..." (overwrites!)
Farmer A hears: "Today's weather is sunny..." ❌ (Wrong response!)
What needs to be done:
- Remove the global
to_sayvariable - Implement session-based conversation storage using Flask sessions
- Store conversation state per Call SID (unique for each call)
- Update both
/voiceand/handle-speechendpoints - Test with concurrent calls (simulate using multiple requests)