Skip to content

Conversation

@loza01
Copy link

@loza01 loza01 commented Feb 9, 2026

Description

Fixes #4112 the Haiku formatting 404 error by falling back to the default Sonnet model. to make sure the AI agent continues working even if the Haiku model is unavailable and logs failures for debugging.

When the Haiku formatting model (claude-3-5-haiku-20241022) is unavailable, the agent fails with a 404 error during formatting. This causes the agent workflow to break instead of continuing execution, even though a suitable fallback model (Sonnet) is available.

The error prevents normal agent operation and results in an avoidable failure when the Haiku model is deprecated, unavailable, or temporarily disabled

To Reproduce

Steps to reproduce the behavior:
1, Configure the agent to use the Haiku model for formatting
2, Run the agent using:
3,uv run python -m exports.my_agent --help

Observe the following error in the terminal:

Haiku formatting failed: Error code: 404 - {'type': 'error', 'error': {'type': 'not_found_error', 'message': 'model: claude-3-5-haiku-20241022'}}

Agent execution stops instead of continuing with a fallback model

Expected Behavior

If the Haiku formatting model is unavailable, the agent should gracefully fall back to the default Sonnet model, continue execution successfully, and log the failure for debugging purposes without breaking the workflow.

Environment

  • OS: Ubuntu 22.04
  • Python version: 3.11.x
  • Docker version (if applicable): Not applicable

Configuration

Relevant parts of the agent configuration or environment setup:
on bash

formatting_model: claude-3-5-haiku-20241022
fallback_model: default

Agent output after fallback confirms successful execution:

{
  "success": true,
  "output": {
    "product_description": "An AI-powered project management tool for remote teams"
  },
  "steps": 3,
  "path": [
    "analyze-audience",
    "generate-content",
    "review-and-refine"
  ]
}

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (if needed)
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Manual testing performed: ran uv run python -m exports.my_agent --help and confirmed output is generated with fallback

Type of Change

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

Copy link
Collaborator

@bryanadenhq bryanadenhq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, there seems to be a lot of changes that are committed that are completely unrelated to this change, would you please remove the unnecessary updates? Thanks for your contribution!

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.

[Bug]: Fix 404 Haiku error by switching to default Sonnet model (Fixes #4112)

2 participants