Skip to content

File exceeds context length Claude 4 but not Claude 3.7 #5861

@sbalk

Description

@sbalk

Before submitting your bug report

Relevant environment info

- OS: macOS 15.5
- Continue version: 1.0.10
- IDE version: VSCode 1.100.2
- Model: Claude Sonnet 4.0
- config:
  
  - name: Claude 4.0 Sonnet no context
    provider: anthropic
    model: claude-sonnet-4-20250514
    apiKey: same_key1
  - name: Claude 4.0 Sonnet with context
    provider: anthropic
    model: claude-sonnet-4-20250514
    apiKey: same_key1
    defaultCompletionOptions:
     contextLength: 100000
  - name: Claude 3.7 Sonnet
    provider: anthropic
    model: claude-3-7-sonnet-latest
    apiKey: same_key1

Description

I have nearly identical config files set up for claude 3.7 and 4.0 but 4.0 gives a vscode popup saying 'File exceeds context lenght'. 3.7 works fine. This happens on two computers (both macOS and vscode).

To reproduce

  1. save config.yaml:
- name: Claude 4.0 Sonnet no context
  provider: anthropic
  model: claude-sonnet-4-20250514
  apiKey: same_key1
- name: Claude 4.0 Sonnet with context
  provider: anthropic
  model: claude-sonnet-4-20250514
  apiKey: same_key1
  defaultCompletionOptions:
   contextLength: 100000
- name: Claude 3.7 Sonnet
  provider: anthropic
  model: claude-3-7-sonnet-latest
  apiKey: same_key1
  1. Select Claude 4.0 Sonnet no context or Claude 4.0 Sonnet with context in 'Select Model' dropdown.
  2. Add any file (as small as bytes)
  3. Get popup

Log output

No console logs are generated by this action.

Metadata

Metadata

Labels

area:context-providersRelates to context providerside:vscodeRelates specifically to VS Code extensionkind:bugIndicates an unexpected problem or unintended behavior

Type

No type
No fields configured for issues without a type.

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions