fix: nudgeGrowthTokens fixed default 50K — removes window-percentage scaling - #327
Open
ranxianglei wants to merge 3 commits into
Open
fix: nudgeGrowthTokens fixed default 50K — removes window-percentage scaling#327ranxianglei wants to merge 3 commits into
ranxianglei wants to merge 3 commits into
Conversation
…scaling (user design ruling)
📦 Built Plugin ArtifactBranch: Option A — Install from npm PR tag (recommended)opencode plugin opencode-acp@pr-327 --globalEach push to this PR publishes a new version under the Option B — Install from GitHubopencode plugin "github:ranxianglei/opencode-acp#2026-08-20_fixed-nudge-growth" --globalOption C — Download artifact
tar xzf opencode-acp-pr327.tgz
cp -r package/dist ~/.cache/opencode/packages/opencode-acp@latest/node_modules/opencode-acp/dist
This comment is automatically updated on each push. |
…stale adaptive docs
…e adaptive advice (Oracle review)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
nudgeGrowthTokenswas 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_000replaces the adaptive wrapper (utils.ts)inject.ts:config.compress?.nudgeGrowthTokens ?? DEFAULT_NUDGE_GROWTH_TOKENS— config override remains the single tuning knobmax(5000, 0.45×50K))nudgeGrowthTokens: 6000(base config + scenario 08) — preserves prior scenario behavior (100K fake window had adaptive 6000)Verification
trigger-policy-integration.test.tsstill 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.