Skip to content

[Bug]: Growth nudges ignore minContextLimit and fire below it #342

Description

@bernhardberger

Bug description

ACP injects T1 compression nudges well below a configured model-specific minContextLimit.

I am using a 400K-context model with these settings:

{
  "compress": {
    "modelMinLimits": {
      "openai/gpt-5.6-sol": 150000
    },
    "modelMaxLimits": {
      "openai/gpt-5.6-sol": 215000
    },
    "nudgeGrowthTokens": 50000,
    "nudgeForce": "soft"
  }
}

The minimum is 150K, or 37.5% of the model window. During about two hours of normal use, ACP logged ten regular compression nudges. All ten had trigger=growth; none was caused by the 215K maximum. They fired at these context sizes:

67,068
82,172
83,594
86,384
90,162
90,510
102,299
132,826
140,552
152,500

Some representative log entries:

Compression nudge injected | trigger=growth currentTokens=67068 usagePct=16.8% growthSinceBaseline=66852 growthFloor=22500 recommendedRanges=1
Compression nudge injected | trigger=growth currentTokens=90510 usagePct=22.6% growthSinceBaseline=89710 growthFloor=22500 recommendedRanges=1
Compression nudge injected | trigger=growth currentTokens=102299 usagePct=25.6% growthSinceBaseline=60402 growthFloor=22500 recommendedRanges=3
Compression nudge injected | trigger=growth currentTokens=140552 usagePct=35.1% growthSinceBaseline=52564 growthFloor=22500 recommendedRanges=2
Compression nudge injected | trigger=growth currentTokens=152500 usagePct=38.1% growthSinceBaseline=54338 growthFloor=22500 recommendedRanges=2

The model normally follows the nudge and compresses old ranges, so its working context tends to stay around 80K to 150K instead of reaching the configured minimum.

Expected behavior

I expected the limits to work like this:

T1 efficiency nudge = currentTokens >= minContextLimit
                       AND growth >= nudgeGrowthTokens

T1 maximum nudge    = currentTokens >= maxContextLimit

T2/T3 nudge         = accumulated summary threshold

In this configuration, routine T1 compression would start after 150K, with stronger pressure at 215K. T2 and T3 consolidation should remain independent because it is useful even when the current working context is small.

Source findings

The runtime behavior matches the current source:

  • computeShouldNudge() uses growthSinceLastNudge >= nudgeGrowthTokens || overMaxLimit.
  • overMinLimit selects the message variant but does not gate shouldNudge.
  • lib/messages/inject/utils.ts marks minNudgeContextPercent as deprecated and ignored.
  • lib/messages/inject/inject.ts passes overMinLimit into the decision but does not require it in nudgeAllowed.

This also means that raising modelMinLimits does not delay growth nudges. Raising nudgeGrowthTokens is not a clean workaround because the same setting controls T2 and T3 promotion.

Issue #300 covers percentage-based nudgeGrowthTokens and the broader decision chain. This report is narrower: a configured lower context limit does not act as a lower limit for T1 growth nudges. The explanation in issue #340 also says nudges require the context to exceed the minimum and pass the growth threshold, which does not match the current runtime behavior.

If bypassing minContextLimit is intentional, a separate T1 growth floor or a separate tier-promotion threshold would make this policy configurable without coupling unrelated behavior.

Environment

  • opencode-acp: 1.14.25
  • context-compress-algorithms: 1.3.0
  • OpenCode: 1.18.23
  • Model: openai/gpt-5.6-sol
  • Model context window detected by ACP: 400,000 tokens

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions