Commit 0472509
Fix empty provider in all endpoints + add 28 regression tests
The previous fix only covered websocket_wiki.py, but the same empty
provider bug existed in simple_chat.py (HTTP fallback) and in the
frontend's generatePageContent/regeneratePage functions. When WebSocket
page generation failed and fell back to HTTP, simple_chat.py crashed
with the same "Configuration for provider '' not found" error.
Fixes:
- api/simple_chat.py: add same default provider fallback as websocket
- useWikiGeneration.ts: resolve provider in generatePageContent and
regeneratePage (not just determineWikiStructure)
Tests (28 new):
- Provider fallback: empty string, missing, explicit, invalid
- Config: get_model_config with empty/invalid/default providers
- Diagram schema: backward compat with/without new fields
- Diagram extraction: simplified source, validation, malformed JSON,
multiple blocks, no markers
- Wiki structure parser: XML, JSON, code-fenced, unescaped ampersands,
sections, wrapped JSON, empty/garbage input
- Mermaid node counting: flowcharts, keyword exclusion, empty source
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1 parent 040f798 commit 0472509
3 files changed
Lines changed: 509 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
80 | 88 | | |
81 | 89 | | |
82 | 90 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
154 | 154 | | |
155 | 155 | | |
156 | 156 | | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
157 | 173 | | |
158 | 174 | | |
159 | 175 | | |
| |||
313 | 329 | | |
314 | 330 | | |
315 | 331 | | |
316 | | - | |
| 332 | + | |
317 | 333 | | |
318 | 334 | | |
319 | 335 | | |
| |||
1042 | 1058 | | |
1043 | 1059 | | |
1044 | 1060 | | |
| 1061 | + | |
| 1062 | + | |
| 1063 | + | |
| 1064 | + | |
| 1065 | + | |
| 1066 | + | |
| 1067 | + | |
| 1068 | + | |
| 1069 | + | |
| 1070 | + | |
| 1071 | + | |
| 1072 | + | |
| 1073 | + | |
| 1074 | + | |
| 1075 | + | |
| 1076 | + | |
1045 | 1077 | | |
1046 | 1078 | | |
1047 | 1079 | | |
| |||
1051 | 1083 | | |
1052 | 1084 | | |
1053 | 1085 | | |
1054 | | - | |
| 1086 | + | |
1055 | 1087 | | |
1056 | 1088 | | |
1057 | 1089 | | |
| |||
0 commit comments