opencode-acp 1.18.2-pr.443.189 → 1.18.2-pr.447.191

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
@@ -6384,24 +6384,32 @@ function computeStats(plan) {
6384
6384
  const retentionPct = originalTokens > 0 ? (summaryChars / (originalTokens * 4) * 100).toFixed(2) : "?";
6385
6385
  return { originalTokens, summaryChars, ratio, retentionPct };
6386
6386
  }
6387
- function buildQualityRejectionError(plan, result) {
6387
+ function coreReason(reason) {
6388
+ if (!reason) return "unknown";
6389
+ const candidates = [reason.indexOf(":"), reason.indexOf("(")].filter((i) => i >= 0);
6390
+ const cut = Math.min(...candidates);
6391
+ return (cut > 0 ? reason.slice(0, cut) : reason).trim() || "unknown";
6392
+ }
6393
+ function buildQualityRejectionError(plan, result, logger) {
6388
6394
  const stats = computeStats(plan);
6389
- const metrics = [
6390
- `Reason: ${result.reason || "unknown"}`,
6391
- `Original: ~${stats.originalTokens} tokens`,
6392
- `Summary: ${stats.summaryChars} chars`,
6393
- `Ratio: ${stats.ratio}:1`,
6394
- `Retention: ${stats.retentionPct}%`,
6395
- `Gate layer: ${result.layer ?? "unknown"}`,
6396
- `rougeF1: ${formatMetric(result, "rougeF1")}`,
6397
- `top20Recall: ${formatMetric(result, "top20Recall")}`
6398
- ];
6395
+ logger?.warn("quality gate rejected compression", {
6396
+ range: `${plan.startId}\u2013${plan.endId}`,
6397
+ reason: result.reason || "unknown",
6398
+ layer: result.layer ?? "unknown",
6399
+ originalTokens: stats.originalTokens,
6400
+ summaryChars: stats.summaryChars,
6401
+ ratio: stats.ratio,
6402
+ retentionPct: stats.retentionPct,
6403
+ rougeF1: formatMetric(result, "rougeF1"),
6404
+ top20Recall: formatMetric(result, "top20Recall")
6405
+ });
6399
6406
  const message = `\u26A0\uFE0F COMPRESSION REJECTED \u2014 QUALITY GATE FAILURE
6400
6407
 
6401
6408
  Range: ${plan.startId}\u2013${plan.endId}
6402
- ${metrics.join("\n")}
6409
+ Reason: ${coreReason(result.reason)}
6410
+ Original: ~${stats.originalTokens} tokens \xB7 Summary: ${stats.summaryChars} chars \xB7 Retention: ${stats.retentionPct}%
6403
6411
 
6404
- Retry: rewrite a more complete summary that preserves critical details (file paths, decisions, exact values, errors) and call compress again on the same range \u2014 the gate re-evaluates automatically. Full compression rules are already in your system prompt. If you are confident the summary is correct despite the metrics, add "acknowledgeRisk": true to bypass the quality gate on your next compress call.`;
6412
+ Retry: write a more complete summary preserving critical details (file paths, decisions, exact values, errors), then call compress again on the same range. If you are confident the summary is adequate despite the metrics, pass "acknowledgeRisk": true.`;
6405
6413
  return new Error(message);
6406
6414
  }
6407
6415
 
@@ -8063,7 +8071,8 @@ function createCompressRangeTool(factoryCtx) {
8063
8071
  messageIds: plan.selection.messageIds,
8064
8072
  messageTokenById: plan.selection.messageTokenById
8065
8073
  },
8066
- result
8074
+ result,
8075
+ ctx.logger
8067
8076
  );
8068
8077
  }
8069
8078
  }
@@ -10906,7 +10915,7 @@ import { writeFile as writeFile2, mkdir as mkdir2 } from "fs/promises";
10906
10915
  import { join as join4 } from "path";
10907
10916
  import { existsSync as existsSync4 } from "fs";
10908
10917
  import { homedir as homedir3 } from "os";
10909
- var LOG_VERSION = true ? "1.18.2-pr.443.189" : "dev";
10918
+ var LOG_VERSION = true ? "1.18.2-pr.447.191" : "dev";
10910
10919
  var LEVEL_RANK = {
10911
10920
  debug: 10,
10912
10921
  info: 20,
@@ -13624,7 +13633,7 @@ var server = (async (ctx) => {
13624
13633
  }
13625
13634
  const logger = new Logger(config.debug, config.debug ? "debug" : config.logLevel);
13626
13635
  logger.info("ACP plugin initialized", {
13627
- version: true ? "1.18.2-pr.443.189" : "dev",
13636
+ version: true ? "1.18.2-pr.447.191" : "dev",
13628
13637
  workspace: ctx.directory,
13629
13638
  logLevel: logger.level,
13630
13639
  debug: config.debug,