Skip to content

fix(runtime): preserve structured operation and reason in OperationFailedError#440

Closed
hiro-nikaitou wants to merge 1 commit into
withastro:mainfrom
hiro-nikaitou:fix/operation-failed-error-structured-meta
Closed

fix(runtime): preserve structured operation and reason in OperationFailedError#440
hiro-nikaitou wants to merge 1 commit into
withastro:mainfrom
hiro-nikaitou:fix/operation-failed-error-structured-meta

Conversation

@hiro-nikaitou

@hiro-nikaitou hiro-nikaitou commented Jul 6, 2026

Copy link
Copy Markdown

Problem

OperationFailedError hardcodes details: '' and omits meta, so the serialized error on a failed dispatched operation contains no structured data. Downstream error trackers must regex-parse the prose message to recover the operation name and underlying reason, which breaks issue grouping (the embedded dispatch UUID makes every occurrence a unique message) and prevents programmatic classification.

Closes #431.

Changes

packages/runtime/src/errors.ts — two changes in OperationFailedError:

  1. details is now populated with reason instead of '', so callers receive the underlying failure text as structured detail rather than having to extract it from the prose message.
  2. meta now carries { operation, reason }, matching the pattern used by other FlueError subclasses (e.g. CloudflareAIBindingError, AttachmentLoadingError).

Verification

Tested on Windows 11 (Git Bash / pnpm 11.1.1):

  • pnpm test --filter=@flue/runtime: 47/48 test files passed, 771/784 tests passed.
  • The 1 failure (node-local-sandbox.test.ts) is a pre-existing Windows-specific EBUSY: resource busy or locked cleanup issue — unrelated to this change.
  • TypeScript compilation passes cleanly.
  • The change is additive: no existing behavior is modified, only structured data is now passed through.

…iledError

OperationFailedError was hardcoding details: '' and omitting meta,
so the serialized error on a failed dispatched operation contained
no structured data — downstream error trackers had to regex-parse
the prose message to recover the operation name and underlying
reason.

Fix: pass reason as details and carry both operation and reason
as structured meta, matching the pattern used by other FlueError
subclasses throughout the codebase.

Closes withastro#431

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@astrobot-houston

Copy link
Copy Markdown

Thanks for the contribution! We're closing this PR and moving the conversation to the issue: #441

We've moved to a model where bugs and feature proposals are discussed in issues/discussions before code review, so the community can help prioritize and shape the work. Your branch is linked from the new thread so the implementation isn't lost — please join us there to continue the conversation.

— astrobot 🤖

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.

OperationFailedError drops structured failure detail at construction (details: '', no meta), leaving only prose

2 participants