这是indexloc提供的服务,不要输入任何密码
Skip to content

HITL - Set humanAgent before sending join message #13873

@lantonini-sbe

Description

@lantonini-sbe

Make sure the issue is related to code located in this repository.

  • I confirm that the reported bug or feature request is not related to Botpress on premise version (v12 and below)
  • I confirm that the reported bug or feature request is not related to the Botpress Studio
  • I confirm that the reported bug or feature request is not related to the Botpress Dashboard

Description of the bug or feature request

in plugins/hitl/src/hooks/before-incoming-event/hitl-assigned.ts

you send join message before setting human agent info :
await Promise.all([ upstreamCm.respond({ type: 'text', text: sessionConfig.onHumanAgentAssignedMessage ?? DEFAULT_HUMAN_AGENT_ASSIGNED_MESSAGE, }), downstreamCm.setHumanAgent(humanAgentUserId, humanAgentName), upstreamCm.setHumanAgent(humanAgentUserId, humanAgentName), ])

on the studio, i defined my join message like this : {{ conversation.HitlAgent.humanAgentName }} has joined the conversation
and when i try, i see "conversation.HitlAgent.humanAgentName has joined the conversation"
On another bot, i see " has joined the conversation"

So strange

and i don't know how this part can work :
const { user: humanAgentUser } = await props.client.getUser({ id: humanAgentUserId })
const humanAgentName = humanAgentUser?.name ?? 'A Human Agent'

because, everytime i set humanUserAgent.name in my custom hitl integration, the data is resetted...
the user is correctly updated but few moments later, the field name is missing

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions