Skip to content

Commit 50d3339

Browse files
committed
fix(FR-1698): fix session creation failure when agent is set to auto (#4671)
resolves #4670 (FR-1698) This PR fixes an issue in the `useStartSession` hook where the agent selection logic wasn't properly handling both array and non-array values. The fix uses `_.castArray()` to ensure the agent value is always treated as an array before comparing it to `['auto']`. **Checklist:** (if applicable) - [ ] Documentation - [ ] Minium required manager version - [ ] Specific setting for review (eg., KB link, endpoint or how to setup) - [ ] Minimum requirements to check during review - [ ] Test case(s) to demonstrate the difference of before/after
1 parent f355e96 commit 50d3339

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

react/src/hooks/useStartSession.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ export const useStartSession = () => {
256256
...(baiClient.supports('agent-select') &&
257257
!baiClient?._config?.hideAgents &&
258258
values.agent !== undefined &&
259-
!_.isEqual(values.agent, ['auto'])
259+
!_.isEqual(_.castArray(values.agent), ['auto'])
260260
? {
261261
// Filter out undefined values
262262
agent_list: _.chain(values.agent)

0 commit comments

Comments
 (0)