fix(doctor): stop three readiness probes leaking non-fatal errors to console#351
Merged
Conversation
…console
- LLM judge: normalize the Foundry project OpenAI client to the /openai/v1/
route (clearing the injected api-version) so chat completions stop returning
HTTP 404. Reuses the same credential/token refresh; non-Foundry endpoints are
left unchanged.
- OpenAI data-plane RBAC check: send the supported assignedTo('<oid>') ARM
filter instead of the combined atScopeAndAbove()+assignedTo() form that ARM
rejects with UnsupportedQuery. assignedTo alone already covers scope plus
ancestor scopes.
- App Insights probe: catch OSError (covers socket.timeout, which is not a
URLError) and raise the request timeout from 10s to 30s, so a slow App
Insights degrades quietly instead of printing a non-fatal INFO line.
Adds unit coverage for the OpenAI client normalization, the corrected RBAC
filter, and the App Insights timeout/URLError degrade-to-None path.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: af408082-0971-42ea-828c-8155d4110101
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.
What
agentops doctorwas leaking three low-level, non-fatal probe errors straight to the console during readiness checks. Each probe already degrades gracefully; only the reporting was noisy. This stops all three from printing.1. LLM judge -> HTTP 404
WARNING: llm_assist: judge call failed: Error code: 404The judge used the Foundry project OpenAI client on the legacy
/openai/route, which returns 404 for chat completions. The client is now normalized to the stable/openai/v1/route (clearing the injectedapi-versionquery param) viaclient.with_options(...), reusing the same credential and token refresh. Non-Foundry endpoints are returned unchanged. The judge now runs instead of 404ing.2. OpenAI data-plane RBAC check -> UnsupportedQuery
(UnsupportedQuery) The filter 'atScopeAndAbove() and assignedTo(...)' is not supported.The check built a combined ARM role-assignment filter that ARM rejects. It now sends the supported
assignedTo('<oid>')filter, which already returns assignments at the target scope and every ancestor scope. The check runs instead of skipping with a console error.3. App Insights probe -> read timeout
INFO: Rate-limit App Insights probe failed (non-fatal): The read operation timed out_query_application_insightscaught onlyurllib.error.URLError, so a read timeout (socket.timeout, anOSErrorbut not aURLError) escaped and printed. It now catchesOSError(covering both) and the request timeout was raised from 10s to 30s. Slow App Insights degrades quietly.Tests
_normalize_foundry_openai_client), the corrected RBAC filter, and the App Insights timeout/URLError degrade-to-None path.1101 passed, 1 skipped.Notes
develop.## [Unreleased].