Skip to content

fix(core): type WorkflowExecutionContext.steps as WorkflowStepHistoryEntry[]#1285

Open
Koushik-Salammagari wants to merge 1 commit into
VoltAgent:mainfrom
Koushik-Salammagari:fix/workflow-context-steps-type
Open

fix(core): type WorkflowExecutionContext.steps as WorkflowStepHistoryEntry[]#1285
Koushik-Salammagari wants to merge 1 commit into
VoltAgent:mainfrom
Koushik-Salammagari:fix/workflow-context-steps-type

Conversation

@Koushik-Salammagari
Copy link
Copy Markdown

@Koushik-Salammagari Koushik-Salammagari commented May 15, 2026

PR Checklist

  • The commit message follows the conventional-commit convention

Bugs / Features

  • Related issue linked
  • Tests for the changes have been added
  • Docs have been added / updated
  • Changeset added

What is the current behavior?

WorkflowExecutionContext.steps is typed as any[] with a // TODO: Type this properly comment.

What is the new behavior?

Import WorkflowStepHistoryEntry (already exported from ./types) and use it as the element type. This removes the escape hatch and lets TypeScript catch callers that push wrong shapes into steps[].

No runtime change — this is a type-only fix.


Summary by cubic

Type WorkflowExecutionContext.steps as WorkflowStepHistoryEntry[] instead of any[] to enforce correct step shapes and catch type errors at compile time. No runtime behavior changes.

Written for commit b036556. Summary will update on new commits. Review in cubic

Summary by CodeRabbit

  • Refactor
    • Improved type safety for workflow execution tracking to enhance code reliability and error detection.

Review Change Stack

…rkflowExecutionContext

WorkflowStepHistoryEntry is already exported from the same types module.
The any[] was left as a placeholder (TODO comment). Removing the escape
hatch surfaces type errors if callers push wrong shapes into steps[].
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 15, 2026

⚠️ No Changeset found

Latest commit: b036556

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 15, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: fdf411a5-e018-42ce-94b6-9207b18539e8

📥 Commits

Reviewing files that changed from the base of the PR and between 08414ed and b036556.

📒 Files selected for processing (1)
  • packages/core/src/workflow/context.ts

📝 Walkthrough

Walkthrough

This PR strengthens type safety in the workflow execution context by updating the steps property from an untyped any[] array to a properly typed WorkflowStepHistoryEntry[] array. The type import is reformatted to explicitly declare the new dependency.

Changes

Workflow Execution Steps Typing

Layer / File(s) Summary
Type safety strengthening for workflow execution steps
packages/core/src/workflow/context.ts
Import statement is reformatted to multi-line style and explicitly includes WorkflowStepHistoryEntry. The steps property in WorkflowExecutionContext changes from any[] to WorkflowStepHistoryEntry[] for compile-time type checking.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~5 minutes

Possibly related PRs

  • VoltAgent/voltagent#945: Adjusts workflow step typing in the core execution path by adding retries/retryCount to step descriptors and step execution context, complementing this PR's tightening of WorkflowExecutionContext.steps type.

Suggested reviewers

  • sapkra

Poem

🐰 Hop skip, type safety's here at last,
Any arrays fade into the past,
WorkflowSteps now shine bright and clear,
No more guessing—types are here!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: typing WorkflowExecutionContext.steps as WorkflowStepHistoryEntry[] instead of any[].
Description check ✅ Passed The description covers current behavior, new behavior, and notes that tests were added, but does not include linked issues, docs updates, or changesets as specified in the template.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint skipped: no ESLint configuration detected in root package.json. To enable, add eslint to devDependencies.

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

No issues found across 1 file

Re-trigger cubic

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