Commit d3376ee
committed
fix(dashboard): bypass system proxy in embedding probe + surface cause chain
Two related fixes to the `test_embedding_endpoint` Tauri command so the
dashboard probe matches doctor's behavior and surfaces actionable error
messages.
**1. `.no_proxy()` on the reqwest client.**
reqwest auto-detects macOS/Windows system proxy settings by default,
which produces a surprising failure mode where `doctor` (Node fetch) and
the dashboard (Rust reqwest) classify the same endpoint differently.
Doctor's fetch only honors `HTTP_PROXY`/`HTTPS_PROXY` env vars; the
dashboard tries to route the same `http://localhost:1234/v1` URL through
whatever the user has configured in System Settings → Network → Proxies,
which often refuses or fails for localhost endpoints even when a system
proxy bypass list exists. Setting `.no_proxy()` aligns the dashboard
probe with Node fetch so users get the same outcome from both tools.
Users who genuinely want to route embedding traffic through a proxy can
expose that as an explicit config field later.
**2. Walk the reqwest error cause chain.**
reqwest's `Display` only renders the top-level message
(`error sending request for url (...)`) and drops the underlying cause.
Users hit "Connection failed: error sending request for url
(http://localhost:1234/v1/embeddings)" with no clue whether it was DNS,
connection refused, TLS handshake, or proxy refusal. New
`format_error_with_causes()` walks `error.source()` (capped at 5 levels
for safety), de-duplicates immediately-repeated messages, and joins with
": ". Users now see e.g.:
error sending request for url (http://localhost:1234/v1/embeddings):
client error (Connect): Connection refused (os error 61)
instead of just the URL.
Adds 3 rust tests covering the formatter against a `ChainErr` mock
(joins/single-level/dedup). cargo check + 20/20 embedding_probe tests
green.1 parent 49558f4 commit d3376ee
1 file changed
Lines changed: 107 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
199 | 199 | | |
200 | 200 | | |
201 | 201 | | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
202 | 212 | | |
203 | 213 | | |
| 214 | + | |
204 | 215 | | |
205 | 216 | | |
206 | 217 | | |
| |||
240 | 251 | | |
241 | 252 | | |
242 | 253 | | |
243 | | - | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
244 | 260 | | |
245 | 261 | | |
246 | 262 | | |
| |||
309 | 325 | | |
310 | 326 | | |
311 | 327 | | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
312 | 354 | | |
313 | 355 | | |
314 | 356 | | |
| |||
469 | 511 | | |
470 | 512 | | |
471 | 513 | | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
472 | 578 | | |
473 | 579 | | |
474 | 580 | | |
| |||
0 commit comments