Skip to content

[Bug]: Get "Cannot read properties of null (reading 'role')" randomly #2500

Description

@wanlwanl

Language

Javascript/Typescript

Version

1.5.3

Description

Got the exception:

[onTurnError] unhandled error: TypeError: Cannot read properties of null (reading 'role'), call stack: TypeError: Cannot read properties of null (reading 'role')     
at LLMClient.addMessageToHistory (/home/site/wwwroot/node_modules/@microsoft/teams-ai/lib/planners/LLMClient.js:322:53)     
at LLMClient.callCompletePrompt (/home/site/wwwroot/node_modules/@microsoft/teams-ai/lib/planners/LLMClient.js:260:22)     
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)     
at async LLMClient.completePrompt (/home/site/wwwroot/node_modules/@microsoft/teams-ai/lib/planners/LLMClient.js:194:30)     
at async ActionPlanner.completePrompt (/home/site/wwwroot/node_modules/@microsoft/teams-ai/lib/planners/ActionPlanner.js:181:16)     
at async ActionPlanner.continueTask (/home/site/wwwroot/node_modules/@microsoft/teams-ai/lib/planners/ActionPlanner.js:108:24)     
at async ActionPlanner.beginTask (/home/site/wwwroot/node_modules/@microsoft/teams-ai/lib/planners/ActionPlanner.js:80:16)     
at async AI.run (/home/site/wwwroot/node_modules/@microsoft/teams-ai/lib/AI.js:274:28)     
at async /home/site/wwwroot/node_modules/@microsoft/teams-ai/lib/Application.js:505:21     
at async Application.run (/home/site/wwwroot/node_modules/@microsoft/teams-ai/lib/Application.js:406:16)

Related source code: https://github.com/wanlwanl/wanl-fork-azure-sdk-tools/blob/azure-sdk-ai-bot-dev/tools/sdk-ai-bots/azure-sdk-qa-bot/src/models/FakeModel.ts#L26

Reproduction Steps

Not sure how to reproduce, since I got this randomly. The message can be reply to teams user.

Metadata

Metadata

Assignees

No one assigned

    Labels

    V1-Needs FixbugSomething isn't workingjavascriptPull requests that update Javascript code

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions