opencode-acp 1.18.2-pr.471.204 → 1.18.2-pr.473.207
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
|
@@ -11086,7 +11086,7 @@ import { writeFile as writeFile2, mkdir as mkdir2 } from "fs/promises";
|
|
|
11086
11086
|
import { join as join4 } from "path";
|
|
11087
11087
|
import { existsSync as existsSync4 } from "fs";
|
|
11088
11088
|
import { homedir as homedir3 } from "os";
|
|
11089
|
-
var LOG_VERSION = true ? "1.18.2-pr.
|
|
11089
|
+
var LOG_VERSION = true ? "1.18.2-pr.473.207" : "dev";
|
|
11090
11090
|
var LEVEL_RANK = {
|
|
11091
11091
|
debug: 10,
|
|
11092
11092
|
info: 20,
|
|
@@ -11892,7 +11892,17 @@ var KEEP_PREFIX_CHARS = 2e3;
|
|
|
11892
11892
|
var KEEP_SUFFIX_CHARS = 2e3;
|
|
11893
11893
|
var PROTECT_RECENT_MESSAGES = 3;
|
|
11894
11894
|
var OUTPUT_RESERVE_TOKENS = 16384;
|
|
11895
|
+
var MAX_OVERHEAD_ERROR_SESSIONS = 1024;
|
|
11895
11896
|
var overheadErrorLogged = /* @__PURE__ */ new Set();
|
|
11897
|
+
function recordOverheadError(sessionKey) {
|
|
11898
|
+
if (overheadErrorLogged.has(sessionKey)) return false;
|
|
11899
|
+
if (overheadErrorLogged.size >= MAX_OVERHEAD_ERROR_SESSIONS) {
|
|
11900
|
+
const oldest = overheadErrorLogged.values().next().value;
|
|
11901
|
+
if (oldest !== void 0) overheadErrorLogged.delete(oldest);
|
|
11902
|
+
}
|
|
11903
|
+
overheadErrorLogged.add(sessionKey);
|
|
11904
|
+
return true;
|
|
11905
|
+
}
|
|
11896
11906
|
function parseGcThreshold(threshold, modelContextLimit) {
|
|
11897
11907
|
if (typeof threshold === "number") return threshold;
|
|
11898
11908
|
const str = threshold ?? "100%";
|
|
@@ -11910,8 +11920,7 @@ function truncateLargeToolOutputs(state, config, logger, messages) {
|
|
|
11910
11920
|
const threshold = Math.min(configuredThreshold, effective.limit - overhead);
|
|
11911
11921
|
if (threshold <= 0) {
|
|
11912
11922
|
const sessionKey = state.sessionId ?? "unknown";
|
|
11913
|
-
if (
|
|
11914
|
-
overheadErrorLogged.add(sessionKey);
|
|
11923
|
+
if (recordOverheadError(sessionKey)) {
|
|
11915
11924
|
logger.error("ACP: model context window too small to fit overhead", {
|
|
11916
11925
|
session: state.sessionId,
|
|
11917
11926
|
limit: effective.limit,
|
|
@@ -13773,7 +13782,7 @@ var server = (async (ctx) => {
|
|
|
13773
13782
|
}
|
|
13774
13783
|
const logger = new Logger(config.debug, config.debug ? "debug" : config.logLevel);
|
|
13775
13784
|
logger.info("ACP plugin initialized", {
|
|
13776
|
-
version: true ? "1.18.2-pr.
|
|
13785
|
+
version: true ? "1.18.2-pr.473.207" : "dev",
|
|
13777
13786
|
workspace: ctx.directory,
|
|
13778
13787
|
logLevel: logger.level,
|
|
13779
13788
|
debug: config.debug,
|