Skip to content

fix: nudgeGrowthTokens fixed default 50K — removes window-percentage scaling - #327

Open
ranxianglei wants to merge 3 commits into
masterfrom
2026-08-20_fixed-nudge-growth
Open

fix: nudgeGrowthTokens fixed default 50K — removes window-percentage scaling#327
ranxianglei wants to merge 3 commits into
masterfrom
2026-08-20_fixed-nudge-growth

Conversation

@ranxianglei

@ranxianglei ranxianglei commented Aug 20, 2026

Copy link
Copy Markdown
Owner

Problem

nudgeGrowthTokens was adaptive: min(50K, max(6K, modelContextLimit × 5%)) (cc-alg policy). This scaled the nudge growth gate, the T2/T3 tier triggers, and growthFloor by model window size — a 262K model (qwen3.8-27b) nudged at 13K growth while a 1M model (glm-5.3) required 50K. Observed in dog/billion-context-omp issues #3 vs #4 (same ACP config, 5× different compress-call frequency).

User ruling: design defect — the growth threshold must be fixed, not percentage-based.

Note: the inconsistency was worse than it looked — since v1.14.15, users with NO compress config got fixed 50K (config.ts default), while users with ANY compress key got the adaptive value (merge passes undefined through). Same config intent, different behavior.

Fix

  • DEFAULT_NUDGE_GROWTH_TOKENS = 50_000 replaces the adaptive wrapper (utils.ts)
  • inject.ts: config.compress?.nudgeGrowthTokens ?? DEFAULT_NUDGE_GROWTH_TOKENS — config override remains the single tuning knob
  • Uniform for ALL models: growth gate 50K, T2/T3 tier trigger 50K, growthFloor 22.5K (max(5000, 0.45×50K))
  • E2E harness pins nudgeGrowthTokens: 6000 (base config + scenario 08) — preserves prior scenario behavior (100K fake window had adaptive 6000)
  • Docs: CONFIGURATION.{md,zh-CN}.md, README.{md,zh-CN}.md, dcp.schema.json (nudgeGrowthTokens + toolOutputNudgeThreshold descriptions), model-limits.ts comment — all adaptive references removed

Verification

  • typecheck: 0 errors
  • Full suite: 1004 pass / 0 fail
  • E2E: scenarios 06/08 local pass; CI 6/6 green incl e2e
  • cc-alg package untouched (trigger-policy-integration.test.ts still passes against it directly)

Dual-Agent Review

Oracle (15m44s): verified single-resolution chain (inject.ts:250 → growthFloor/baseline-correction/pending-halving/computeShouldNudge/tier-gate), cc-alg computeShouldNudge is pure growth comparison (no hidden window scaling), config merge quirk analyzed (config.ts:371 undefined pass-through makes the inject.ts fallback load-bearing). Found: scenario 08 threshold regression (6000→50000 via config-replace semantics — was the CI e2e failure, fixed in 2906d77), stale dcp.schema.json:244 description with harmful "Must be unset (not 6000)" advice (fixed in f3e9826), stale model-limits.ts comment (fixed). Left as-is (LOW): trigger-policy-integration tests dependency API; constant test is a change-detector.

Explore (5m38s): zero leftover adaptive references in lib/; all nudgeGrowthTokens consumers traced to single resolution point; E2E JSON validity verified; found CONFIGURATION.md:249/256 wrong formula (× modelContextLimit× nudgeGrowthTokens) (fixed in 2906d77) and schema toolOutputNudgeThreshold stale text (fixed).

Behavior Change

Small-window models (≤1M) now nudge less often than before (50K fixed vs window×5%). E.g. qwen 262K: was 13.1K growth → now 50K. This is the intended design correction.

@github-actions

github-actions Bot commented Aug 20, 2026

Copy link
Copy Markdown

📦 Built Plugin Artifact

Branch: 2026-08-20_fixed-nudge-growth (f3e9826)

Option A — Install from npm PR tag (recommended)

opencode plugin opencode-acp@pr-327 --global

Each push to this PR publishes a new version under the pr-327 npm tag.

Option B — Install from GitHub

opencode plugin "github:ranxianglei/opencode-acp#2026-08-20_fixed-nudge-growth" --global

Option C — Download artifact

  1. Download the artifact from the Actions run
  2. Extract the tarball and install:
tar xzf opencode-acp-pr327.tgz
cp -r package/dist ~/.cache/opencode/packages/opencode-acp@latest/node_modules/opencode-acp/dist
  1. Restart opencode to pick up changes.

This comment is automatically updated on each push.

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.

1 participant