Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 7, 2025

Addresses two TODO items identified in the codebase.

Export WorkflowAPIError from public API

WorkflowAPIError was previously not exported from workflow/api, forcing hook handlers to blindly return 404 for all getHookByToken errors:

// Before - had to assume all errors are 404s
try {
  hook = await getHookByToken(token);
} catch (error) {
  // TODO: `WorkflowAPIError` is not exported, so for now
  // we'll return 404 assuming it's the "invalid" token test case
  return Response.json(null, { status: 404 });
}

// After - properly discriminate error types
import { getHookByToken, WorkflowAPIError } from 'workflow/api';

try {
  hook = await getHookByToken(token);
} catch (error) {
  if (error instanceof WorkflowAPIError && error.status === 404) {
    return Response.json(null, { status: 404 });
  }
  throw error;
}

Changes:

  • Export WorkflowAPIError from packages/core/src/runtime.ts and packages/workflow/src/api.ts
  • Update 5 workbench hook handlers (example, hono, nitro-v2, nitro-v3, sveltekit) to use proper error discrimination

Extract step handler to dedicated file

Moved ~300 lines of step execution logic from runtime.ts into runtime/step-entrypoint.ts, reducing file size and improving organization. Exports stepEntrypoint and runStep from the new location.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • fonts.googleapis.com
    • Triggering command: /usr/local/bin/node /home/REDACTED/work/workflow/workflow/node_modules/.pnpm/next@15.5.4_@opentelemetry+api@1.9.0_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/next/dist/compiled/jest-worker/processChild.js (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

Find and fix some of the easiest/low hanging fruit TODOs across the codebase


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@changeset-bot
Copy link

changeset-bot bot commented Nov 7, 2025

⚠️ No Changeset found

Latest commit: 6e8e5cf

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

@vercel
Copy link
Contributor

vercel bot commented Nov 7, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
example-nextjs-workflow-turbopack Ready Ready Preview Comment Nov 7, 2025 8:19am
example-nextjs-workflow-webpack Ready Ready Preview Comment Nov 7, 2025 8:19am
example-workflow Ready Ready Preview Comment Nov 7, 2025 8:19am
workbench-nitro-workflow Ready Ready Preview Comment Nov 7, 2025 8:19am
workbench-nuxt-workflow Ready Ready Preview Comment Nov 7, 2025 8:19am
workbench-sveltekit-workflow Ready Ready Preview Comment Nov 7, 2025 8:19am
workbench-vite-workflow Ready Ready Preview Comment Nov 7, 2025 8:19am
workflow-docs Ready Ready Preview Comment Nov 7, 2025 8:19am

…k handlers

Co-authored-by: pranaygp <1797812+pranaygp@users.noreply.github.com>
Copilot AI and others added 2 commits November 7, 2025 08:15
Co-authored-by: pranaygp <1797812+pranaygp@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix low hanging fruit TODOs across the codebase Export WorkflowAPIError and refactor step handler into separate file Nov 7, 2025
Copilot finished work on behalf of pranaygp November 7, 2025 08:21
Copilot AI requested a review from pranaygp November 7, 2025 08:21
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.

2 participants