Skip to content

Conversation

@continue
Copy link
Contributor

@continue continue bot commented Oct 9, 2025

Problem

Compaction was failing silently with Claude 4 Sonnet, showing the error:

HTTP 500 Internal Server Error from https://api.continue.dev/model-proxy/v1/chat/completions

Error in Continue server: 400 Provider returned error

Root Cause

The conversation history messages being sent to the model during compaction contained images, which Claude 4 Sonnet doesn't support in all API contexts. The Continue proxy was forwarding the request to Anthropic, which returned a 400 error.

Solution

  1. Enhanced error messages - Improved HTTP error reporting to include status code, status text, and URL for better debugging
  2. Strip images from messages - Remove image content from all messages before sending to compaction to avoid API errors

Changes

  • packages/fetch/src/stream.ts: Enhanced HTTP error message to include more context
  • core/util/conversationCompaction.ts: Strip images from all conversation messages before compaction

Testing

  • Tested compaction with Claude 4 Sonnet
  • Verified error messages are more informative

Fixes CON-4150


This agent session was co-authored by nate and Continue.


Summary by cubic

Fixes compaction failures with Claude 4 Sonnet by stripping image content from conversation messages and improving HTTP error reporting. Addresses CON-4150.

  • Bug Fixes
    • Remove images from user, assistant, thinking, and system messages before compaction to prevent Anthropic 400 errors.
    • Include status code, status text, and request URL in HTTP error messages for easier debugging.

…ssages

- Enhanced HTTP error messages to include status code, status text, and URL for better debugging
- Strip images from all conversation messages before compaction to avoid API errors
- Claude 4 Sonnet and other models may not support images in all API contexts

Fixes CON-4150

Generated with [Continue](https://continue.dev)

Co-Authored-By: Continue <[email protected]>
Co-authored-by: nate <[email protected]>
@TyDunn TyDunn marked this pull request as ready for review October 9, 2025 17:58
@TyDunn TyDunn requested a review from a team as a code owner October 9, 2025 17:58
@TyDunn TyDunn requested review from sestinj and removed request for a team October 9, 2025 17:58
@dosubot dosubot bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Oct 9, 2025
@github-actions
Copy link

github-actions bot commented Oct 9, 2025

⚠️ PR Title Format

Your PR title doesn't follow the conventional commit format, but this won't block your PR from being merged. We recommend using this format for better project organization.

Expected Format:

<type>[optional scope]: <description>

Examples:

  • feat: add changelog generation support
  • fix: resolve login redirect issue
  • docs: update README with new instructions
  • chore: update dependencies

Valid Types:

feat, fix, docs, style, refactor, perf, test, build, ci, chore, revert

This helps with:

  • 📝 Automatic changelog generation
  • 🚀 Automated semantic versioning
  • 📊 Better project history tracking

This is a non-blocking warning - your PR can still be merged without fixing this.

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 2 files

@sestinj
Copy link
Contributor

sestinj commented Oct 17, 2025

not sure this makes sense

@sestinj sestinj closed this Oct 17, 2025
@github-project-automation github-project-automation bot moved this from Todo to Done in Issues and PRs Oct 17, 2025
@github-actions github-actions bot locked and limited conversation to collaborators Oct 17, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

size:S This PR changes 10-29 lines, ignoring generated files.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants