Skip to content

Log workflow errors by default#1081

Merged
threepointone merged 1 commit intomainfrom
log-workflow-errors
Mar 7, 2026
Merged

Log workflow errors by default#1081
threepointone merged 1 commit intomainfrom
log-workflow-errors

Conversation

@threepointone
Copy link
Copy Markdown
Contributor

Adds a default console.error implementation to onWorkflowError() so unhandled workflow errors are visible in logs, with a message guiding developers to override it.

Also removes underscore prefixes from unused params in other workflow callback stubs (onWorkflowProgress, onWorkflowComplete, onWorkflowEvent) for consistency.

Includes a patch changeset for the agents package.

Add default console.error logging in Agent.onWorkflowError so unhandled workflow errors are visible in logs. Update Agent method signatures to remove underscore-prefixed unused params and add oxlint disable comments. Modify example workflow to inject a maybeThrow() helper and call it at validate/process/finalize steps to simulate random failures for testing. Include a changeset recording the patch for the agents package.
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Mar 7, 2026

🦋 Changeset detected

Latest commit: c0b2ae9

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

This PR includes changesets to release 1 package
Name Type
agents 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

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Mar 7, 2026

Open in StackBlitz

npm i https://pkg.pr.new/agents@1081
npm i https://pkg.pr.new/@cloudflare/ai-chat@1081
npm i https://pkg.pr.new/@cloudflare/codemode@1081
npm i https://pkg.pr.new/hono-agents@1081

commit: 587f5bd

@threepointone threepointone merged commit 933b00f into main Mar 7, 2026
3 checks passed
@threepointone threepointone deleted the log-workflow-errors branch March 7, 2026 09:38
@github-actions github-actions bot mentioned this pull request Mar 7, 2026
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