Skip to content

fix(engine): stop leaking errors from the operator - #5212

Merged
mrkaye97 merged 1 commit into
mainfrom
mk/operator-error-leaks
Oct 14, 2026
Merged

mrkaye97 merged 1 commit into
mainfrom
mk/operator-error-leaks

Conversation

@mrkaye97

Copy link
Copy Markdown
Contributor

Description

We keep leaking errors from the operator into task run errors, so this should help with that by just more explicitly handling more cases of errors

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Checklist

Changes have been:

  • Documented (where applicable)
  • Added to CHANGELOG (where applicable) -- see Keep a Changelog

🤖 AI Disclosure
  • I acknowledge that an LLM was used in the creation of this Pull Request, in accordance with Hatchet's AI_POLICY.md.
  • Details: Fable to implement

@vercel

vercel Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
hatchet-docs Ready Ready Preview Oct 14, 2026 9:43pm UTC

Request Review

@github-actions github-actions Bot added the engine Related to the core Hatchet engine label Oct 14, 2026
@greptile-apps

greptile-apps Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 4/5

[Medium impact] Changes error messages returned to clients from the orchestration engine.

The PR appears safe to merge, with a non-blocking gap in tests for DAG error messages.

Summary

The PR keeps operator details out of task errors.

  • DAG failures show task outcomes without exposing internal errors.
  • Refused actions show a retry message instead of handler errors.

The main improvement needed is direct regression coverage for the new DAG message rules.

Reviews (1) · Last reviewed commit: "fix: stop leaking errors over the operat..." · Reviewed by Greptile

@mrkaye97
mrkaye97 requested a review from juliusgeo October 14, 2026 21:46
Comment on lines +85 to +91
func clientErrorMessageForDagErr(err error) (message string, ok bool) {
var childFailedErr *dagChildFailedError
var cancelledErr *dagCancelledError
var conditionEvalErr *dagConditionEvalError
var celFailureErr *operator.DAGStepCELFailureError

return isDagChildFailedErr(err) ||
isDagConditionEvalErr(err) ||
isDagEngineErr(err) ||
errors.As(err, &celFailureErr) ||
errors.As(err, &nonDeterminismErr)
var nonDeterminismErr *repository.NonDeterminismError
var engineErr *dagEngineError

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.

P2 Error message rules lack tests

clientErrorMessageForDagErr changes which errors reach users, but no DAG tests cover its new behavior. Add table-driven tests for wrapped user-facing errors, wrapped internal errors, and both engine error types. Check that internal wrapper text stays hidden, nondeterminism details remain visible, and unspecified engine errors use the generic message. Without these checks, later changes could expose internal details or hide useful errors unnoticed. The updated host tests only cover refused actions.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

@mrkaye97
mrkaye97 merged commit 9d59e0d into main Oct 14, 2026
60 checks passed
@mrkaye97
mrkaye97 deleted the mk/operator-error-leaks branch October 14, 2026 22:09

This branch was successfully deployed

1 active deployment
Preview — adacc301 Deployed Oct 14, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

engine Related to the core Hatchet engine

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants