RepoJournal
Spring

@spring-projects

Spring Framework, Spring Boot, and the JVM enterprise layer

Keep up with Spring in about 3 minutes a day: what actually shipped — the commits, pull requests, releases, and security advisories that matter.

One email a day. Unsubscribe in one click.

Pick a date

Topics: Java Full archive →

The Wire · Showcase

SPRING-AI HARDENS MCP EXCEPTION HANDLING, FIXES BUILDER STATE LEAKS

By RepoJournal · Filed · About Spring

Spring AI aligned exception handling across tool decorators and plugged a critical shared mutable state bug in chat options builders that could corrupt cloned instances.

The biggest move: @McpTool callbacks now mirror @Tool's exception contract [1], routing RuntimeExceptions to the model as error results while hard-failing on checked exceptions, Errors, and McpError instances. On the client side, McpError from remote MCP servers now re-throws directly instead of wrapping in ToolExecutionException, giving you finer control over failure modes. This surfaces as a breaking change if you're catching ToolExecutionException for MCP-specific errors.

Meanwhile, Spring AI squashed a nasty shared mutable state bug [2] where ChatOptions builder clone() methods copied collection fields by reference instead of defensively copying them. That meant mutating a cloned builder corrupted its source. The fix mirrors defensive copying already happening in combineWith() and aligns the base ChatOptions contract across all implementations.

Builder API improvements landed too: OpenAiEmbeddingModel and OpenAiImageModel [3] now use the builder pattern for consistency. Spring Tools bumped actions/checkout to 7.0.0 [4] and actions/setup-java to 5.4.0 [5], both routine security and dependency updates. Spring Data JPA [6] expanded MEMBER OF support to map KEY() and VALUE() expressions, and tightened validation to reject missing explicitly named queries [7] instead of falling back to misleading parameter errors.

One email a day. Unsubscribe in one click.

Action items

References

  1. [1] Align @McpTool exception handling with @Tool contract ↗ spring-projects/spring-ai
  2. [2] Fix shared mutable state in chat options builder `clone()` ↗ spring-projects/spring-ai
  3. [3] Use builder pattern for `OpenAiEmbeddingModel` and `OpenAiImageModel` ↗ spring-projects/spring-ai
  4. [4] Bump actions/checkout from 6.0.3 to 7.0.0 ↗ spring-projects/spring-tools
  5. [5] Bump actions/setup-java from 5.2.0 to 5.4.0 ↗ spring-projects/spring-tools
  6. [6] Allow map key and value expressions in collection membership. spring-projects/spring-data-jpa
  7. [7] Reject missing explicitly named queries. spring-projects/spring-data-jpa

Quick answers

What shipped in Spring on July 3, 2026?
Spring AI aligned exception handling across tool decorators and plugged a critical shared mutable state bug in chat options builders that could corrupt cloned instances. In total, 15 commits and 7 pull requests landed.
Who contributed to Spring on July 3, 2026?
4 developers shipped this update, including tzolov, subhashpolisetti, guanxuc, and dependabot[bot].
What were the notable Spring updates?
Align @McpTool exception handling with @Tool contract, Fix shared mutable state in chat options builder `clone()`, and Use builder pattern for `OpenAiEmbeddingModel` and `OpenAiImageModel`.

More from @spring-projects

Daily updates, in your inbox

Follow Spring

Keep up with Spring in about 3 minutes a day: what actually shipped — the commits, pull requests, releases, and security advisories that matter.

or

One email a day. Unsubscribe in one click. Read a past issue →

Elsewhere on the wire

Want every project, not just this one?

We use privacy-friendly analytics (Google Analytics, IP-anonymized) to see which pages help readers. No ads, and we never sell your data. See our Privacy Policy.