In class LLM in llm.py, the optional argument "token_limit" which is then an instance attribute with the same name, is not used to override MAX_TOKEN_LIMIT. The result is that with models with smaller context windows than Claude Sonnet 3.7, an exception can occur if the model's true context window is smaller than page_count * self.DEFAULT_PAGE_TOKENS, even when the optional argument "token_limit" is set.
In class LLM in llm.py, the optional argument "token_limit" which is then an instance attribute with the same name, is not used to override MAX_TOKEN_LIMIT. The result is that with models with smaller context windows than Claude Sonnet 3.7, an exception can occur if the model's true context window is smaller than page_count * self.DEFAULT_PAGE_TOKENS, even when the optional argument "token_limit" is set.