Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: The new system prompt is almost 6k, too large for GPT-4 #7259

Open
1 task done
enyst opened this issue Mar 14, 2025 · 2 comments
Open
1 task done

[Bug]: The new system prompt is almost 6k, too large for GPT-4 #7259

enyst opened this issue Mar 14, 2025 · 2 comments
Labels
bug Something isn't working

Comments

@enyst
Copy link
Collaborator

enyst commented Mar 14, 2025

Is there an existing issue for the same bug?

  • I have checked the existing issues.

Describe the bug and reproduction steps

GPT-4 is unusable after 0.28.1, the app fails immediately with a ContextWindowExceeededError.

The underlying error is:

("litellm.BadRequestError: ContextWindowExceededError: OpenAIException - This model's maximum context length is 8192 tokens. 
However, you requested 9836 tokens (5740 in the messages, 4096 in the completion). 
Please reduce the length of the messages or completion.",)

Ugh.

  1. 5740 input tokens at the first request is due in part to the system prompt change. The old prompt was 3-4k.

  2. I think the error itself is something that openai and anthropic have done since reasoning models: they enforce now a context limit beforehand, at input_tokens + max_tokens.

The old behavior used to be different: this case was allowed by the API, and the API would simply cut off the response if it became too large for the context window. Now we can't send 4096 max. 🤔

OpenHands Installation

Docker command in README

OpenHands Version

No response

Operating System

None

Logs, Errors, Screenshots, and Additional Context

No response

@enyst enyst added the bug Something isn't working label Mar 14, 2025
@enyst
Copy link
Collaborator Author

enyst commented Mar 14, 2025

While the error is different (no tool use), this is related to:

It might be fixed or alleviated by

Maybe with a tweak to apply to GPT-4. cc: @ryanhoangt

@mamoodi
Copy link
Collaborator

mamoodi commented Mar 28, 2025

This still happens with the latest releases so still an issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants