Skip to content

fix(rivetkit): infer T from step/tryStep config object in workflow context wrapper#5124

Merged
abcxff merged 1 commit into
mainfrom
05-21-fix_rivetkit_infer_t_from_step_trystep_config_object_in_workflow_context_wrapper
Jun 3, 2026
Merged

fix(rivetkit): infer T from step/tryStep config object in workflow context wrapper#5124
abcxff merged 1 commit into
mainfrom
05-21-fix_rivetkit_infer_t_from_step_trystep_config_object_in_workflow_context_wrapper

Conversation

@abcxff
Copy link
Copy Markdown
Contributor

@abcxff abcxff commented Jun 2, 2026

Description

Please include a summary of the changes and the related issue. Please also include relevant motivation and context.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@railway-app railway-app Bot temporarily deployed to rivet-frontend / rivet-pr-5124 June 2, 2026 20:10 Destroyed
@railway-app
Copy link
Copy Markdown

railway-app Bot commented Jun 2, 2026

🚅 Deployed to the rivet-pr-5124 environment in rivet-frontend

Service Status Web Updated (UTC)
kitchen-sink ❌ Build Failed (View Logs) Web Jun 3, 2026 at 1:12 am
frontend-cloud ❌ Build Failed (View Logs) Web Jun 2, 2026 at 8:18 pm
frontend-inspector ❌ Build Failed (View Logs) Web Jun 2, 2026 at 8:17 pm
mcp-hub ✅ Success (View Logs) Web Jun 2, 2026 at 8:11 pm
website ❌ Build Failed (View Logs) Web Jun 2, 2026 at 8:10 pm
ladle ❌ Build Failed (View Logs) Web Jun 2, 2026 at 8:10 pm

@claude
Copy link
Copy Markdown
Contributor

claude Bot commented Jun 2, 2026

Code Review

Summary: This PR fixes a TypeScript generic inference bug in ActorWorkflowContext.step and ActorWorkflowContext.tryStep by replacing Parameters<WorkflowContextInterface["step"]>[0] with the direct generic type StepConfig<T>.

The Bug Being Fixed

TypeScript's Parameters<> utility applied to an overloaded function always picks the last overload, and cannot propagate the generic T. The original code produced effectively StepConfig<unknown>, so callers got Promise<unknown> return types when passing a config object. Using StepConfig<T> directly ties the config's run: () => Promise<T> to the method's own T, restoring proper inference.

Observations

Minor: The file has // @ts-nocheck at the top — pre-existing, not introduced here. The corrected signatures still matter for consumers since TypeScript performs inference at call sites even when the implementation file has @ts-nocheck.

Consistency gap: The try method on the same class still uses Parameters<WorkflowContextInterface["try"]>[0]. It may have the same inference problem and could be fixed in a follow-up.

Assessment

Minimal, focused, correct change. No new behavior introduced — pure type-level fix.

@abcxff abcxff changed the base branch from 05-21-feat_workflow-engine_add_retryontimeout_opt-in_for_step_timeout_retries to graphite-base/5124 June 2, 2026 20:16
@abcxff abcxff force-pushed the 05-21-fix_rivetkit_infer_t_from_step_trystep_config_object_in_workflow_context_wrapper branch from 8ea29c0 to fedf6f6 Compare June 2, 2026 20:16
@railway-app railway-app Bot temporarily deployed to rivet-frontend / rivet-pr-5124 June 2, 2026 20:16 Destroyed
@abcxff abcxff changed the base branch from graphite-base/5124 to 06-02-chore_wasm-pack_upgrade_wasm-pack_to_now-functioning_v0.15.0 June 2, 2026 20:17
@abcxff abcxff marked this pull request as ready for review June 2, 2026 23:12
Copy link
Copy Markdown
Contributor Author

abcxff commented Jun 3, 2026

Merge activity

  • Jun 3, 1:04 AM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Jun 3, 1:12 AM UTC: Graphite rebased this pull request as part of a merge.
  • Jun 3, 1:13 AM UTC: @abcxff merged this pull request with Graphite.

@abcxff abcxff changed the base branch from 06-02-chore_wasm-pack_upgrade_wasm-pack_to_now-functioning_v0.15.0 to graphite-base/5124 June 3, 2026 01:09
@abcxff abcxff changed the base branch from graphite-base/5124 to main June 3, 2026 01:10
@abcxff abcxff force-pushed the 05-21-fix_rivetkit_infer_t_from_step_trystep_config_object_in_workflow_context_wrapper branch from fedf6f6 to 20e4821 Compare June 3, 2026 01:11
@railway-app railway-app Bot temporarily deployed to rivet-frontend / rivet-pr-5124 June 3, 2026 01:11 Destroyed
@abcxff abcxff merged commit 85cc607 into main Jun 3, 2026
13 of 18 checks passed
@abcxff abcxff deleted the 05-21-fix_rivetkit_infer_t_from_step_trystep_config_object_in_workflow_context_wrapper branch June 3, 2026 01:13
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.

1 participant