Repository navigation
Conversation
Files kept next to the cassettes (such as an approvals list) were listed as unreadable. The README now also says that the expiry ini setting and options apply through the cassette fixture, not to an LLMCassetteRecorder created directly. Both noted by Yamabiko on moving to 0.8.0.
Records only the cassettes whose file does not exist yet, through the same path as record (sanitized, saved), and replays the rest, so adding one cassette does not re-record and pay for the others. pytest lists the new cassettes at the end of the run. Requested from Yamabiko (AV-9).
Every text a request sends the model, as (where, text) pairs: the system prompt, messages with their role, tool call arguments and tool results with the tool's name, tool definitions including enum values, and the provider's other parameters, read alike for every provider shape. Provider ids, reasoning signatures, and embedded media are left out. Requested from Yamabiko (AV-8).
Fails when a URL in a request the model was sent carries a credential: a query name such as token, access_token, security_token, X-Amz-Signature, or sig, or a JWT in the path or query. Searches every text iter_request_texts walks, tool results and tool definitions included. extra_patterns adds regular expressions and ignore drops default names. The error lists where and the host, never the values. Requested from Yamabiko (AV-7).
With drift="warn" or "fail" (or the agentverify_cassette_drift setting and --cassette-drift), replay compares what request matching leaves alone: tool results key by key, the number and roles of the messages, and the provider's other parameters. warn lists the places that differ in the stale cassettes summary, fail raises CassetteDriftError; values are never shown. drift_ignore takes globs over the places. Off by default, since tools that run for real return something new. Requested from Yamabiko (AV-10).
- iter_request_texts skips provider ids and signatures only in the envelope:
tool arguments, results, and schemas keep keys named id, data, or
signature, so a URL under {"data": ...} is checked
- SDK objects in a request (dataclasses, models, tuples) are read like dicts,
and an OpenAI tool message with a list of parts is a tool result
- assert_no_credential_urls reads the fragment (implicit OAuth tokens),
decodes HTML entities (&), and splits URLs urlsplit rejects by hand
- drift applies with match_requests=False too
- record-missing keeps no cassette when the block raised
- --cassette-report lists an empty cassette as unreadable
- one relative-path helper and one list of system-prompt keys; the
--cassette-mode help names record-missing
strands-agents-tools 0.9 removed http_request; the official Weather Forecaster sample now imports it from strands.vended_tools, part of strands-agents. The example does the same, drops the strands-agents-tools dependency, and its cassette is re-recorded on Bedrock with the new tool (three model calls, two tool calls).
The README keeps each feature's purpose and one example. docs/cassettes.md holds the cassette rules (recorded and unsupported calls, streaming, the Responses API, concurrency, tool replay, request matching, drift, expiry and the report, request texts and credential URLs), docs/tool-results.md the tool error signals, and docs/reference.md an index of every public name and pytest option plus what the README only mentions (LLMCassetteRecorder without the fixture, on_missing, @cassette_tool, step_probe, the result objects, every error). One real-world example stays in the README and the others are in the Examples table; budget, latency, and final-output assertions share a section; the CHANGELOG entries are short.
Every assertion sets __tracebackhide__, so pytest shows a failure at the test's own line instead of agentverify's internal frames. Request matching, a missing recording, and the call paths that raise them do the same for agentverify's own errors only, so an unexpected error inside agentverify keeps its frames for a bug report. assert_all (MultipleAssertionError) indents each failure's lines under its number.
docs/screenshots/ holds four, rendered alike from real runs: multi-agent.png at the top of the README (a supervisor that skipped research, and a math step that ignored the previous result), stale-cassette.png in Stale Cassette Detection (a one-line prompt change failing replay with a diff and the re-record command), safety.png in Allowed Tools (an MCP agent's calls outside an allow list), and simple.png (a tool call mismatch and a token budget), kept for later use.
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.
Review PR for the 0.9.0 release. Please do not merge on GitHub. After approval: release commit (version + CHANGELOG heading) on
develop, fast-forwardmain, lightweight tag, push, TestPyPI check, PyPI upload (after your OK), GitHub Release.What to review
## Unreleased): four features, two bug fixes, documentation entries. No breaking changes.--cassette-mode=record-missing/CassetteMode.RECORD_MISSING,iter_request_texts,assert_no_credential_urls/CredentialURLError,drift/drift_ignoreoncassette()andLLMCassetteRecorder,--cassette-drift, theagentverify_cassette_driftini setting,CassetteDriftError.docs/cassettes.md,docs/tool-results.md, and the API referencedocs/reference.md; new screenshots indocs/screenshots/.Commits
c897213--cassette-reportleaves out files that are not cassettesf98ffb8--cassette-mode=record-missingfbcaf9aiter_request_texts: every text sent to the model, with where it sits, for every provider shape85a5857assert_no_credential_urls: URLs with tokens, keys, signatures, or JWTs; values never printed20123b6off/warn/fail)453adf4/code-review, 10 findings, all fixed)b1aac4dstrands.vended_tools.http_request(strands-agents-tools 0.9 removed its own), re-recorded on Bedrock7e76fb3docs/fb17656assert_allindents each failure1313712The features come from Yamabiko (the maintainer's home agent, which tests itself with agentverify): AV-7 credential URLs, AV-8 request texts, AV-9 record-missing, AV-10 drift. Yamabiko reviewed the design before implementation.
Verification
develop.🤖 Generated with Claude Code