Skip to content

Compaction Fails with APIContextOverflow due to sending the wrong context length #476

@frosty00

Description

@frosty00

The token_size bug where it is not propagating the context_size correctly from #306 still exists during compaction

Error: compaction.failed APIContextOverflowError: 400 This endpoint's maximum context length is 262144 tokens. However, you requested about 264896 tokens (52139 of text input, 12757 of tool input, 200000 in the output). Please reduce the length of either one.

my config looks like this:

[models. "openrouter/kimi-k2.6"]
provider = "openrouter"
model = "moonshotai/kimi-k2.6:baidu"
max_context_size = 200000
max_output_size = 16384
max_tokens = 16384

It shouldn't be sending the max_context_size for the max_output_size when doing /compaction, it works normally for regular input, but crashes as soon as it tries to issue a /compaction command

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions