[PR #1469] [MERGED] docs: show plugin authors how to read their own id after v0.12.0's module rename #1429

Closed
opened 2026-10-18 21:31:26 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/docs/pull/1469
Author: @silentoplayz
Created: 10/16/2026
Status: ✅ Merged
Merged: 10/16/2026
Merged by: @silentoplayz

Base: main ← Head: docs/plugin-own-id


📝 Commits (1)

  • 496c9e9 docs: show plugin authors how to read their own id after v0.12.0's module rename

📊 Changes

1 file changed (+11 additions, -0 deletions)

View changed files

📝 docs/features/extensibility/plugin/development/under-the-hood.mdx (+11 -0)

📄 Description

Summary

Since v0.12.0, Open WebUI loads each plugin as a module named function_{id}_<32 hex characters> (or tool_{id}_<32 hex characters>) instead of function_{id} (e6476928e, plugin.py#L277). A plugin that took its own id from __name__ now gets the id with the hex suffix attached, so anything it looks up by that id misses. My own event functions did this, so, on v0.12.0, their old versions could not switch themselves off. I fixed 19 event functions by stripping the suffix at module load, as this tip shows.

The Under the Hood page already documents the new module name. This adds a tip right below it with what to use instead. Inside a handler, that is the __id__ argument (Pipes do not receive it). For code that runs at module load, it is a one-line re.sub that strips the prefix and suffix and works on both the old and the new names.

It is one tip on one page, with nothing to maintain unless the module naming changes again, and it applies to every deployment the same way. It sits next to step 2, which documents the name, and links to the existing Reserved Arguments entry for __id__.

None.

Checklist

  • I have reviewed the relevant documentation and matched the existing style.
  • This PR meets Open WebUI's contribution standards: it is accurate, relevant to users, narrowly scoped, maintainable, and not promotional content, advertising, lead generation, SEO placement, or a request to list a product, service, provider, integration, gateway, tool, or company primarily for visibility.
  • I understand that PRs that do not meet these standards may be closed without review and will not be merged. Repeated, low-quality, off-topic, promotional, or intentionally misleading submissions may result in the contributor being blocked from future participation in Open WebUI repositories.

Notes for reviewers

What I checked:

  • v0.11.4, the last release before v0.12.0, named the module function_{id} (or tool_{id}), and e6476928e first shipped in v0.12.0.
  • __id__ is passed to Event, Action, Filter and Tool handlers, and not to Pipes.
  • The re.sub line returns the plain id for function_<id>_<hex>, tool_<id>_<hex>, function_<id> and tool_<id>, including an id that itself starts with tool_.
  • Prettier's check passes on the changed file.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/open-webui/docs/pull/1469 **Author:** [@silentoplayz](https://github.com/silentoplayz) **Created:** 10/16/2026 **Status:** ✅ Merged **Merged:** 10/16/2026 **Merged by:** [@silentoplayz](https://github.com/silentoplayz) **Base:** `main` ← **Head:** `docs/plugin-own-id` --- ### 📝 Commits (1) - [`496c9e9`](https://github.com/open-webui/docs/commit/496c9e9eeaf36c4e9feb444f58d22bf700ddc889) docs: show plugin authors how to read their own id after v0.12.0's module rename ### 📊 Changes **1 file changed** (+11 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `docs/features/extensibility/plugin/development/under-the-hood.mdx` (+11 -0) </details> ### 📄 Description ## Summary Since v0.12.0, Open WebUI loads each plugin as a module named `function_{id}_<32 hex characters>` (or `tool_{id}_<32 hex characters>`) instead of `function_{id}` ([`e6476928e`](https://github.com/open-webui/open-webui/commit/e6476928e), [plugin.py#L277](https://github.com/open-webui/open-webui/blob/079fb19e75f8be4b44fada0c755cf383b21a625b/backend/open_webui/utils/plugin.py#L277)). A plugin that took its own id from `__name__` now gets the id with the hex suffix attached, so anything it looks up by that id misses. My own event functions did this, so, on v0.12.0, their old versions could not switch themselves off. I fixed 19 event functions by stripping the suffix at module load, as this tip shows. The Under the Hood page already documents the new module name. This adds a tip right below it with what to use instead. Inside a handler, that is the `__id__` argument (Pipes do not receive it). For code that runs at module load, it is a one-line `re.sub` that strips the prefix and suffix and works on both the old and the new names. It is one tip on one page, with nothing to maintain unless the module naming changes again, and it applies to every deployment the same way. It sits next to step 2, which documents the name, and links to the existing Reserved Arguments entry for `__id__`. ## Related issue or discussion None. ## Checklist - [x] I have reviewed the relevant documentation and matched the existing style. - [x] This PR meets Open WebUI's contribution standards: it is accurate, relevant to users, narrowly scoped, maintainable, and not promotional content, advertising, lead generation, SEO placement, or a request to list a product, service, provider, integration, gateway, tool, or company primarily for visibility. - [x] I understand that PRs that do not meet these standards may be closed without review and will not be merged. Repeated, low-quality, off-topic, promotional, or intentionally misleading submissions may result in the contributor being blocked from future participation in Open WebUI repositories. ## Notes for reviewers What I checked: - v0.11.4, the last release before v0.12.0, named the module `function_{id}` (or `tool_{id}`), and `e6476928e` first shipped in v0.12.0. - `__id__` is passed to Event, Action, Filter and Tool handlers, and not to Pipes. - The `re.sub` line returns the plain id for `function_<id>_<hex>`, `tool_<id>_<hex>`, `function_<id>` and `tool_<id>`, including an id that itself starts with `tool_`. - Prettier's check passes on the changed file. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-18 21:31:26 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
open-webui/docs#1429
No description provided.