Skip to content

Conversation

@kwsantiago
Copy link
Contributor

@kwsantiago kwsantiago commented Aug 7, 2025

Implements middle-out message compression for OpenRouter to handle context limit errors by removing messages from the middle of conversations when limits are exceeded, auto-enabling for models ≤8k context.

For reference: #3881 (comment)

@kwsantiago kwsantiago force-pushed the kwsantiago/openrouter-middle-out-support branch from 5fac467 to 5376191 Compare August 7, 2025 01:53
@michaelneale
Copy link
Collaborator

@kwsantiago thanks - but if I read correctly, there is no need to conditionally apply this, we can just always have it set for openrouter, it doesn't seem to do anything until it needs to, ie more of a safeguard if I read it correctly?

https://openrouter.ai/docs/features/message-transforms

but I am trying the simple approach first in the other branch (will report back if not good).

1 similar comment
@michaelneale
Copy link
Collaborator

@kwsantiago thanks - but if I read correctly, there is no need to conditionally apply this, we can just always have it set for openrouter, it doesn't seem to do anything until it needs to, ie more of a safeguard if I read it correctly?

https://openrouter.ai/docs/features/message-transforms

but I am trying the simple approach first in the other branch (will report back if not good).

@kwsantiago
Copy link
Contributor Author

Sounds good @michaelneale I'll leave this branch as is for the time being.

If you need me to make any changes here or close this out, please let me know. Cheers!

@michaelneale
Copy link
Collaborator

closing this as will be addressed in other PR, thanks again @kwsantiago this was really cool

@kwsantiago kwsantiago deleted the kwsantiago/openrouter-middle-out-support branch August 8, 2025 01:21
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.

2 participants