diff --git a/modules/chat.py b/modules/chat.py index b0be2bc2..ad1095f3 100644 --- a/modules/chat.py +++ b/modules/chat.py @@ -1151,7 +1151,9 @@ def generate_chat_reply_wrapper(text, state, regenerate=False, _continue=False): for _tool_turn in range(max_tool_turns): history = state['history'] - # Turn 0: use original flags; turns 2+: regenerate into the same entry + # Turn 0: use original flags; turns 2+: regenerate into the same entry. + # _tool_turn tells chatbot_wrapper to skip version creation/sync so + # that intermediate tool-loop regenerations don't pollute swipe history. if _tool_turn > 0: state['_tool_turn'] = True diff --git a/modules/ui_chat.py b/modules/ui_chat.py index 9c7424e7..d5b13094 100644 --- a/modules/ui_chat.py +++ b/modules/ui_chat.py @@ -93,6 +93,7 @@ def create_ui(): from modules.tool_use import get_available_tools shared.gradio['selected_tools'] = gr.CheckboxGroup(choices=get_available_tools(), value=[], label='Tools', info='Functions the model can call during generation.') + ui.create_refresh_button(shared.gradio['selected_tools'], lambda: None, lambda: {'choices': get_available_tools()}, 'refresh-button') gr.HTML("")