Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide a way to pull latest changes made to a registered tool on demand. #735

Closed
sangee2004 opened this issue Dec 3, 2024 · 6 comments
Closed
Assignees
Labels
admin-ui UI related issues enhancement New feature or request

Comments

@sangee2004
Copy link

Steps to reproduce the problem:

  1. Register a new tool from a github repo.
  2. Add this tool to an agent.
  3. Chat with the agent that involves this tool call.
  4. Make some changes to the tool in the github repo.

There is no way for me to use the new version of the tool.

Even when I delete the tool and add the same tool again, I only get the version of the tool from step1 (changes from step4 are not available).

Expected Behavior:
Provide a way to pull latest changes made to a registered tool on demand.

@thedadams
Copy link
Contributor

The backend changes for this PR have merged and this is ready for UI work.

The API for "force refresh" of a tool reference is POST /api/tool-references/{id}/force-refresh.

@cjellick cjellick added the admin-ui UI related issues label Jan 13, 2025
@ryanhopperlowe ryanhopperlowe self-assigned this Jan 13, 2025
@ryanhopperlowe
Copy link
Contributor

@cjellick - should this be available on all tools or just custom ones?

@cjellick
Copy link
Contributor

Custom. @thedadams did you put distinguish between the two?

@ryanhopperlowe
Copy link
Contributor

ryanhopperlowe commented Jan 13, 2025

@cjellick @thedadams - The api that the backend exposes here seems to return an asynchronous response. My steps:

  • Update tool
  • Force Refresh Tool
  • refetch GET /api/tool-references?type=tool

I do not see the list update as I'd expect. Refreshing gets the new data.

options here are to either make the response synchronous or implement Polling in the UI. If we were to go with Polling, I'd probably want some indicator as to when the tool was last updated so I know when to stop polling for the updates

Edit: I tried using revision as an indicator, but that did not help because there will be times where Force Refresh is triggered and there will be no changes to the repo. In this scenario, polling would start but never stop (unless with an arbitrary timeout)

With this in mind polling is not a good solution and I'd push to make the api synchronous. Very open to discussion on the matter though.

WDYT?

@thedadams
Copy link
Contributor

Custom. @thedadams did you put distinguish between the two?

There is no difference from the backend perspective; it makes sense to refresh either.

@ryanhopperlowe Regarding synchronous/asynchronous: the refreshing is done asynchronously. I believe polling is already implemented for tool references in the UI because I added a resolved field to the tool reference object that is false or undefined until the tool reference has been updated. That field should still be useful in this case.

@sangee2004
Copy link
Author

Able to pull the latest version for custom tools using "Refresh Tool" option provided the tool in the Tools page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
admin-ui UI related issues enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants