opencode-acp 1.14.22-pr.325.40 → 1.14.22-pr.326.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js
CHANGED
|
@@ -7677,8 +7677,11 @@ var injectCompressNudges = (state, config, logger, messages, prompts, compressio
|
|
|
7677
7677
|
const allInProtectedZone = protectedRefs.size > 0 && unprotectedCompressible.length === 0;
|
|
7678
7678
|
const allBelowMin = contextRanges.compressible.length > 0 && recommendedRanges.length === 0;
|
|
7679
7679
|
const nothingToCompress = allProtected || allInProtectedZone || allBelowMin;
|
|
7680
|
-
const
|
|
7681
|
-
|
|
7680
|
+
const emergencyNoTargets = emergencyOverride && nothingToCompress;
|
|
7681
|
+
const noticeCadenceMet = state.nudges.lastNudgeShownTokens === void 0 || growthSinceBaseline !== void 0 && growthSinceBaseline >= growthFloor;
|
|
7682
|
+
const shouldInjectNudge = nudgeAllowed && !nothingToCompress;
|
|
7683
|
+
const shouldInjectNotice = emergencyNoTargets && noticeCadenceMet;
|
|
7684
|
+
let shouldInject = shouldInjectNudge || shouldInjectNotice;
|
|
7682
7685
|
if (shouldInjectNudge) {
|
|
7683
7686
|
applyAnchoredNudges(state, config, messages, prompts, compressionPriorities, currentTokens, modelContextLimit, suffixMessage);
|
|
7684
7687
|
}
|
|
@@ -7812,8 +7815,18 @@ ${formatCompressibleRanges(recommendedRanges, contextRanges.protected)}`;
|
|
|
7812
7815
|
Use \`acp_status({scope:"uncompressed"})\` to re-fetch compressible ranges after compressing, or \`acp_status\` for compressed block details.`;
|
|
7813
7816
|
appendToLastTextPart(suffixMessage, breakdown);
|
|
7814
7817
|
}
|
|
7815
|
-
if (effectiveTipsVariant === "maxLimit") {
|
|
7818
|
+
if (effectiveTipsVariant === "maxLimit" && !emergencyNoTargets) {
|
|
7816
7819
|
tipsText = "\n\n\u26A0\uFE0F Context limit reached \u2014 compress now. Prioritize consumed tool outputs.\n\n" + HOW_TO_COMPRESS_RULES + '\n\n{ "topic": "...", "content": [{ "startId": "<ID>", "endId": "<ID>", "summary": "..." }] }\n\nOnly use IDs from visible messages above. Compress older work first.';
|
|
7820
|
+
} else if (shouldInjectNotice) {
|
|
7821
|
+
const emergencyPct = currentTokens !== void 0 && modelContextLimit !== void 0 && modelContextLimit > 0 ? Math.round(currentTokens / modelContextLimit * 100) : void 0;
|
|
7822
|
+
tipsText = `
|
|
7823
|
+
|
|
7824
|
+
\u{1F6A8} Context is critically full${emergencyPct !== void 0 ? ` (${emergencyPct}% of limit)` : ""} and there is nothing left that can be safely compressed.
|
|
7825
|
+
Do NOT retry compress on the same ranges \u2014 they will keep failing.
|
|
7826
|
+
Recommended actions:
|
|
7827
|
+
1. Use OpenCode's built-in /compact to compact the whole session
|
|
7828
|
+
2. Or start a new session (this session's compression summaries remain available)
|
|
7829
|
+
3. Or ask the user to relax protected-tool / preserve-recent settings`;
|
|
7817
7830
|
}
|
|
7818
7831
|
state.nudges.lastNudgeShownTokens = currentTokens;
|
|
7819
7832
|
{
|
|
@@ -9066,7 +9079,7 @@ import { writeFile as writeFile2, mkdir as mkdir2 } from "fs/promises";
|
|
|
9066
9079
|
import { join as join3 } from "path";
|
|
9067
9080
|
import { existsSync as existsSync3 } from "fs";
|
|
9068
9081
|
import { homedir as homedir3 } from "os";
|
|
9069
|
-
var LOG_VERSION = true ? "1.14.22-pr.
|
|
9082
|
+
var LOG_VERSION = true ? "1.14.22-pr.326.41" : "dev";
|
|
9070
9083
|
var Logger = class {
|
|
9071
9084
|
logDir;
|
|
9072
9085
|
enabled;
|