mirror of
https://github.com/open-webui/open-webui.git
synced 2026-10-18 04:43:55 +00:00
fix: OAuth MCP tool is not enabled after login when the model has default tools (#32488)
Enabling an OAuth MCP tool from the Integrations menu sends the user through the OAuth login and back to a new chat, where the tool should be on. When the selected model had tools of its own enabled by default, the tool came back switched off, so it had to be enabled a second time. Now it stays on, together with the model's own tools. For the same reason, a link like `/?tools=my_tool` opened with such a model ignored the listed tools, and now turns them on. Fixes #32476
This commit is contained in:
parent
1bc5648a7b
commit
8172291838
1 changed files with 7 additions and 4 deletions
|
|
@ -1071,10 +1071,12 @@
|
|||
lastTerminalSkillSelector = $selectedTerminalId;
|
||||
}
|
||||
|
||||
let settingDefaults = false;
|
||||
let settingDefaults: Promise<void> | null = null;
|
||||
const setDefaults = async () => {
|
||||
if (settingDefaults) return;
|
||||
settingDefaults = true;
|
||||
// Concurrent callers must wait, or the earlier run overwrites what they write afterwards
|
||||
if (settingDefaults) return settingDefaults;
|
||||
let resolveDefaults = () => {};
|
||||
settingDefaults = new Promise<void>((resolve) => (resolveDefaults = resolve));
|
||||
|
||||
try {
|
||||
if (!$tools) {
|
||||
|
|
@ -1217,7 +1219,8 @@
|
|||
}
|
||||
}
|
||||
} finally {
|
||||
settingDefaults = false;
|
||||
settingDefaults = null;
|
||||
resolveDefaults();
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue