Skip to content

fix(pixel-gateway): strip trailing slashes on provider baseUrl when resolving completions target - #5872

Closed
vaibhavsrv wants to merge 1 commit into
Osmantic:public-betafrom
vaibhavsrv:fix/pixel-gateway-baseurl-trailing-slash
Closed

vaibhavsrv wants to merge 1 commit into
Osmantic:public-betafrom
vaibhavsrv:fix/pixel-gateway-baseurl-trailing-slash

Conversation

@vaibhavsrv

Copy link
Copy Markdown
Contributor

Why this matters

In ods/bin/pixel_provider/runtime_gateway.py, pinned_target() resolves the upstream provider URL by concatenating {parts.scheme}://{host}:{port}{parts.path}/chat/completions. When an operator or provider configuration supplies a baseUrl with a trailing slash (e.g. http://127.0.0.1:11434/v1/), parts.path retains the trailing slash (/v1/), producing a double slash in the endpoint path: /v1//chat/completions. Many strict OpenAI-compatible upstream gateways reject double slashes with HTTP 404 Not Found, causing provider attempts to fail unexpectedly.

This patch strips trailing slashes from parts.path prior to URL formatting, ensuring clean endpoint resolution regardless of whether baseUrl terminates with a trailing slash.

Validation

  • Repro baseline: Invoked pinned_target() with baseUrl="http://127.0.0.1:11434/v1/"; confirmed baseline generated http://127.0.0.1:11434/v1//chat/completions.
  • Post-fix: Verified test_pixel_gateway_trailing_slash.py passes with exit code 0; pinned_target() resolves to http://127.0.0.1:11434/v1/chat/completions for both trailing and non-trailing slash inputs.
  • Provider runtime suites: 1 passed. New-test Ruff and diff checks pass; new regressions wired into Linux CI.

Overlap check

Risk / AI disclosure

AI-assisted investigation, implementation and CLI regressions. This strengthens upstream URL path normalization in the provider runtime gateway, not tool execution or credentials. Independent human review and platform/runtime qualification remain gates. No running configuration, deployment or upstream merge changed.

Follow-up integration evidence

Composed with #5863 at 1de196a without conflicts. Production and test diffs passed together; pixel provider runtime and credential contracts remain intact.
Backlog composition was local-only (production/test diffs, excluding workflow/Makefile wiring); it is not an upstream merge or independent human approval. Declared live-review gates remain open.

@Lightheartdevs

Copy link
Copy Markdown
Collaborator

Thanks for this contribution. public-beta was promoted into main on 2026-09-24 and no longer receives changes, so we're closing pull requests that target it. This isn't a judgment on the change itself. If it's still needed, please rebase onto main and open a focused PR. See #7253 for details and the contribution policy.

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.

2 participants