proxitor 0.13.0 → 0.14.0

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/README.md CHANGED
@@ -117,7 +117,7 @@ If the cache hit looks low, three levers fix it — tune them from `proxitor con
117
117
 
118
118
  - **`cacheControl`** — inject `cache_control` to activate caching (Anthropic-native).
119
119
  - **`sessionId`** — inject `session_id` so the provider pins from the first request.
120
- - **`normalizeVolatileSystem`** — strip Claude Code's volatile `cch` hash so the prefix cache warms on non-Anthropic providers (qwen/glm/…).
120
+ - **`normalizeVolatileSystem`** — strip Claude Code's volatile `cch`/`cc_version` hashes so the prefix cache warms on non-Anthropic providers (qwen/glm/…).
121
121
  - **`rewriteBlockTtl`** — normalize the TTL on Claude Code's block `cache_control` breakpoints to match your `cacheControlTtl`. Enable it (`auto`/`always`) if Anthropic rejects requests where the root `ttl` is `1h` but the block breakpoints stay at `5m`.
122
122
 
123
123
  See the [configuration reference](./docs/configuration.md#prompt-caching) for the full detail.
package/dist/cli.mjs CHANGED
@@ -18072,7 +18072,7 @@ async function collectCacheTriState(currentCc, currentTtl, globalTtl, currentRew
18072
18072
  };
18073
18073
  }
18074
18074
  async function collectNormalizeVolatileSystem(currentNvs) {
18075
- const nvs = await askNormalizeVolatileSystem("Normalize volatile system (cch hash)", currentNvs, { removable: true });
18075
+ const nvs = await askNormalizeVolatileSystem("Normalize volatile system (cch/cc_version hashes)", currentNvs, { removable: true });
18076
18076
  if (typeof nvs === "symbol") return null;
18077
18077
  if (nvs === "reset") return { normalizeVolatileSystem: { remove: true } };
18078
18078
  return { normalizeVolatileSystem: { value: nvs } };
@@ -18465,7 +18465,7 @@ async function normalizeVolatileSystemCommand(opts) {
18465
18465
  const raw = readConfigFileRaw(configPath).normalizeVolatileSystem;
18466
18466
  const effective = raw ?? DEFAULTS.normalizeVolatileSystem;
18467
18467
  log.info(`Current: normalizeVolatileSystem = ${raw === void 0 ? `(default -> ${effective ? "on" : "off"})` : effective}`);
18468
- const choice = await askNormalizeVolatileSystem("Normalize Claude Code's volatile cch hash in the system prompt? Stabilizes the prefix cache for non-Anthropic providers (qwen/glm/etc.).", raw, {
18468
+ const choice = await askNormalizeVolatileSystem("Normalize Claude Code's volatile cch and cc_version hashes in the system prompt? Stabilizes the prefix cache for non-Anthropic providers (qwen/glm/etc.).", raw, {
18469
18469
  removable: true,
18470
18470
  resetHint: `remove (default: ${DEFAULTS.normalizeVolatileSystem})`
18471
18471
  });
@@ -19393,7 +19393,7 @@ async function runConfigMenu(client) {
19393
19393
  }
19394
19394
  //#endregion
19395
19395
  //#region src/version.ts
19396
- const version = "0.13.0";
19396
+ const version = "0.14.0";
19397
19397
  //#endregion
19398
19398
  //#region src/commands/doctor.ts
19399
19399
  const DEFAULT_TIMEOUT_MS = 3e3;
@@ -23094,11 +23094,15 @@ const injectSessionId = createMiddleware(async (c, next) => {
23094
23094
  });
23095
23095
  //#endregion
23096
23096
  //#region src/proxy/middleware/normalize-volatile-system.ts
23097
- /** Normalize Claude Code's per-request `cch=…` hash in system[0] to a constant; it drifts every turn and breaks prefix-cache for non-Anthropic providers. */
23097
+ /** Normalize Claude Code's per-request volatile hashes in system[0] to constants; they drift every turn and break prefix-cache for non-Anthropic providers:
23098
+ * - `cch=…` per-turn hash
23099
+ * - `cc_version=<semver>.<hash>` — the trailing build hash drifts; the readable semver is preserved. */
23098
23100
  const CCH_PATTERN = /cch=[0-9a-f]+/g;
23099
23101
  const CCH_REPLACEMENT = "cch=00000";
23102
+ const CC_VERSION_PATTERN = /cc_version=(\d+\.\d+\.\d+)\.[0-9a-f]+/g;
23103
+ const CC_VERSION_REPLACEMENT = "cc_version=$1.0";
23100
23104
  function normalizeText(text) {
23101
- return text.replace(CCH_PATTERN, CCH_REPLACEMENT);
23105
+ return text.replace(CCH_PATTERN, CCH_REPLACEMENT).replace(CC_VERSION_PATTERN, CC_VERSION_REPLACEMENT);
23102
23106
  }
23103
23107
  function textOf(block) {
23104
23108
  if (block !== null && typeof block === "object" && typeof block.text === "string") return block.text;