Frozen state: same step-input mutability on the QuickJS VM as on Node

Open
#5,321 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
48/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
typescript
Domain
backend

Research direction

Read state-refs.ts and trace reviveTracked plus the QuickJS VM path that revives frozen state. First check how QuickJS reads state records, since the issue says it cannot yet read StateRefV1; compare that behavior with the Node VM case. Done means choosing and implementing consistent input mutability across both VMs, or documenting the difference until QuickJS supports state records.

Written by the indexing model from the issue text.

Description

Follow-up from review of #5215.

Workflow rebuilds frozen state passed between steps and deep-freezes it (state-refs.ts, reviveTracked). On the Node VM an inline step gets the workflow's own frozen object, so a step that changes its input in place throws a TypeError. Under WORKFLOW_VM=quickjs, values are stored in full and steps get a mutable copy, so the same code works.

Picking one rule would make this predictable across VMs. Options:

  • also deep-freeze frozen state revived in the QuickJS VM, once that VM can read state records;
  • or document the difference until then.

Related: QuickJS can't read StateRefV1 yet, so steps of a QuickJS run write no state records (#5215). Adding reading support there would remove both differences.

🤖 Generated with Claude Code

Dominant language
TypeScript
Stars
2.5k
Forks
401
Avg merge
1d 21h
Merged PRs (30d)
201

Getting set up

  • No Dockerfile or Docker Compose file
  • Has a pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from vercel/workflow

All issues in vercel/workflow

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.