Skip to content

Conversation

@bebestmaple
Copy link

No description provided.

Copilot AI review requested due to automatic review settings January 6, 2026 05:55
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a critical bug in URL processing where rstrip('/v1') was incorrectly used to remove the /v1 suffix from base URLs. The issue is that rstrip() treats its argument as a set of characters to remove, not as a complete suffix, which could lead to incorrect URL manipulation (e.g., removing multiple 'v' and '1' characters).

Key Changes:

  • Replaced .rstrip('/').rstrip('/v1') with a proper suffix check using .endswith('/v1') followed by string slicing [:-3]
  • Applied the fix consistently across three locations: text client initialization and two API testing functions

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
backend/utils/text_client.py Fixed base_url processing in TextChatClient initialization to correctly remove '/v1' suffix
backend/routes/config_routes.py Fixed base_url processing in _test_openai_compatible() and _test_image_api() functions to correctly handle '/v1' suffix removal

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant