A newer version of the Gradio SDK is available:
6.1.0
SPEC-22: Remove Unsupported gr.Progress from ChatInterface
Status: IMPLEMENTED Priority: P3 (Technical debt cleanup) Effort: 15 minutes PR Scope: Single file fix
Executive Summary
We are using gr.Progress() with gr.ChatInterface, but Gradio does not support this combination. This is not a workaround - this is the correct fix to align with Gradio's architecture.
Technical Background
Gradio's Progress Mechanisms
| Mechanism | Designed For | Works With ChatInterface |
|---|---|---|
gr.Progress() |
gr.Interface |
β NO - causes visual glitches |
show_progress param |
ChatInterface |
β YES - built-in spinner/timer |
| Streaming yields | ChatInterface |
β YES - native support |
ChatMessage.metadata.status |
ChatInterface |
β YES - per-message indicators |
Why gr.Progress Fails with ChatInterface
- GitHub Issue #5967: "gr.Progress is not integrated with ChatInterface or Chatbots" - closed without resolution (Jan 2024)
- Visual symptoms: Progress bar floats in middle of chat output, overlaps text
- Root cause:
gr.Progressinjects UI into the output component area, butChatInterfacemanages its own output rendering
What We Already Have (Working)
Our research_agent function already yields semantic status messages:
yield "π§ **Backend**: Paid API (OpenAI) | **Domain**: Sexual Health"
yield "β³ **Processing...** Searching PubMed, ClinicalTrials.gov..."
# During orchestration:
yield "β±οΈ **PROGRESS**: Round 1/5 (~3m 0s remaining)"
yield "π¬ **Step 2: SearchAgent** - Searching for evidence..."
yield "β
**COMPLETE**: Research finished"
These work perfectly with ChatInterface streaming.
The Fix
What to Remove
# src/app.py - REMOVE from research_agent signature:
progress: gr.Progress = gr.Progress(), # noqa: B008
# src/app.py - REMOVE all progress() calls:
progress(0, desc="Starting research...")
progress(0.1, desc="Multi-agent reasoning...")
progress(p, desc=event.message)
What to Add (Optional Enhancement)
# src/app.py - In create_demo(), add show_progress for built-in spinner:
demo = gr.ChatInterface(
fn=research_agent,
show_progress="full", # Shows spinner + runtime timer (Gradio native)
...
)
Why This Is The Correct Approach (Not A Workaround)
β What Would Be Over-Engineering
Refactoring from ChatInterface to gr.Blocks + gr.Chatbot just to support gr.Progress:
| ChatInterface provides FREE | gr.Blocks would require manual |
|---|---|
| MCP server support | Unknown if compatible |
| Chat history state | Manual gr.State management |
| Submit/Stop buttons | Manual button wiring |
| Example handling | Manual click handlers |
| Streaming support | Manual async iteration |
| Accordion for inputs | Manual accordion component |
Effort: Days of refactoring + testing Benefit: A progress bar (which we already have via emoji status) Verdict: Not justified
β What Is Professional Engineering
- Use
ChatInterfaceas designed (high-level, batteries-included) - Remove unsupported feature (
gr.Progress) - Rely on supported mechanisms:
- Streaming status yields (already implemented)
show_progress="full"(Gradio native)
Implementation Checklist
- Open
src/app.py - Remove
progress: gr.Progress = gr.Progress()fromresearch_agentsignature - Remove all
progress(...)calls fromresearch_agent - Add
show_progress="full"togr.ChatInterfaceconstructor - Verify emoji status yields still present in orchestrator events
- Run
make check - Test locally:
uv run python src/app.py
Verification
# Verify no gr.Progress usage in codebase
grep -rn "gr.Progress" src/
# Should return empty (no matches)
Manual Test
- Start app:
uv run python src/app.py - Submit a research query
- Verify:
- β Gradio spinner appears (top-right timer)
- β Emoji status messages stream in chat
- β No floating/overlapping progress bar
Acceptance Criteria
- No
gr.Progressin codebase show_progress="full"added to ChatInterface- Emoji status messages continue working
- No visual glitches in UI
make checkpasses