Rig v0.38.1 released! #1852
gold-silver-copper
announced in
Announcements
Replies: 2 comments 2 replies
|
Huge congrats on v0.38.1 🎉 Really glad to see this land — and happy we could contribute the Anthropic document-citations support (#1778) along the way. While working in the codebase we ended up studying Rig pretty deeply, and we love it. We're building Rustok — a fully-Rust, self-custody Ethereum wallet (mobile + a |
2 replies
|
Rig builds us! |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Another wonderful release is here, consisting of 54 newly merged PRs! THANK YOU to all our contributors <3 Somewhat delayed compared to our normal release cadence, but only because we wanted to make it that much better! Let's get into it.
Cassette Tests
Rig now supports replayable provider cassette tests! This means that we can run a test against a live provider, record all the interactions, and then rerun the same test against those interactions in CI without using API keys or paying for tokens. This is a MAJOR boon for development stability. Rig's most subtle behavior lives at the boundary between provider-agnostic abstractions and each provider's real API shape. Mock tests are still useful, but they cannot always catch issues like provider-specific streaming behavior, metadata quirks, non-standard response formats, etc etc...
Cassette tests allow us to record REAL provider responses and test against them continuously FOR FREE. Moving forward this means much wider regression coverage, much better testing in CI, and much safer refactoring.
Better Tool Schemas
#[rig_tool]now usesschemarsinstead of Rig’s previous hand-rolled schema generation.This is an AWESOME upgrade. Tool schemas are one of the main ways Rig communicates intent to models: what a tool is called, what arguments it accepts, which fields are required, which shapes are valid, and how nested data should be structured.
Previously, Rig used a custom schema generator which was limited in the sort of schema shapes it could support, this is no longer!
By moving to
schemars, Rig can now generate much richer JSON Schema from Rust types. That means derived tools can better represent nested structs, enums, arrays, optional fields, field metadata, renamed serde fields, and other shapes that are common in advanced applications.This greatly expands what can be expressed with
#[rig_tool]. Instead of designing tool inputs around the limitations of a custom schema generator, users can define normal Rust argument types and rely on a more mature schema backend to describe them accurately.For users building agents with structured tools, this means less manual schema work and fewer provider-specific surprises. You can keep writing strongly typed Rust tools, and Rig will produce a better schema for the model to follow.
Tool Calling Reliability and Repair
In older versions of Rig, invalid tool calls emitted by models were caught late in the execution pipeline, making it impossible to repair them. With the new changes, there is now a
on_invalid_tool_callmethod that users can implement forPromptHookwhich allows them to control what happens when the agent receives an invalid tool call.Currently the default behavior is to fail fast, and optionally the user can choose to either retry the request, or to repair the name of the tool call. In the future we also plan to add the option to repair tool call arguments, which should make tool calling DX much more powerful.
Streaming Improvements
Rig now exposes tool-call deltas through
prompt_request, parses more robustly, and tolerates OpenAI-compatible providers that send tool-call arguments as objects instead of strings.Agent responses can now include per-completion-call usage, which makes multi-turn streaming accounting much clearer. We also fixed duplicate streaming reasoning history, so providers that emit reasoning or thought-style metadata roundtrip more cleanly.
Provider Improvements
Rig now supports OpenRouter prompt caching, cache token accounting, app attribution headers, transcription, audio generation, Gemini model-role responses, and safer generated-image replay behavior.
Gemini streaming responses now expose richer metadata like finish reasons and model versions, token usage telemetry is more accurate, and Gemini gRPC tool declarations now correctly include parameters from Rig tool definitions.
Anthropic gained document citation support, better image tool-result serialization, and tool cache-control support for prompt caching workflows.
SQLite and Vector Store Updates
SQLite support now handles JSON metadata more ergonomically. This release adds JSON column deserialization, document metadata filters, and docs covering JSON metadata usage.
We also stabilized the MongoDB vector search test and shipped dependency updates across the vector-store crates.
Final Notes
Beyond the headline changes, this release includes many smaller fixes, tests, dependency updates, and improvements.
Huge thank you to everyone who contributed:
...and everyone else helping push Rig forward.
We build Rig, Rig builds us!
Full changelog: #1765
All reactions