Ethan Tan
04/14/2025, 5:21 PMif (currentDurationTotalSeconds > 30 && callData.checkCount % 6 === 0) {
console.log(`[CALL TRACKING] Adding elapsed time system message: ${elapsedMinutes}m ${elapsedSeconds}s`);
await fetch(controlUrl, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
type: 'add-message',
message: {
role: 'assistant',
content: `[Call time: ${elapsedMinutes} minutes ${elapsedSeconds} seconds]`
},
// No response needed for this informational message
triggerResponseEnabled: false
})
});
}
This is using the **add-message **command, not the say command
Sometimes the assistant correctly does not say anything, but then sometimes the assistant will speak out the message that was added
Could you assist please?Vapi Support Bot
04/14/2025, 5:23 PMadd-message
command, even though you've set triggerResponseEnabled
to false.
I'm unable to pinpoint the exact cause in your specific implementation without more details, but I can definitely help with some potential causes and solutions based on similar issues other Vapi users have experienced.
Based on the information I found, here are some potential causes and solutions:
## Potential Causes
1. **System Message Processing**: According to [Discord discussions](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1338730919904673853), the issue might stem from how system messages are processed in the conversation buffer and immediately sent to the LLM stream, potentially triggering a response even when they shouldn't.
2. **Message Role**: I notice you're using role: 'assistant'
in your message. This might be causing the assistant to treat it as its own message that needs to be spoken.
3. **Configuration Interference**: Other settings in your assistant configuration might be overriding the triggerResponseEnabled
flag. According to [Discord discussions](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1330092161835733013), unexpected behavior can sometimes be caused by interference from other settings.
4. **Timing Issues**: The timing between message playback and action execution might not be properly synchronized, causing the assistant to speak unexpectedly.
## Potential Solutions
1. **Change Message Role**: Try changing the message role from 'assistant'
to `'system'`:
javascript
message: {
role: 'system',
content: `[Call time: ${elapsedMinutes} minutes ${elapsedSeconds} seconds]`
},
2. **Use Mute Control**: If the assistant starts speaking unexpectedly, you could use the mute-assistant
control to stop it:
```javascript
vapi.send({
type: 'control',Vapi Support Bot
04/14/2025, 5:23 PMstartSpeakingPlan
, stopSpeakingPlan
, and firstMessageMode
, as these can influence when the assistant speaks.
4. **Empty String for Request-Start**: According to [Discord discussions](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1333858668730515689), setting the request-start message to an empty string might prevent the default message from being used.
5. **Review Logs**: Check your server logs around the time when the issue occurs to see if there are any patterns or error messages that might provide more clues.
Would you like me to elaborate on any of these potential solutions or suggest additional troubleshooting steps?
Sources:
- [Discord discussion about triggerResponseEnabled](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1338730919904673853)
- [Discord discussion about request-start messages](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1333858668730515689)
- [Discord discussion about configuration interference](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1330092161835733013)Ethan Tan
04/14/2025, 5:27 PMEthan Tan
04/14/2025, 6:01 PMEthan Tan
04/14/2025, 6:01 PMEthan Tan
04/15/2025, 11:56 AMShubham Bajaj
04/17/2025, 5:29 PMEthan Tan
04/17/2025, 7:51 PMcall ID: 9d18746d-e43e-454e-b5b2-33d5685a17a6
16:51:08:372
[LOG]
Model output: [Call time:
16:51:08:373
[LOG]
Voice input: Any sensations, thoughts or emotions coming up? [Call time:
16:51:08:379
[LOG]
Model output: 1 minutes 53 seconds]
Ethan Tan
04/17/2025, 7:54 PMEthan Tan
04/21/2025, 9:18 AMKings_big💫
04/21/2025, 9:40 AMEthan Tan
04/22/2025, 10:26 PMShubham Bajaj
04/22/2025, 10:35 PMEthan Tan
04/24/2025, 10:44 AMEthan Tan
04/24/2025, 10:48 AMEthan Tan
04/25/2025, 6:51 AMShubham Bajaj
04/25/2025, 8:15 PMEthan Tan
04/26/2025, 11:15 PM// Send a message to the assistant about the client's local time
await fetch(controlUrl, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
type: 'add-message',
message: {
// Using 'user' role to mimic a system note injected into the conversation context
role: 'user',
content: `[Current time is ${userTime}]`
},
triggerResponseEnabled: false // Don't make the assistant respond to this
})
});
Call ID: 044adb5e-8efd-4a64-932a-0bb5945043ca
https://cdn.discordapp.com/attachments/1361390885467848805/1365828659973460049/Screenshot_2025-04-27_at_00.13.43.png?ex=680eba90&is=680d6910&hm=4ab77e9600a6a46a2e1778a403cf1952b42e70dff9b0634d7e4efe495405f2ef&Shubham Bajaj
04/27/2025, 9:54 PMEthan Tan
04/28/2025, 10:27 PMShubham Bajaj
04/30/2025, 9:11 AM