| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
The evaluation group of Secure Integration test has been failing on main since #568 with all six third-party adapter tests red. Two distinct causes, both of which had to be fixed: 1. Span fixture shape. strands-evals' CloudWatchSessionMapper reads message text via content.content / content.message, where the inner value is a JSON-encoded list of content blocks, and keys off scope.name to select the CloudWatch format. The fixture passed a bare string and set no scope, so _extract_content_field returned None, the mapper produced zero traces, no AgentInvocationSpan was found, and the adapters returned FIELD_EXTRACTION_ERROR with value=None. The repo's own unit fixtures already use the correct nested shape; only the integ fixture drifted. test_factuality_scorer additionally overwrote output.messages inline with the old bare-string shape, which would have defeated the fix for that one test, so that mutation is gone. 2. LLM judge credentials. Both DeepEval and Autoevals judge with an LLM (GPT by default) and raise before returning when no key is present. Fixing the fixture alone does not turn the job green: it moves the Autoevals failures from FIELD_EXTRACTION_ERROR to METRIC_ERROR (missing credentials). OPENAI_API_KEY is now fetched as a repo-specific workflow secret and exported to the test step. The secret must exist in the central DevX Secrets Manager account and be readable by this repository's reader role before this merges. The fetch-secrets step is shared by all nine matrix groups, so an unfetchable secret id fails every group, not just evaluation. These tests require OPENAI_API_KEY and fail without it, so local runs and any environment lacking the key will report six failures. Verified: with the fixture fixed and the judge stubbed, both adapters extract input/actual_output correctly and return a score.
|
Claude Security Review: no high-confidence findings. (run) |
Sorry, something went wrong.
#614 fixed the span fixture and wired OPENAI_API_KEY, taking the evaluation group from six failures to three. The three remaining AutoEvalsAdapter tests fail with: Braintrust gateway error: auth failed [401 Unauthorized]: Invalid API Key autoevals does not call OpenAI directly by default. When base_url is unset it resolves to the Braintrust AI gateway and prefers BRAINTRUST_API_KEY over OPENAI_API_KEY, so our OpenAI key is presented to a service that does not accept it. The key is valid; it was being sent to the wrong endpoint. Passing an explicit client is the provider-selection path autoevals documents; its api_key and base_url arguments are marked deprecated in favour of the client argument. The client is built once in a fixture and each test passes it to the scorer, so the provider choice stays visible at the call site. Scoped to the Autoevals tests. DeepEval is unaffected and already passes, since it reaches OpenAI directly. Verified: an injected client bypasses the gateway; a probe with a deliberately invalid key returns OpenAI's own 401 ("Incorrect API key provided") with no Braintrust in the message. ruff format and ruff check are clean.
| Back | FazBrowse Home | New Git URL |
Summary
Fixes the evaluation group of Secure Integration test, red on main since #568 with all six third-party adapter tests failing.
There were two independent causes, and both had to be fixed — the first one masks the second, so neither alone turns the job green.
1. Span fixture shape (FIELD_EXTRACTION_ERROR)
strands-evals' CloudWatchSessionMapper reads message text via content.content / content.message, where the inner value is a JSON-encoded list of content blocks, and selects the CloudWatch format off scope.name:
The integ fixture passed a bare string and set no scope, so extraction returned None → zero traces → no AgentInvocationSpan → FIELD_EXTRACTION_ERROR with value=None. The repo'"'"'s own unit fixtures already use the correct nested shape (autoevals/test_adapter.py:32); only the integ fixture drifted.
Also removed an inline mutation in test_factuality_scorer that overwrote output.messages with the old bare-string shape — it would have defeated the fix for that one test, and it only reproduced what the helper already builds by default.
2. LLM judge credentials (METRIC_ERROR)
DeepEval and Autoevals both judge with an LLM (GPT by default) and raise before returning when no key is present. Fixing the fixture alone just moves the Autoevals failures from FIELD_EXTRACTION_ERROR to METRIC_ERROR: Missing credentials.
OPENAI_API_KEY is now fetched as a repo-specific workflow secret and exported to the test step, following the GitHub Reusable Workflow Guide.
Infrastructure (already provisioned)
Precedent: aws/agentcore-cli/E2E_OPENAI_API_KEY already exists in the same account, alongside E2E_ANTHROPIC_API_KEY and E2E_GEMINI_API_KEY. The unprefixed name matches this repo'"'"'s own 15 secrets, none of which use an E2E_ prefix.
Reviewer notes
Testing
I could not exercise the real judge calls locally (no key outside CI), so the first true green run for these six tests will be in CI.