Skip to content

fix(ai-sdk): use activityOptions in callTool proxy#1954

Merged
chris-olszewski merged 1 commit intotemporalio:mainfrom
somilg050:fix/mcp-calltool-activity-options
Mar 9, 2026
Merged

fix(ai-sdk): use activityOptions in callTool proxy#1954
chris-olszewski merged 1 commit intotemporalio:mainfrom
somilg050:fix/mcp-calltool-activity-options

Conversation

@somilg050
Copy link
Contributor

Summary

The callTool activity proxy in TemporalMCPClient spreads this.options (the full TemporalMCPClientOptions object) instead of this.options.activityOptions into workflow.proxyActivities().

This means any custom activityOptions (e.g. startToCloseTimeout, retry) passed to TemporalMCPClient are silently ignored for tool calls, while unrelated fields like name and clientArgs leak into the activity options.

The listTools proxy already correctly uses this.options.activityOptions — this is a one-line fix to make callTool consistent.

Before (bug)

// packages/ai-sdk/src/mcp.ts line 51
...this.options,  // spreads { name, clientArgs, activityOptions } — wrong

After (fix)

...this.options.activityOptions,  // spreads only ActivityOptions — correct

Test plan

  • Construct a TemporalMCPClient with custom activityOptions (e.g. startToCloseTimeout: '1 minute')
  • Verify callTool activities now respect the custom timeout instead of defaulting to 10 minutes
  • Verify listTools continues to work as before (already correct)

…proxy

The callTool activity proxy in TemporalMCPClient spreads `this.options`
(the full TemporalMCPClientOptions object) instead of
`this.options.activityOptions`. This causes `name`, `clientArgs`, and
other non-ActivityOptions fields to be passed into
`workflow.proxyActivities()`, which silently ignores the custom
`activityOptions` the caller intended to set.

The listTools proxy on line 36 already correctly uses
`this.options.activityOptions` — this fix makes callTool consistent.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@somilg050 somilg050 requested a review from a team as a code owner March 6, 2026 22:50
@CLAassistant
Copy link

CLAassistant commented Mar 6, 2026

CLA assistant check
All committers have signed the CLA.

Copy link
Member

@chris-olszewski chris-olszewski left a comment

Choose a reason for hiding this comment

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

Thanks for the PR

@chris-olszewski chris-olszewski self-requested a review March 9, 2026 13:28
@chris-olszewski chris-olszewski merged commit b1b028e into temporalio:main Mar 9, 2026
70 of 77 checks passed
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