VibecoderMcSwaggins commited on
Commit
e324277
·
1 Parent(s): 3f60cec

docs: Add P3 progress bar bug + mark P1 HF 401 as resolved

Browse files
docs/bugs/ACTIVE_BUGS.md CHANGED
@@ -1,31 +1,23 @@
1
  # Active Bugs
2
 
3
- > Last updated: 2025-12-01 (14:30 PST)
4
  >
5
  > **Note:** Completed bug docs archived to `docs/bugs/archive/`
6
  > **See also:** [Code Quality Audit Findings (2025-11-30)](AUDIT_FINDINGS_2025_11_30.md)
7
 
8
- ## P1 - Important
9
 
10
- ### P1 - HuggingFace Router 401 Unauthorized (Hyperbolic)
11
- **File:** `docs/bugs/P1_HUGGINGFACE_ROUTER_401_HYPERBOLIC.md`
12
  **Found:** 2025-12-01 (HuggingFace Spaces)
13
 
14
- **Problem:** HuggingFace changed their Inference API infrastructure. Large models like `meta-llama/Llama-3.1-70B-Instruct` are now routed to partner provider "Hyperbolic" which requires authentication even for previously "free" models.
15
-
16
- **Error:**
17
- ```
18
- 401 Client Error: Unauthorized for url:
19
- https://router.huggingface.co/hyperbolic/v1/chat/completions
20
- ```
21
 
22
- **Impact:** Free Tier (no API key) is **COMPLETELY BROKEN**.
 
 
23
 
24
- **Root Cause:** NOT our code. HuggingFace infrastructure change:
25
- - Old: `api-inference.huggingface.co` (deprecated)
26
- - New: `router.huggingface.co/{provider}/...` (routes to partners)
27
-
28
- **Proposed Fix:** Add `HF_TOKEN` as a secret in HuggingFace Spaces settings, OR switch to a smaller model that's still on HF native infrastructure.
29
 
30
  ---
31
 
@@ -67,6 +59,16 @@ https://router.huggingface.co/hyperbolic/v1/chat/completions
67
 
68
  ## Resolved Bugs
69
 
 
 
 
 
 
 
 
 
 
 
70
  ### ~~P0 - Simple Mode Ignores Forced Synthesis~~ FIXED
71
  **File:** `docs/bugs/P0_SIMPLE_MODE_FORCED_SYNTHESIS_BYPASS.md`
72
  **Issue:** [#113](https://github.com/The-Obstacle-Is-The-Way/DeepBoner/issues/113)
 
1
  # Active Bugs
2
 
3
+ > Last updated: 2025-12-01 (16:15 PST)
4
  >
5
  > **Note:** Completed bug docs archived to `docs/bugs/archive/`
6
  > **See also:** [Code Quality Audit Findings (2025-11-30)](AUDIT_FINDINGS_2025_11_30.md)
7
 
8
+ ## P3 - UX Polish
9
 
10
+ ### P3 - Progress Bar Positioning/Overlap in ChatInterface
11
+ **File:** `docs/bugs/P3_PROGRESS_BAR_POSITIONING.md`
12
  **Found:** 2025-12-01 (HuggingFace Spaces)
13
 
14
+ **Problem:** `gr.Progress()` bar renders in strange position inside ChatInterface - floats mid-chat, overlaps text.
 
 
 
 
 
 
15
 
16
+ **Root Cause:** Mixing two progress mechanisms:
17
+ 1. `gr.Progress()` - general purpose, not designed for ChatInterface
18
+ 2. `ChatInterface.show_progress` - built-in chat progress
19
 
20
+ **Recommended Fix:** Remove `gr.Progress()`, rely on emoji status text we already emit. Low priority - UX polish only.
 
 
 
 
21
 
22
  ---
23
 
 
59
 
60
  ## Resolved Bugs
61
 
62
+ ### ~~P1 - HuggingFace Router 401 Unauthorized~~ FIXED
63
+ **File:** `docs/bugs/P1_HUGGINGFACE_ROUTER_401_HYPERBOLIC.md`
64
+ **Found:** 2025-12-01
65
+ **Resolved:** 2025-12-01
66
+
67
+ - Problem: 401 errors from HuggingFace Router (Hyperbolic/Novita providers)
68
+ - **Actual Root Cause:** HF_TOKEN in `.env` and Spaces secrets was **invalid/expired**
69
+ - Fix: Generated new valid HF_TOKEN, updated `.env` and Spaces secrets
70
+ - Also switched default model to `Qwen/Qwen2.5-72B-Instruct` for better reliability
71
+
72
  ### ~~P0 - Simple Mode Ignores Forced Synthesis~~ FIXED
73
  **File:** `docs/bugs/P0_SIMPLE_MODE_FORCED_SYNTHESIS_BYPASS.md`
74
  **Issue:** [#113](https://github.com/The-Obstacle-Is-The-Way/DeepBoner/issues/113)
docs/bugs/P3_PROGRESS_BAR_POSITIONING.md ADDED
@@ -0,0 +1,201 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # P3 Bug: Progress Bar Positioning/Overlap in ChatInterface
2
+
3
+ **Severity**: P3 (Low - UX polish)
4
+ **Status**: Open
5
+ **Discovered**: 2025-12-01
6
+ **Reporter**: Internal QA
7
+
8
+ ## Symptom
9
+
10
+ The `gr.Progress()` bar renders in a strange position when used inside `ChatInterface`:
11
+ - Progress bar appears to "float" in the middle of the chat output
12
+ - Text overlaps with progress bar elements
13
+ - Bar appears static/stuck at certain percentages
14
+ - Visual artifact: `Round 2/5 (~2m 15s remaining) - 48.0%` renders both above and inside bar
15
+
16
+ ## Screenshot Evidence
17
+
18
+ Progress bar appears inline between chat messages rather than in a fixed position (top/bottom of component).
19
+
20
+ ## Root Cause Analysis
21
+
22
+ ### The Conflict
23
+
24
+ We're mixing **two different progress mechanisms**:
25
+
26
+ 1. **`gr.Progress()`** - Gradio's general-purpose progress bar API
27
+ - Designed for `gr.Interface` and `gr.Blocks` functions
28
+ - Renders as an overlay on the output component
29
+
30
+ 2. **`ChatInterface.show_progress`** - Built-in chat progress
31
+ - Options: `"full"`, `"minimal"`, `"hidden"`
32
+ - `"full"` = spinner + runtime display
33
+ - `"minimal"` = runtime display only (default)
34
+
35
+ When both are used together in `ChatInterface`, the `gr.Progress()` bar fights for position with the chat's streaming output, causing visual glitches.
36
+
37
+ ### Current Implementation (`src/app.py`)
38
+
39
+ ```python
40
+ async def research_agent(
41
+ message: str,
42
+ history: list[dict[str, Any]],
43
+ ...
44
+ progress: gr.Progress = gr.Progress(), # <- ISSUE: Manual progress bar
45
+ ) -> AsyncGenerator[str, None]:
46
+ ...
47
+ if event.type == "started":
48
+ progress(0, desc="Starting research...") # <- Updates overlay
49
+ elif event.type == "progress":
50
+ progress(p, desc=event.message) # <- Conflicts with chat streaming
51
+ ```
52
+
53
+ ### Gradio Documentation
54
+
55
+ From [Gradio ChatInterface Docs](https://www.gradio.app/docs/gradio/chatinterface):
56
+
57
+ > `show_progress`: how to show the progress animation while event is running: 'full' shows a spinner which covers the output component area as well as a runtime display in the upper right corner, 'minimal' only shows the runtime display, 'hidden' shows no progress animation at all
58
+
59
+ From [GitHub Issue #5967](https://github.com/gradio-app/gradio/issues/5967):
60
+
61
+ > `gr.Progress` is "not integrated with ChatInterface or Chatbots" - known limitation.
62
+
63
+ ## Impact
64
+
65
+ | Aspect | Impact |
66
+ |--------|--------|
67
+ | Functionality | None - app works correctly |
68
+ | UX | Visual confusion, looks unprofessional |
69
+ | Accessibility | May cause screen reader confusion |
70
+
71
+ ## Proposed Solutions
72
+
73
+ ### Option 1: Remove `gr.Progress()` - Use Chat Text Only (RECOMMENDED)
74
+
75
+ Remove the `gr.Progress()` parameter entirely and rely on our existing emoji status messages:
76
+
77
+ ```python
78
+ async def research_agent(
79
+ message: str,
80
+ history: list[dict[str, Any]],
81
+ domain: str = "sexual_health",
82
+ api_key: str = "",
83
+ api_key_state: str = "",
84
+ # REMOVED: progress: gr.Progress = gr.Progress(),
85
+ ) -> AsyncGenerator[str, None]:
86
+ ...
87
+ # Keep emoji status updates in chat output
88
+ # ⏱️ **PROGRESS**: Round 1/5 (~3m 0s remaining)
89
+ # These are already being yielded to the chat
90
+ ```
91
+
92
+ **Pros**:
93
+ - Simplest solution
94
+ - No CSS hacks
95
+ - Status is visible in chat history
96
+ - Works with ChatInterface's built-in progress
97
+
98
+ **Cons**:
99
+ - No visual progress bar (just text status)
100
+
101
+ ### Option 2: Use `show_progress="full"` Parameter
102
+
103
+ Add explicit `show_progress` to ChatInterface and remove `gr.Progress()`:
104
+
105
+ ```python
106
+ demo = gr.ChatInterface(
107
+ fn=research_agent,
108
+ title="🍆 DeepBoner",
109
+ show_progress="full", # Built-in spinner + runtime
110
+ ...
111
+ )
112
+ ```
113
+
114
+ **Pros**:
115
+ - Uses Gradio's intended mechanism
116
+ - Consistent with Gradio UX patterns
117
+
118
+ **Cons**:
119
+ - Less granular (no percentage, no custom desc)
120
+
121
+ ### Option 3: Custom Progress Component with CSS (COMPLEX)
122
+
123
+ Wrap ChatInterface in `gr.Blocks` and add a separate `gr.HTML` progress bar outside the chat:
124
+
125
+ ```python
126
+ with gr.Blocks() as demo:
127
+ progress_html = gr.HTML("<div id='custom-progress'></div>", visible=False)
128
+ chat = gr.ChatInterface(...)
129
+
130
+ # Update progress_html separately from chat
131
+ ```
132
+
133
+ **Pros**:
134
+ - Full control over positioning
135
+ - Can match exact design requirements
136
+
137
+ **Cons**:
138
+ - Significant refactor required
139
+ - May break MCP server integration
140
+ - More moving parts = more bugs
141
+
142
+ ### Option 4: Hybrid - Progress in `additional_inputs_accordion`
143
+
144
+ Place a separate `gr.Progress` component in a fixed position (e.g., accordion header):
145
+
146
+ ```python
147
+ with gr.Blocks() as demo:
148
+ with gr.Row():
149
+ progress_bar = gr.Slider(0, 100, value=0, label="Progress", interactive=False)
150
+ chat = gr.ChatInterface(...)
151
+ ```
152
+
153
+ **Pros**:
154
+ - Fixed position, no overlap
155
+
156
+ **Cons**:
157
+ - Requires `gr.Blocks` wrapper (breaks MCP?)
158
+ - Clunky UX
159
+
160
+ ## Recommended Fix
161
+
162
+ **Option 1: Remove `gr.Progress()`, keep emoji status text**
163
+
164
+ Rationale:
165
+ 1. Our emoji status updates (`⏱️ **PROGRESS**: Round 2/5`) already provide the information
166
+ 2. `gr.Progress()` was never designed for ChatInterface
167
+ 3. Removing it eliminates the positioning conflict entirely
168
+ 4. ChatInterface's built-in `show_progress="minimal"` handles the spinner
169
+
170
+ ## Implementation Plan
171
+
172
+ 1. **Remove** `progress: gr.Progress = gr.Progress()` parameter from `research_agent()`
173
+ 2. **Remove** all `progress(...)` calls in the function
174
+ 3. **Keep** emoji status yields (`⏱️ **PROGRESS**: ...`)
175
+ 4. **Optionally** add `show_progress="minimal"` to ChatInterface (already default)
176
+ 5. **Test** on HuggingFace Spaces
177
+
178
+ ## Testing
179
+
180
+ ```bash
181
+ # Local test
182
+ uv run python -c "from src.app import create_demo; demo, _ = create_demo(); demo.launch()"
183
+
184
+ # Verify:
185
+ # 1. No floating progress bar
186
+ # 2. Emoji status updates visible in chat
187
+ # 3. ChatInterface spinner works as expected
188
+ ```
189
+
190
+ ## References
191
+
192
+ - [Gradio Progress Bars Guide](https://www.gradio.app/guides/progress-bars)
193
+ - [Gradio ChatInterface Docs](https://www.gradio.app/docs/gradio/chatinterface)
194
+ - [GitHub Issue #5967: Progress bar for ChatInterface](https://github.com/gradio-app/gradio/issues/5967)
195
+ - [GitHub Issue #5815: Customize the progress bar](https://github.com/gradio-app/gradio/issues/5815)
196
+
197
+ ## Version Info
198
+
199
+ - Gradio: `>=6.0.0` (pyproject.toml constraint)
200
+ - ChatInterface: Streaming async generator mode
201
+ - MCP Server: Enabled