Skip to content

fix: allow custom workflow stream event types while preserving Intell…#983

Merged
omeraplak merged 1 commit into
mainfrom
fix/workflow-write-type
Jan 23, 2026
Merged

fix: allow custom workflow stream event types while preserving Intell…#983
omeraplak merged 1 commit into
mainfrom
fix/workflow-write-type

Conversation

@omeraplak

@omeraplak omeraplak commented Jan 23, 2026

Copy link
Copy Markdown
Member

…iSense for built-in names

PR Checklist

Please check if your PR fulfills the following requirements:

Bugs / Features

What is the current behavior?

What is the new behavior?

fixes (issue)

Notes for reviewers


Summary by cubic

Allow custom workflow stream event types while preserving IntelliSense for built-in names. Improves DX and type safety with no runtime behavior changes.

  • Bug Fixes
    • Introduced WorkflowStreamEventType: built-in literals plus a wide string to support custom events with autocomplete.
    • Updated WorkflowStreamEvent.type and WorkflowStreamWriter.write signatures (including NoOp) to use the new type.
    • Keeps existing built-in event names and usage fully compatible.

Written for commit 1413be7. Summary will update on new commits.

Summary by CodeRabbit

  • Bug Fixes
    • Workflow stream events now support custom event types while maintaining full IDE IntelliSense autocomplete for built-in event names, enhancing developer experience during workflow stream integration.

✏️ Tip: You can customize this high-level summary in your review settings.

@changeset-bot

changeset-bot Bot commented Jan 23, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 1413be7

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

This PR includes changesets to release 1 package
Name Type
@voltagent/core 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

@ghost

This comment has been minimized.

@coderabbitai

coderabbitai Bot commented Jan 23, 2026

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

This PR introduces a new public type WorkflowStreamEventType that constrains workflow stream event types to specific named events plus a catch-all, replacing generic string annotations in the workflow stream API to improve type safety.

Changes

Cohort / File(s) Summary
Type Definition
packages/core/src/workflow/types.ts
Introduced new public type WorkflowStreamEventType as union of specific event string literals (workflow-start, workflow-suspended, etc.) plus catch-all string & {}; updated WorkflowStreamEvent interface and WorkflowStreamWriter.write signature to use new type
Type Usage
packages/core/src/workflow/stream.ts
Updated write method signatures in NoOpWorkflowStreamWriter and WorkflowStreamWriterImpl to accept events with type constrained to WorkflowStreamEventType
Changelog
.changeset/cyan-geese-sing.md
Added changeset entry documenting patch fix for allowing custom workflow stream event types while preserving IntelliSense

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 Hop, hop—types now align so true,
Custom streams flow right on through!
IntelliSense shines bright and clear,
Workflow events we hold most dear! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: introducing custom workflow stream event types while preserving IntelliSense, which is the core objective of this PR.
Description check ✅ Passed The description is mostly complete with an auto-generated summary explaining the changes, but required template sections lack detail: current/new behavior are incomplete, and issue references are missing.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing touches
  • 📝 Generate docstrings

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.

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No issues found across 3 files

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying voltagent with  Cloudflare Pages  Cloudflare Pages

Latest commit: 1413be7
Status: ✅  Deploy successful!
Preview URL: https://7e698ab3.voltagent.pages.dev
Branch Preview URL: https://fix-workflow-write-type.voltagent.pages.dev

View logs

@omeraplak
omeraplak merged commit 96ebba3 into main Jan 23, 2026
23 checks passed
@omeraplak
omeraplak deleted the fix/workflow-write-type branch January 23, 2026 16:11
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