Skip to content

Migrate Spring AI samples to standalone package and Spring AI 2 - #810

Open
brianstrauch wants to merge 2 commits into
mainfrom
brian/spring-ai-standalone-package
Open

brianstrauch wants to merge 2 commits into
mainfrom
brian/spring-ai-standalone-package

Conversation

@brianstrauch

@brianstrauch brianstrauch commented Oct 16, 2026 •

Copy link
Copy Markdown
Member

Migrate the basic, MCP, multi-model, and RAG samples to the independently versioned io.temporal:spring-ai:0.1.1 package with Spring AI 2.0.1 and Spring Boot 4.0.8.

  • Replace removed provider APIs and the memory advisor, supply Workflow IDs for conversation memory, and use immutable option builders.
  • Register discovered MCP callbacks through defaultTools, using the callback pass-through fix released in Temporal Spring AI 0.1.1.
  • Disable native provider retries so Temporal Activities own retries. The RAG sample sets spring.ai.openai.max-retries: 0 for both chat and embedding models.
  • Update the integration link and explain that Spring AI 1 histories require separate Workers or completed executions before upgrading.
  • Add credential-free tests for basic and MCP tool calling, conversation memory, Workflow replay, and native provider bean initialization. The MCP test uses a fake McpClientActivity that advertises one tool and verifies its arguments and result.

Validated on Java 21 with repository-wide spotlessCheck and builds of all four Spring AI modules:

./gradlew --no-daemon spotlessCheck \
  :springai:basic:build :springai:mcp:build \
  :springai:multimodel:build :springai:rag:build

All three regression tests pass without provider credentials or external services. The new MCP test reproduces the No @Tool annotated methods found failure with Temporal Spring AI 0.1.0 and passes with 0.1.1.

@patbeqo patbeqo left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add an MCP test like the basic and multimodel ones? A fake McpClientActivity that returns one tool would have caught the defaultTools issue below.

Comment thread springai/rag/src/main/resources/application.yaml Outdated

@DABH DABH left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 409a90a. No new correctness regressions found in the migration; the previously reported callback-registration and RAG retry issues are fixed.

Validated on Java 17: repository-wide spotlessCheck, builds of all four Spring AI modules, and all three credential-free regression tests. Additional probes verified the actual multimodel thinking route and history replay, and a real Spring Boot RAG context against a local HTTP 500 endpoint: chat and embedding now each make one HTTP request per call, versus four embedding requests before the fix.

A full Spring Boot/stdio MCP probe also exposed an inherited client-discovery defect on both base and this head; I added a non-blocking inline follow-up with the reproduction and a passing control. The fake-activity regression test correctly covers the callback fix, but does not exercise that existing wiring issue.

One CI Unit Tests job currently fails in the unchanged HelloWorkflowTimerTest. The other Unit Tests job passed, and the focused timer test also passed locally; this PR does not change core sources or their build configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants