Skip to content

Use OAuth fallback for workflow text generation#13537

Merged
abidlabs merged 1 commit into
workflow-api-endpointsfrom
fix/workflow-oauth-token
Jun 12, 2026
Merged

Use OAuth fallback for workflow text generation#13537
abidlabs merged 1 commit into
workflow-api-endpointsfrom
fix/workflow-oauth-token

Conversation

@abidlabs

Copy link
Copy Markdown
Member

Description

Fixes workflow text-generation calls so they only use browser-side streaming when the frontend has an HF token. If no frontend token is available, the workflow executor now falls back to the backend call_model path, where Gradio can inject the logged-in user's OAuth token and use their inference provider credits.

Also adds regression coverage that an empty manual token slot does not block OAuth or local write-token fallback on the backend.

Closes: #13536

AI Disclosure

  • I used AI to investigate the workflow OAuth/provider-token path, draft the code changes, and write this PR description. I self-reviewed the changed lines and ran the tests below.
  • I did not use AI

Testing and Formatting Your Code

  • pytest -q test/test_workflow.py -k ResolveToken
  • pnpm exec vitest run --config .config/vitest.config.ts js/workflowcanvas/workflow/workflow-executor.test.ts
  • bash scripts/format_backend.sh
  • bash scripts/format_frontend.sh

@abidlabs abidlabs merged commit c933605 into workflow-api-endpoints Jun 12, 2026
18 checks passed
@abidlabs abidlabs deleted the fix/workflow-oauth-token branch June 12, 2026 17:40
@gradio-pr-bot

gradio-pr-bot commented Jun 12, 2026

Copy link
Copy Markdown
Collaborator

🪼 branch checks and previews

Name Status URL
Spaces ready! Spaces preview
Storybook ready! Storybook preview

Install Gradio from this PR

pip install https://huggingface.co/buckets/gradio/pypi-previews/resolve/c933605e02a22f2976d340ff27e408715a436f8c/gradio-6.18.0-py3-none-any.whl

Install Gradio Python Client from this PR

pip install "gradio-client @ git+https://github.com/gradio-app/gradio@c933605e02a22f2976d340ff27e408715a436f8c#subdirectory=client/python"

Import Gradio JS Client from this PR via CDN

import { Client } from "https://huggingface.co/buckets/gradio/npm-previews/resolve/c933605e02a22f2976d340ff27e408715a436f8c/browser.js";

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