@onereach/step-voice 7.0.26-agenttimeout.10 → 7.0.26-agenttimeout.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -13,8 +13,10 @@ class VoiceAgentFunctionResult extends voice_1.default {
|
|
|
13
13
|
stateResultFunctionId: this.state?.result?.functionId,
|
|
14
14
|
stateResultCallId: this.state?.result?.callId,
|
|
15
15
|
});
|
|
16
|
+
// Read the voice call data to get the call context
|
|
17
|
+
await this.fetchData();
|
|
16
18
|
// Attempt to get functionId from multiple sources to handle parallel function calls.
|
|
17
|
-
// Session storage is race-prone when multiple
|
|
19
|
+
// Session storage (__voiceAgentContext) is race-prone when multiple threads run concurrently.
|
|
18
20
|
const threadStateFunctionId = this.state?.result?.functionId;
|
|
19
21
|
const resolvedFunctionId = inputFunctionId || threadStateFunctionId;
|
|
20
22
|
this.log.info("VoiceAgentFunctionResult: resolvedFunctionId", {
|
|
@@ -54,8 +56,8 @@ class VoiceAgentFunctionResult extends voice_1.default {
|
|
|
54
56
|
// Priority 4: Shared session context (backward compat, NOT race-safe for parallel calls)
|
|
55
57
|
if (!ctx) {
|
|
56
58
|
ctx = await this.thread.get('__voiceAgentContext') ?? {};
|
|
57
|
-
ctxSource = '__voiceAgentContext (shared session)';
|
|
58
|
-
this.log.info("VoiceAgentFunctionResult:
|
|
59
|
+
ctxSource = '__voiceAgentContext (shared session - RACE PRONE)';
|
|
60
|
+
this.log.info("VoiceAgentFunctionResult: WARNING using shared session ctx", { functionId: ctx?.functionId, callId: ctx?.callId });
|
|
59
61
|
}
|
|
60
62
|
const { callId, callCallback, name: functionName, functionId } = ctx;
|
|
61
63
|
this.log.info("VoiceAgentFunctionResult: resolved context", {
|
|
@@ -84,7 +86,7 @@ class VoiceAgentFunctionResult extends voice_1.default {
|
|
|
84
86
|
commands: [{ name: 'agentFunctionResult', params }]
|
|
85
87
|
}
|
|
86
88
|
};
|
|
87
|
-
this.log.info("VoiceAgentFunctionResult: sending", { functionId, functionName, callId });
|
|
89
|
+
this.log.info("VoiceAgentFunctionResult: sending response", { functionId, functionName, callId, ctxSource });
|
|
88
90
|
await this.thread.eventManager.emit(event, {
|
|
89
91
|
target: callCallback,
|
|
90
92
|
invocationType: 'async',
|