Bound doctor diagnostics within client timeout - #729
Draft
brynary wants to merge 1 commit into
Draft
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR bounds the server “doctor/diagnostics” work so it reliably completes within the existing client deadline, returning a structured 504 when diagnostics exceed a capped duration, while still providing per-provider timeout results for external probes.
Changes:
- Added a server-side timeout wrapper for the diagnostics handler to return a structured
504 Gateway Timeoutresponse. - Capped external diagnostic probes (e.g., LLM providers, GitHub, Brave, Daytona) to 15s and Docker to 5s, with provider-specific timeout outcomes.
- Documented the new
504response for diagnostics in the OpenAPI spec and added unit tests covering timeout behavior.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| lib/apps/fabro-server/src/server/handler/system.rs | Wraps the diagnostics handler with a 25s timeout and returns a structured 504 on timeout; adds a test for the timeout response shape. |
| lib/apps/fabro-server/src/diagnostics.rs | Introduces shared timeout constants and applies them across external probes; adds helper(s) + tests for timeout reporting. |
| docs/public/api-reference/fabro-api.yaml | Documents the diagnostics 504 timeout response in OpenAPI. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
258
to
+262
| let model_id = model.id.clone(); | ||
|
|
||
| let outcome = run_basic_model_probe(model_id.as_str(), &provider, client).await; | ||
| let outcome = run_basic_model_probe(model_id.as_str(), provider.clone(), client); | ||
| provider_probe_with_timeout( | ||
| provider, |
Comment on lines
+691
to
694
| diagnostics_response_with_timeout( | ||
| Box::pin(diagnostics::run_all(state.as_ref())), | ||
| SERVER_DIAGNOSTICS_TIMEOUT, | ||
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Test plan
Security