fix: emergency + nothing-to-compress emits /compact notice, not compress demands — issue #216 residual - #326
Open
ranxianglei wants to merge 6 commits into
Open
Conversation
The recommendation engine counted raw visible-message tokens without applying the compress pipeline's soft filters, overstating compressible content 3.6x in the incident (displayed 10.8K compressible resolved to 3066 chars in the pipeline). Ranges whose effective content falls below the pipeline-aligned floor (1250 tokens = minCompressRange 5000 chars / 4) are no longer recommended, displays show honest effective sizes, and the nudge stays silent when nothing is worth compressing.
…fixes E2E 06, keeps phantom guard
…ess demands — issue #216 residual
📦 Built Plugin ArtifactBranch: Option A — Install from npm PR tag (recommended)opencode plugin opencode-acp@pr-326 --globalEach push to this PR publishes a new version under the Option B — Install from GitHubopencode plugin "github:ranxianglei/opencode-acp#2026-08-20_emergency-nothing-compressible" --globalOption C — Download artifact
tar xzf opencode-acp-pr326.tgz
cp -r package/dist ~/.cache/opencode/packages/opencode-acp@latest/node_modules/opencode-acp/dist
This comment is automatically updated on each push. |
…rchive before compact/restart
…rgency emits notice
…l, not user-command execution
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
Incident
ses_7fb5cbc8(issue #37): user config set min/max context limits to 20%, making the session (55% actual) permanently emergency.inject.tsgated nudges with:The
emergencyOverridebypass demanded "Context limit reached — compress now" every turn even whennothingToCompresswas true — no valid targets existed, so the model retried phantom ranges and every failure re-armed the nudge (~12 failed compressions in the incident). This is the residual of issue #216's loop surviving the v1.14.4 fix through the emergency path.Fix
emergencyNoTargets = emergencyOverride && nothingToCompressshouldInjectNudge = nudgeAllowed && !nothingToCompress(emergency bypass removed)shouldInjectNotice = emergencyNoTargets && noticeCadenceMetinstead of compress instructionslastNudgeShownTokens+growthFloor— no per-turn naggingNotice Text Evolution (3 revisions, evidence-driven)
v1: "/compact / new session / relax protections" — user-command steps
v2 (user feedback "这种是不是export比较好"): export-first ordering
v3 (commit
8baebd2, incident ses_7fb5c607): model-actionable framing. A headlessopencode runmodel read the command steps as things IT should execute, looped 18 turns on retry-compare-reply, and died at 233K/262K context overflow. Slash commands are user-only in every mode — the model's ONLY viable action is informing the user. Notice now reads:Tests
inject.test.ts: notice content (incl. reply/message-tool framing), 3-turn cadence regression (§5.7.1), incident-shape phantom regression (sub-floor ranges), production-config preserve-recent zone (§5.7.1:preserveRecentMessages: 20)model-switch-limits.test.tsupdatedDual-Agent Review (both effectively APPROVE)
Oracle (3m20s): growthFloor math verified (22.5K @ 1M model); test config paths traced.
Explore (3v3m22s): all 4 emergency×compressibility combinations traced — no regression; all
lastNudgeShownTokensconsumers benign; "compress now" string only in gated paths; E2EdetectNudgeunaffected. Flagged §5.7.1 gap → addressed in cae3e94.Stacked On
PR #325 — merge that first; this branch is based on its tip (5924c69).
Config Note
User's global config also updated: 20%/20% → 80%/80% (matches repo defaults).