Skip to content

Conversation

@Linell
Copy link
Contributor

@Linell Linell commented Oct 2, 2025

Adds support for the StepFailed opcode, a la inngest/inngest#2992

@changeset-bot
Copy link

changeset-bot bot commented Oct 2, 2025

🦋 Changeset detected

Latest commit: b96bf23

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
inngestgo Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@Linell Linell requested a review from amh4r October 2, 2025 22:34
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds support for the StepFailed opcode to handle permanent step failures when retries are exhausted or explicitly disabled. This aligns with the upstream Inngest changes for improved error handling.

  • Introduces OpcodeStepFailed for non-retriable step errors
  • Adds MaxAttempts field to track retry limits
  • Updates error handling logic to distinguish between retriable and permanent failures

Reviewed Changes

Copilot reviewed 4 out of 67 changed files in this pull request and generated 1 comment.

File Description
step/run.go Implements step failure logic with new opcode and retry detection
internal/sdkrequest/request.go Adds MaxAttempts field to CallCtx for retry tracking
handler.go Updates error handling to process StepFailed opcodes and preserve StepError panics
go.mod Updates Go version and dependency versions

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@Linell Linell force-pushed the linell/step-failed-opcode branch 3 times, most recently from ba3df00 to a0b9a1b Compare October 3, 2025 17:36
go.mod Outdated
github.com/gosimple/slug v1.12.0
github.com/gowebpki/jcs v1.0.0
github.com/inngest/inngest v1.11.11-0.20250903154644-c3be9c4c8b45
github.com/inngest/inngest v1.11.14-0.20250926175522-7a60b676feb8
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think I did the vendoring correctly, but note that running go mod tidy does result in the go version on line three becoming 1.24.0 instead of just 1.24 🤷

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe re-vendor w/ new latest?

@Linell Linell requested a review from rhino1998 October 17, 2025 17:26
Copy link
Contributor

@rhino1998 rhino1998 left a comment

Choose a reason for hiding this comment

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

Nothing blocking

go.mod Outdated
github.com/gosimple/slug v1.12.0
github.com/gowebpki/jcs v1.0.0
github.com/inngest/inngest v1.11.11-0.20250903154644-c3be9c4c8b45
github.com/inngest/inngest v1.11.14-0.20250926175522-7a60b676feb8
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe re-vendor w/ new latest?

@amh4r
Copy link
Contributor

amh4r commented Oct 20, 2025

Looks like our retry-related test coverage is lacking. Could you add some tests?

At step.Run level and function level:

  • Returning error with Retries: inngestgo.IntPtr(0) means no retry
  • Returning NoRetryError with Retries: inngestgo.IntPtr(1) means no retry

Also:

  • If function does not return step error then run does not fail (i.e. "swallow" the error)

@Linell Linell force-pushed the linell/step-failed-opcode branch 2 times, most recently from 884e821 to 2c4d679 Compare October 22, 2025 18:16
@Linell Linell requested a review from rhino1998 October 22, 2025 18:22
Copy link
Contributor

@rhino1998 rhino1998 left a comment

Choose a reason for hiding this comment

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

Seems reasonable

inngestgo.EventTrigger(eventName, nil),
func(ctx context.Context, input inngestgo.Input[any]) (any, error) {
runID.Store(input.InputCtx.RunID)
attempts.Append(input.InputCtx.Attempt)
Copy link
Contributor

Choose a reason for hiding this comment

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

I think attempt resets when the step ultimately fails, so we may not be able to put this out here. @jpwilliams to confirm that.

Instead, maybe we put a counter inside step.Run to ensure it isn't run more than once

@Linell Linell force-pushed the linell/step-failed-opcode branch 2 times, most recently from e95f140 to 2da1a15 Compare October 22, 2025 21:30
@Linell Linell force-pushed the linell/step-failed-opcode branch from baf52af to a559a37 Compare October 22, 2025 21:35
Add support for the `StepFailed` opcode, which denotes a permanent, non-retriable failure.
@Linell Linell merged commit b9dbde9 into main Oct 23, 2025
8 checks passed
@Linell Linell deleted the linell/step-failed-opcode branch October 23, 2025 14:50
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.

4 participants