[PR #18230] [CLOSED] fix: resolve multiple issues related to long model IDs #24716

Closed
opened 2026-04-20 05:33:36 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/open-webui/pull/18230
Author: @silentoplayz
Created: 10/10/2025
Status: Closed

Base: devHead: fix-workspace-model-issues


📝 Commits (3)

  • 04455f1 fix: resolve multiple issues related to long model IDs
  • 58431b4 fix: console error spam from workspace model clone creation page
  • 0cdb133 fix: use constant

📊 Changes

6 files changed (+74 additions, -70 deletions)

View changed files

📝 backend/open_webui/routers/models.py (+26 -18)
📝 src/lib/apis/models/index.ts (+13 -22)
📝 src/lib/components/admin/Settings/Models.svelte (+3 -3)
📝 src/lib/components/workspace/Models.svelte (+29 -22)
📝 src/routes/(app)/workspace/models/create/+page.svelte (+1 -4)
📝 src/routes/(app)/workspace/models/edit/+page.svelte (+2 -1)

📄 Description

Pull Request Checklist

Before submitting, make sure you've checked the following:

  • Target branch: Verify that the pull request targets the dev branch. Not targeting the dev branch may lead to immediate closure of the PR.
  • Description: Provide a concise description of the changes made in this pull request.
  • Changelog: Ensure a changelog entry following the format of Keep a Changelog is added at the bottom of the PR description.
  • Documentation: If necessary, update relevant documentation Open WebUI Docs like environment variables, the tutorials, or other documentation sources.
  • Dependencies: Are there any new dependencies? Have you updated the dependency versions in the documentation?
  • Testing: Perform manual tests to verify the implemented fix/feature works as intended AND does not break any other functionality. Take this as an opportunity to make screenshots of the feature/fix and include it in the PR description.
  • Agentic AI Code:: Confirm this Pull Request is not written by any AI Agent or has at least gone through additional human review and manual testing. If any AI Agent is the co-author of this PR, it may lead to immediate closure of the PR.
  • Code review: Have you performed a self-review of your code, addressing any coding standard issues and ensuring adherence to the project's coding standards?
  • Title Prefix: To clearly categorize this pull request, prefix the pull request title using one of the following:
    • BREAKING CHANGE: Significant changes that may affect compatibility
    • build: Changes that affect the build system or external dependencies
    • ci: Changes to our continuous integration processes or workflows
    • chore: Refactor, cleanup, or other non-functional code changes
    • docs: Documentation update or addition
    • feat: Introduces a new feature or enhancement to the codebase
    • fix: Bug fix or error correction
    • i18n: Internationalization or localization changes
    • perf: Performance improvement
    • refactor: Code restructuring for better maintainability, readability, or scalability
    • style: Changes that do not affect the meaning of the code (white space, formatting, missing semi-colons, etc.)
    • test: Adding missing tests or correcting existing tests
    • WIP: Work in progress, a temporary label for incomplete or ongoing work

Changelog Entry

Description

  • This pull request addresses a series of critical bugs related to creating, managing, and editing models with very long IDs. Previously, these actions would either fail silently or be impossible due to URL length limitations and missing backend validation. These changes ensure that all model management functions work correctly, regardless of ID length, and provide clear, user-facing error feedback.

Added

  • Backend Validation: Added validation to the createNewModel and importModels endpoints to prevent the creation of new models with IDs longer than 255 characters.
  • Error Notifications: Implemented user-facing toast notifications on the frontend to display specific error messages when a model import or update fails due to backend validation (e.g., an ID being too long).

Changed

  • API Endpoint Methods: The following API endpoints were modified to accept the model ID in the request body, avoiding issues with long URLs:
    • GET /api/v1/models/model was changed to POST /api/v1/models/model.
    • DELETE /api/v1/models/model/delete was changed to POST /api/v1/models/model/delete.
    • The updateModelById and toggleModelById endpoints were updated to get the ID from the request body.
  • Edit Page Navigation: The model edit page now uses the URL hash (#) to store and retrieve the model ID. This restores the ability to refresh the page or share a direct link while still supporting very long model IDs.

Fixed

  • Silent Import Failures: Fixed a bug where creating or importing a model with a very long ID would fail silently without notifying the user.
  • Long ID Management: Fixed a bug that prevented deleting, updating, toggling, hiding, or showing models with very long IDs due to URL length limits.

Breaking Changes

  • BREAKING CHANGE: The API endpoints for getModelById, updateModelById, toggleModelById, and deleteModelById have been modified to accept the model ID in the request body instead of as a URL query parameter. The HTTP method for getModelById was changed from GET to POST, and for deleteModelById from DELETE to POST.

Additional Information

  • These changes address the issues reported in GitHub Issue #18125.
  • A thorough review is definitely wanted here. Use this PR as a reference if its a must.

Screenshots or Videos

  • [Attach any relevant screenshots or videos demonstrating the changes]

Contributor License Agreement

By submitting this pull request, I confirm that I have read and fully agree to the Contributor License Agreement (CLA), and I am providing my contributions under its terms.


🔄 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/open-webui/pull/18230 **Author:** [@silentoplayz](https://github.com/silentoplayz) **Created:** 10/10/2025 **Status:** ❌ Closed **Base:** `dev` ← **Head:** `fix-workspace-model-issues` --- ### 📝 Commits (3) - [`04455f1`](https://github.com/open-webui/open-webui/commit/04455f1247645d97f85b996244dfcde20b0f03ab) fix: resolve multiple issues related to long model IDs - [`58431b4`](https://github.com/open-webui/open-webui/commit/58431b40c467661ed0ec60d44bc7e0b0fe4a0e8c) fix: console error spam from workspace model clone creation page - [`0cdb133`](https://github.com/open-webui/open-webui/commit/0cdb1339a8ab683eb74ce844522dafbee6457a7f) fix: use constant ### 📊 Changes **6 files changed** (+74 additions, -70 deletions) <details> <summary>View changed files</summary> 📝 `backend/open_webui/routers/models.py` (+26 -18) 📝 `src/lib/apis/models/index.ts` (+13 -22) 📝 `src/lib/components/admin/Settings/Models.svelte` (+3 -3) 📝 `src/lib/components/workspace/Models.svelte` (+29 -22) 📝 `src/routes/(app)/workspace/models/create/+page.svelte` (+1 -4) 📝 `src/routes/(app)/workspace/models/edit/+page.svelte` (+2 -1) </details> ### 📄 Description # Pull Request Checklist **Before submitting, make sure you've checked the following:** - [X] **Target branch:** Verify that the pull request targets the `dev` branch. Not targeting the `dev` branch may lead to immediate closure of the PR. - [X] **Description:** Provide a concise description of the changes made in this pull request. - [X] **Changelog:** Ensure a changelog entry following the format of [Keep a Changelog](https://keepachangelog.com/) is added at the bottom of the PR description. - [X] **Documentation:** If necessary, update relevant documentation [Open WebUI Docs](https://github.com/open-webui/docs) like environment variables, the tutorials, or other documentation sources. - [X] **Dependencies:** Are there any new dependencies? Have you updated the dependency versions in the documentation? - [X] **Testing:** Perform manual tests to verify the implemented fix/feature works as intended AND does not break any other functionality. Take this as an opportunity to make screenshots of the feature/fix and include it in the PR description. - [X] **Agentic AI Code:**: Confirm this Pull Request is **not written by any AI Agent** or has at least gone through additional human review **and** manual testing. If any AI Agent is the co-author of this PR, it may lead to immediate closure of the PR. - [X] **Code review:** Have you performed a self-review of your code, addressing any coding standard issues and ensuring adherence to the project's coding standards? - [X] **Title Prefix:** To clearly categorize this pull request, prefix the pull request title using one of the following: - **BREAKING CHANGE**: Significant changes that may affect compatibility - **build**: Changes that affect the build system or external dependencies - **ci**: Changes to our continuous integration processes or workflows - **chore**: Refactor, cleanup, or other non-functional code changes - **docs**: Documentation update or addition - **feat**: Introduces a new feature or enhancement to the codebase - **fix**: Bug fix or error correction - **i18n**: Internationalization or localization changes - **perf**: Performance improvement - **refactor**: Code restructuring for better maintainability, readability, or scalability - **style**: Changes that do not affect the meaning of the code (white space, formatting, missing semi-colons, etc.) - **test**: Adding missing tests or correcting existing tests - **WIP**: Work in progress, a temporary label for incomplete or ongoing work # Changelog Entry ### Description - This pull request addresses a series of critical bugs related to creating, managing, and editing models with very long IDs. Previously, these actions would either fail silently or be impossible due to URL length limitations and missing backend validation. These changes ensure that all model management functions work correctly, regardless of ID length, and provide clear, user-facing error feedback. ### Added - **Backend Validation:** Added validation to the `createNewModel` and `importModels` endpoints to prevent the creation of new models with IDs longer than 255 characters. - **Error Notifications:** Implemented user-facing toast notifications on the frontend to display specific error messages when a model import or update fails due to backend validation (e.g., an ID being too long). ### Changed - **API Endpoint Methods:** The following API endpoints were modified to accept the model ID in the request body, avoiding issues with long URLs: - `GET` `/api/v1/models/model` was changed to `POST` `/api/v1/models/model`. - `DELETE` `/api/v1/models/model/delete` was changed to `POST` `/api/v1/models/model/delete`. - The `updateModelById` and `toggleModelById` endpoints were updated to get the ID from the request body. - **Edit Page Navigation:** The model edit page now uses the URL hash (#) to store and retrieve the model ID. This restores the ability to refresh the page or share a direct link while still supporting very long model IDs. ### Fixed - **Silent Import Failures:** Fixed a bug where creating or importing a model with a very long ID would fail silently without notifying the user. - **Long ID Management:** Fixed a bug that prevented deleting, updating, toggling, hiding, or showing models with very long IDs due to URL length limits. ### Breaking Changes - **BREAKING CHANGE**: The API endpoints for `getModelById`, `updateModelById`, `toggleModelById`, and `deleteModelById` have been modified to accept the model ID in the request body instead of as a URL query parameter. The HTTP method for `getModelById` was changed from `GET` to `POST`, and for `deleteModelById` from `DELETE` to `POST`. ### Additional Information - These changes address the issues reported in [GitHub Issue #18125](https://github.com/open-webui/open-webui/issues/18125). - A thorough review is definitely wanted here. Use this PR as a reference if its a must. ### Screenshots or Videos - [Attach any relevant screenshots or videos demonstrating the changes] ### Contributor License Agreement By submitting this pull request, I confirm that I have read and fully agree to the [Contributor License Agreement (CLA)](https://github.com/open-webui/open-webui/blob/main/CONTRIBUTOR_LICENSE_AGREEMENT), and I am providing my contributions under its terms. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-20 05:33:36 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#24716