Skip to content

bug: __request__ not being passed into pipeline #596

@jayteaftw

Description

@jayteaftw

Check Existing Issues

  • I have searched for any existing and/or related issues.
  • I have searched for any existing and/or related discussions.
  • I have also searched in the CLOSED issues AND CLOSED discussions and found no related items (your issue might already be addressed on the development branch!).
  • I am using the latest version of Open WebUI.

Installation Method

Docker

Open WebUI Version

v0.8.10

Ollama Version (if applicable)

No response

Operating System

macOs

Browser (if applicable)

No response

Confirmation

  • I have read and followed all instructions in README.md.
  • I am using the latest version of both Open WebUI and Ollama.
  • I have included the browser console logs.
  • I have included the Docker container logs.
  • I have provided every relevant configuration, setting, and environment variable used in my setup.
  • I have clearly listed every relevant configuration, custom setting, environment variable, and command-line option that influences my setup (such as Docker Compose overrides, .env values, browser settings, authentication configurations, etc).
  • I have documented step-by-step reproduction instructions that are precise, sequential, and leave nothing to interpretation. My steps:
  • Start with the initial platform/version/OS and dependencies used,
  • Specify exact install/launch/configure commands,
  • List URLs visited, user input (incl. example values/emails/passwords if needed),
  • Describe all options and toggles enabled or changed,
  • Include any files or environmental changes,
  • Identify the expected and actual result at each stage,
  • Ensure any reasonably skilled user can follow and hit the same issue.

Expected Behavior

When sending a request to a connected pipeline using the Oauth or session authentication setting, I expect the the request value inside of

 def pipe(
        self, user_message: str, model_id: str, messages: List[dict], body: dict, __request__: Request = None, 
    ): # -> Union[str, Generator, Iterator]:
        print(f"{__request__ = }")

        yield {"event": {"type": "message", "data": {"content": "the answer was always 4"}}}

as shown in the docs

Actual Behavior

When I send a request to the pipeline and look at the logs, request is None.

INFO:root:stream:false:<generator object Pipeline.pipe at 0xffff7d3b8540>

INFO:root:stream:false:{'event': {'type': 'message', 'data': {'content': 'the answer was always 4'}}}

__request__ = None

INFO:     172.217.165.202:41529 - "POST /chat/completions HTTP/1.1" 200 OK

Steps to Reproduce

  1. Set up an Open Webui instance. I used docker and ensure ENABLE_FORWARD_USER_INFO_HEADERS=True
  2. Create a pipeline and host it through an endpoint
from starlette.requests import Request
from pydantic import BaseModel

class Pipeline:
    class Valves(BaseModel):
        pass

    def __init__(self):
        self.valves = self.Valves()

    def pipe(
        self, user_message: str, model_id: str, messages: list[dict], body: dict, __request__: Request = None, 
    ): 
        print(f"{__request__ = }")
        yield {"event": {"type": "message", "data": {"content": "the answer was always 4"}}}
  1. Make the connection to between the Open Webui instance and pipeline and set the Authentication setting to Oauth or Session.

Logs & Screenshots

Image

Additional Information

A version of someone doing this has been documented here which was posted Augusted 25th 2025 which means this worked for some version of open webui before v0.6.25

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions