VibecoderMcSwaggins commited on
Commit
78ec52a
Β·
1 Parent(s): c6e9843

docs: Add P1 bug doc for HuggingFace Novita 500 error

Browse files

- New bug: Free tier fails due to HuggingFace routing Qwen to Novita
which is returning 500 Internal Server Error
- Same pattern as Llama/Hyperbolic issue we saw before
- Updated ACTIVE_BUGS.md with current status
- Marked repr bug as FIXED (PR #117 Accumulator Pattern)

Pausing for senior review before implementing fix.

docs/bugs/ACTIVE_BUGS.md CHANGED
@@ -1,34 +1,42 @@
1
  # Active Bugs
2
 
3
- > Last updated: 2025-12-01 (21:00 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
  > **See also:** [ARCHITECTURE.md](../ARCHITECTURE.md) for unified architecture plan
8
 
9
- ## P0 - Critical (BLOCKED)
10
 
11
- ### Free Tier Broken (Upstream #2562)
12
 
13
- **Issue:** [#105](https://github.com/The-Obstacle-Is-The-Way/DeepBoner/issues/105), [#113](https://github.com/The-Obstacle-Is-The-Way/DeepBoner/issues/113)
14
- **Status:** BLOCKED - Waiting for upstream PR #2566
15
 
16
- **Problem:** Free tier (Advanced Mode + HuggingFace) shows repr garbage output.
17
 
18
- **Cause:** Microsoft Agent Framework upstream bug #2562.
19
 
20
- **Fix:** Upstream PR #2566 will fix this. Once merged:
21
- 1. Update `agent-framework` dependency
22
- 2. Verify Advanced + HuggingFace works
23
- 3. Unified architecture complete
24
-
25
- **Architecture Note:** We have ONE unified architecture. `simple.py` is deleted.
26
- Simple Mode behavior is INTEGRATED via `HuggingFaceChatClient`, not a parallel orchestrator.
27
 
28
  ---
29
 
30
  ## Resolved Bugs
31
 
 
 
 
 
 
 
 
 
 
 
 
32
  ### ~~P0 - AIFunction Not JSON Serializable~~ FIXED
33
 
34
  **File:** `docs/bugs/P0_AIFUNCTION_NOT_JSON_SERIALIZABLE.md`
 
1
  # Active Bugs
2
 
3
+ > Last updated: 2025-12-02 (07:30 EST)
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
  > **See also:** [ARCHITECTURE.md](../ARCHITECTURE.md) for unified architecture plan
8
 
9
+ ## P1 - High (ACTIVE)
10
 
11
+ ### HuggingFace Novita Provider 500 Error
12
 
13
+ **File:** `docs/bugs/P1_HUGGINGFACE_NOVITA_500_ERROR.md`
14
+ **Status:** ACTIVE - Upstream Infrastructure Issue
15
 
16
+ **Problem:** Free tier (no API key) fails with 500 error from Novita provider.
17
 
18
+ **Cause:** HuggingFace routes Qwen/Qwen2.5-72B-Instruct to Novita (third-party), and Novita is returning 500 errors.
19
 
20
+ **Fix Options:**
21
+ 1. Switch to a model hosted natively by HuggingFace
22
+ 2. Implement fallback model logic
23
+ 3. Wait for Novita to fix their infrastructure
 
 
 
24
 
25
  ---
26
 
27
  ## Resolved Bugs
28
 
29
+ ### ~~P0 - Repr Bug (Display Garbage)~~ FIXED
30
+
31
+ **File:** `P0_REPR_BUG_ROOT_CAUSE_ANALYSIS.md`, `docs/specs/SPEC_17_ACCUMULATOR_PATTERN.md`
32
+ **Found:** 2025-12-01
33
+ **Resolved:** 2025-12-02 (PR #117)
34
+
35
+ - Problem: Free tier showed `<agent_framework._types.ChatMessage object at 0x...>` instead of text
36
+ - Root Cause: We were using API incorrectly - reading from `MagenticAgentMessageEvent.message` instead of `MagenticAgentDeltaEvent.text`
37
+ - Fix: Implemented **Accumulator Pattern** (SPEC-17) - bypasses the upstream bug by using the API correctly
38
+ - Note: Upstream fix (PR #2566) is now moot - we don't need it anymore
39
+
40
  ### ~~P0 - AIFunction Not JSON Serializable~~ FIXED
41
 
42
  **File:** `docs/bugs/P0_AIFUNCTION_NOT_JSON_SERIALIZABLE.md`
docs/bugs/P1_HUGGINGFACE_NOVITA_500_ERROR.md ADDED
@@ -0,0 +1,133 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # P1 BUG: HuggingFace Router 500 Error via Novita Provider
2
+
3
+ **Status**: ACTIVE - Upstream Infrastructure Issue
4
+ **Priority**: P1 (Free Tier Broken)
5
+ **Discovered**: 2025-12-02
6
+ **Related**: CLAUDE.md (Llama/Hyperbolic issue)
7
+
8
+ ---
9
+
10
+ ## Symptom
11
+
12
+ ```
13
+ ❌ **ERROR**: Workflow error: 500 Server Error: Internal Server Error for url:
14
+ https://router.huggingface.co/novita/v3/openai/chat/completions
15
+ ```
16
+
17
+ Free tier users (no API key) cannot use the system.
18
+
19
+ ---
20
+
21
+ ## Stack Trace
22
+
23
+ ```text
24
+ User (no API key)
25
+ ↓
26
+ src/clients/factory.py:get_chat_client()
27
+ ↓
28
+ src/clients/huggingface.py:HuggingFaceChatClient
29
+ ↓
30
+ Model: Qwen/Qwen2.5-72B-Instruct (from config.py)
31
+ ↓
32
+ huggingface_hub.InferenceClient
33
+ ↓
34
+ HuggingFace Router: router.huggingface.co
35
+ ↓
36
+ Routes to: NOVITA (third-party inference provider)
37
+ ↓
38
+ ❌ Novita returns 500 Internal Server Error
39
+ ```
40
+
41
+ ---
42
+
43
+ ## Root Cause
44
+
45
+ **HuggingFace doesn't host all models directly.** For some models, they route to third-party inference providers:
46
+
47
+ | Model | Provider | Status |
48
+ |-------|----------|--------|
49
+ | Llama-3.1-70B | Hyperbolic | ❌ "staging mode" auth issues |
50
+ | Qwen2.5-72B | Novita | ❌ 500 Internal Server Error |
51
+
52
+ We switched from Llama to Qwen specifically to avoid Hyperbolic's issues. Now Novita is having its own problems.
53
+
54
+ **This is an upstream infrastructure issue - not a bug in our code.**
55
+
56
+ ---
57
+
58
+ ## Evidence
59
+
60
+ From the error URL:
61
+ ```
62
+ https://router.huggingface.co/novita/v3/openai/chat/completions
63
+ ^^^^^^
64
+ Third-party provider in URL path
65
+ ```
66
+
67
+ ---
68
+
69
+ ## Potential Fixes
70
+
71
+ ### Option 1: Try a Different Model (Quick)
72
+ Find a model that HuggingFace hosts natively (not routed to partners):
73
+
74
+ ```python
75
+ # Candidates to test:
76
+ # - mistralai/Mistral-7B-Instruct-v0.3
77
+ # - microsoft/Phi-3-mini-4k-instruct
78
+ # - google/gemma-2-9b-it
79
+ ```
80
+
81
+ ### Option 2: Add Fallback Logic (Robust)
82
+ ```python
83
+ FALLBACK_MODELS = [
84
+ "Qwen/Qwen2.5-72B-Instruct",
85
+ "mistralai/Mistral-7B-Instruct-v0.3",
86
+ "microsoft/Phi-3-mini-4k-instruct",
87
+ ]
88
+
89
+ async def get_response_with_fallback(...):
90
+ for model in FALLBACK_MODELS:
91
+ try:
92
+ return await client.chat_completion(model=model, ...)
93
+ except HfHubHTTPError as e:
94
+ if e.status_code == 500:
95
+ continue
96
+ raise
97
+ raise AllModelsFailedError()
98
+ ```
99
+
100
+ ### Option 3: Wait for Novita Fix (Passive)
101
+ 500 errors are typically transient. Novita may fix their infrastructure.
102
+
103
+ ---
104
+
105
+ ## Verification
106
+
107
+ To check if issue is resolved:
108
+ ```bash
109
+ curl -X POST "https://router.huggingface.co/novita/v3/openai/chat/completions" \
110
+ -H "Authorization: Bearer $HF_TOKEN" \
111
+ -H "Content-Type: application/json" \
112
+ -d '{"model": "Qwen/Qwen2.5-72B-Instruct", "messages": [{"role": "user", "content": "hi"}]}'
113
+ ```
114
+
115
+ ---
116
+
117
+ ## Historical Context
118
+
119
+ From `CLAUDE.md`:
120
+ ```
121
+ - **HuggingFace (Free Tier):** `Qwen/Qwen2.5-72B-Instruct`
122
+ - Changed from Llama-3.1-70B (Dec 2025) due to HuggingFace routing Llama
123
+ to Hyperbolic provider which has unreliable "staging mode" auth.
124
+ ```
125
+
126
+ Now Qwen is being routed to Novita, continuing the pattern of unreliable third-party routing.
127
+
128
+ ---
129
+
130
+ ## Recommendation
131
+
132
+ **Short-term**: Switch to a model hosted natively by HuggingFace (test candidates above)
133
+ **Long-term**: Implement fallback model logic to handle provider outages gracefully