Skip to content
This repository was archived by the owner on Nov 3, 2026. It is now read-only.
This repository was archived by the owner on Nov 3, 2026. It is now read-only.

[Question] Thread History when using API Passthrough #119

Open

Description

Hi, I noticed after setting up my env variables to test the API Passthrough, my Thread History in sidebar is now empty and appears to stay empty. Is this expected?

Activity

  1. bracesproul commented on Apr 28, 2025

    @bracesproul
    Member

    Hi, I noticed after setting up my env variables to test the API Passthrough, my Thread History in sidebar is now empty and appears to stay empty. Is this expected?

    Austin Welch (@austinmw) are you seeing any errors?

  2. yasinahmadpoor commented on Jun 9, 2025

    @yasinahmadpoor

    I have same problem

  3. eliasbiondo commented on Jun 9, 2025

    @eliasbiondo

    Same problem here. I'll try to fix it.

  4. eliasbiondo commented on Jun 9, 2025

    @eliasbiondo

    The current implementation of ThreadProvider uses useQueryState to retrieve apiUrl and assistantId:

    const [apiUrl] = useQueryState("apiUrl");
    const [assistantId] = useQueryState("assistantId");

    This approach breaks when using environment variables to configure the API, as the parameters are no longer included in the URL.

    Solution

    Replace useQueryState with direct access to environment variables:

    const apiUrl = process.env.NEXT_PUBLIC_API_URL;
    const assistantId = process.env.NEXT_PUBLIC_ASSISTANT_ID;

    Brace Sproul (@bracesproul) yasin ahmadpoor (@yasinahmadpoor) chatrtham Austin Welch (@austinmw)

  5. beepsoft commented on Aug 4, 2025

    @beepsoft

    Solution

    Replace useQueryState with direct access to environment variables:

    const apiUrl = process.env.NEXT_PUBLIC_API_URL;
    const assistantId = process.env.NEXT_PUBLIC_ASSISTANT_ID;
    @bracesproul @yasinahmadpoor @chatrtham @austinmw

    Or the workaround until it gets fixed is to add the apiUrl and assistantId to the URL by hand

    http://localhost:3000/?apiUrl=http://localhost:2024&assistantId=agent

    Elias Biondo (@eliasbiondo), can you maybe submit a PR with your fix?

  6. muralidhar-challa commented on Sep 12, 2025

    @muralidhar-challa

    Root Cause Found & Fix Available

    I've identified the root cause of this issue and have a working fix.

    Problem: The ThreadProvider in src/providers/Thread.tsx doesn't fall back to environment variables like the StreamProvider does.

    • StreamProvider correctly uses: useQueryState("apiUrl", { defaultValue: envApiUrl || "" })
    • ThreadProvider only uses: useQueryState("apiUrl") (no fallback)

    This causes thread history to only work with query parameters, not environment variables.

    Fix: Make ThreadProvider consistent with StreamProvider by adding environment variable fallbacks.

    Impact: This affects anyone using environment variables, including API Passthrough users, Docker deployments, and production setups.

    I'll submit a PR with the fix shortly.

  7. added a commit that references this issue on Sep 12, 2025
    ee68192
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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