Skip to content

Conversation

Weves
Copy link
Contributor

@Weves Weves commented Apr 24, 2025

Description

Fixes https://linear.app/danswer/issue/DAN-1875/fix-tool-choice

How Has This Been Tested?

Tested an assistant with a tool before (would always search). Now it doesn't.

Backporting (check the box to trigger backport action)

Note: You have to check that the action passes, otherwise resolve the conflicts manually and tag the patches.

  • This PR should be backported (make sure to check that the backport attempt succeeds)
  • [Optional] Override Linear Check

@Weves Weves requested a review from a team as a code owner April 24, 2025 00:07
Copy link

vercel bot commented Apr 24, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
internal-search ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 24, 2025 0:13am


async function updateCurrentMessageFIFO(
stack: CurrentMessageFIFO,
params: any
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove the evil any !

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Summary

This PR fixes an issue with tool selection logic in the chat functionality, focusing on preventing automatic search behavior for assistants with tools.

  • Removes promptId parameter from sendMessage function in /web/src/app/chat/lib.tsx to fix incorrect tool triggering
  • Introduces SendMessageParams interface for better type safety in message handling
  • Modifies search behavior to only trigger when explicitly requested via queryOverride or forceSearch flags
  • Updates ChatPage.tsx to properly handle tool selection without defaulting to search
  • Aligns with tool constants defined in /web/src/app/chat/tools/constants.ts for consistent tool identification

2 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings | Greptile

@Weves Weves merged commit 115cfb6 into main Apr 25, 2025
10 of 11 checks passed
@Weves Weves deleted the fix-tool-choice branch April 25, 2025 04:51
aronszanto pushed a commit to aronszanto/onyx that referenced this pull request Apr 26, 2025
AnkitTukatek pushed a commit to TukaTek/onyx that referenced this pull request Sep 23, 2025
* Fix tool choice

* fix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant