Open
Conversation
Use a plain defaulted field declaration so ty treats metadata as optional at call sites. Made-with: Cursor
declanjackson
approved these changes
Mar 16, 2026
Collaborator
declanjackson
left a comment
There was a problem hiding this comment.
lgtm, just left a couple small comments
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.
Changes
This PR improves how Stirrup handles structured assistant/tool output.
It adds MCP image support, extends image handling to WebP, adds assistant message metadata and generated ids, and fixes interrupt caching so partial runs are only cached when
cache_on_interruptis enabled.Features
MCP image output support
Preserves structured image content returned from MCP tools instead of flattening tool output to text, so image results can flow through the agent/message pipeline correctly.
Relevant files:
src/stirrup/tools/mcp.pysrc/stirrup/core/models.pytests/test_mcp_image_smoke.pytests/test_agent.pyWebP support
Adds
image/webpsupport to image content handling and expands test coverage around image-preserving tool execution.Relevant files:
src/stirrup/core/models.pytests/test_mcp_image_smoke.pytests/test_agent.pyAssistant message metadata and ids
Adds metadata support on
AssistantMessage, forwards that metadata through OpenAI-style message serialization, and generates ids for assistant messages.Relevant files:
src/stirrup/core/models.pysrc/stirrup/clients/utils.pytests/test_clients_utils.pyCache handling fix
Makes teardown respect
cache_on_interrupt, so interrupted or incomplete runs are only written to cache when that behavior is explicitly enabled.Relevant files:
src/stirrup/core/agent.pyTests
Adds regression coverage for MCP image handling, assistant metadata serialization, generated assistant ids, and image-preserving tool execution.
Relevant files:
tests/test_agent.pytests/test_clients_utils.pytests/test_mcp_image_smoke.py