feat: add preflight checks, --dry-run flag, and credential timeout resilience#105
Closed
placerda wants to merge 1 commit into
Closed
feat: add preflight checks, --dry-run flag, and credential timeout resilience#105placerda wants to merge 1 commit into
placerda wants to merge 1 commit into
Conversation
…silience Detect common configuration issues before backend execution so they surface fast with actionable error messages. - Add services/preflight.py with 4 checks: SDK imports, env vars, credential warm-up, endpoint reachability. All checks run and collect errors together (not fail-fast). - Add --dry-run/-n flag on 'agentops eval run' for CI gating and fast feedback. - Raise AzureCliCredential process_timeout to 30s in eval_engine.py and foundry_backend.py (2 sites). Fixes Windows az.cmd cold start timeouts. - Add 14 unit tests for the preflight module.
Contributor
Author
|
Cancelling for now, we'll prioritize #107 |
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
Generalizable improvements to
agentops eval runbased on a real-world RAG evaluation testing session where the workflow failed multiple times on issues that could be detected upfront. Addresses the friction points without adding project-specific code.Changes
Phase 1 — Pre-flight check system
New
src/agentops/services/preflight.pymodule with 4 checks that run before backend execution inrunner.py:azure-identityandazure-ai-evaluation. Fails withpip installhints.AZURE_OPENAI_ENDPOINT/AZURE_OPENAI_DEPLOYMENTfor AI-assisted evaluators;AZURE_AI_FOUNDRY_PROJECT_ENDPOINTfor safety evaluators.DefaultAzureCredential.get_token()once so subsequent evaluator calls use the MSAL cache instead of each cold-startingaz.cmd.All checks run together and collect errors — failures are reported as a single numbered list so users can fix everything in one pass.
Phase 2 —
--dry-run/-nflag oneval runRuns pre-flight checks only. Exit 0 if all pass, 1 if any fail. Useful for CI gating and fast feedback loops.
Phase 3 — Credential timeout resilience
Added
process_timeout=30to all 3DefaultAzureCredentialsites:eval_engine.py::_default_credential()foundry_backend.py::_acquire_token()foundry_backend.py::_invoke_model_direct()The default 10s is insufficient for Windows
az.cmdcold starts and was producing intermittentAzureCliCredential: Failed to invoke the Azure CLIerrors.Phase 4 — Tests
New
tests/unit/test_preflight.pywith 14 tests covering:PreflightReportformattingpip installhintTest Results
All existing 239 tests continue to pass; 14 new preflight tests added.