Skip to content

add(sdk/go): Context to workflow requests (#2765)#3127

Open
gregfurman wants to merge 1 commit intohatchet-dev:mainfrom
gregfurman:fix/sdk/add-ctx
Open

add(sdk/go): Context to workflow requests (#2765)#3127
gregfurman wants to merge 1 commit intohatchet-dev:mainfrom
gregfurman:fix/sdk/add-ctx

Conversation

@gregfurman
Copy link
Collaborator

Description

Fixes #2765

Methods on the AdminClient interface ignore the caller method's context.Context parameter, meaning cancelling a parent context fails to affect the downstream gRPC request.

This PR introduces breaking changes to the interface which now correctly pass a caller context to these methods.

Rationale for breaking changes

The two alternatives considered for this were:

However, the interface being changed is both in a deprecated package (which IMO should mean less stability guarantees) AND should probably have had these ctx params to begin with.

With that said, if we choose to accept this PR, we should make mention of this breaking change to the SDK in the release notes.

Type of change

  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

What's Changed

  • Adds a context.Context to those methods within the (deprecated) v0 AdminClient interface.
  • Calls made without proper context propagation now use context.TODO() instead of a no-op context.Background()

@gregfurman gregfurman self-assigned this Mar 1, 2026
@gregfurman gregfurman added enhancement New feature or request sdk-go Related to the Go SDK labels Mar 1, 2026
@vercel
Copy link

vercel bot commented Mar 1, 2026

@gregfurman is attempting to deploy a commit to the Hatchet Team on Vercel.

A member of the Team first needs to authorize it.

@gregfurman gregfurman marked this pull request as ready for review March 2, 2026 15:44
@gregfurman gregfurman requested a review from mnafees March 2, 2026 15:44
@promptless-for-oss
Copy link

📝 Documentation updates detected!

Updated existing suggestion: Update Go migration guide for V0 SDK deprecation and context parameter breaking change


Tip: Assign suggestions to team members in the Promptless dashboard to claim work 👥

@promptless-for-oss
Copy link

📝 Documentation updates detected!

Updated existing suggestion: Add V0 and V1 Generics SDK deprecation notices to Go migration guide


Tip: Planning a big docs refactor? Use Deep Analysis to get help with the heavy lifting 🔍

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

Labels

enhancement New feature or request sdk-go Related to the Go SDK

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Canceling the workflow.Run() context does not stop execution until the workflow finishes

2 participants