Skip to content

Enable custom exception types for workflow failures #270

Description

@cdgamarose-nv

Custom exception types for workflow failures.
In @src/aiq_agent/agents/deep_researcher/agent.py

Lines 215 and 234 raise ValueError for runtime workflow failures (no markdown output, no valid citations). These are not programming errors but legitimate failure modes of the LLM-driven workflow. Custom exception types (e.g., WorkflowOutputError, CitationValidationError) would:

  1. Allow callers to distinguish workflow failures from actual programming errors
  2. Enable more precise error handling and retry logic at higher layers
  3. Provide clearer semantics than generic ValueError

Note that line 243 already uses the custom EmptySourceRegistryError for similar conditions.

Also applies to: 233-234

Originally posted by @coderabbitai[bot] in #267 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions