localclawd 2.2.2 → 2.2.3

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.
Files changed (2) hide show
  1. package/dist/cli.mjs +264 -219
  2. package/package.json +1 -1
package/dist/cli.mjs CHANGED
@@ -36482,6 +36482,7 @@ var init_config = __esm(() => {
36482
36482
  "hasUsedBackslashReturn",
36483
36483
  "autoCompactEnabled",
36484
36484
  "compactContextWindowTokens",
36485
+ "contextWindowOverrides",
36485
36486
  "localBackendProvider",
36486
36487
  "localBackendBaseUrl",
36487
36488
  "localBackendModel",
@@ -87621,7 +87622,7 @@ var init_isEqual = __esm(() => {
87621
87622
 
87622
87623
  // src/utils/userAgent.ts
87623
87624
  function getClaudeCodeUserAgent() {
87624
- return `claude-code/${"2.2.2"}`;
87625
+ return `claude-code/${"2.2.3"}`;
87625
87626
  }
87626
87627
 
87627
87628
  // src/utils/workloadContext.ts
@@ -87643,7 +87644,7 @@ function getUserAgent() {
87643
87644
  const clientApp = process.env.CLAUDE_AGENT_SDK_CLIENT_APP ? `, client-app/${process.env.CLAUDE_AGENT_SDK_CLIENT_APP}` : "";
87644
87645
  const workload = getWorkload();
87645
87646
  const workloadSuffix = workload ? `, workload/${workload}` : "";
87646
- return `claude-cli/${"2.2.2"} (${process.env.USER_TYPE}, ${process.env.CLAUDE_CODE_ENTRYPOINT ?? "cli"}${agentSdkVersion}${clientApp}${workloadSuffix})`;
87647
+ return `claude-cli/${"2.2.3"} (${process.env.USER_TYPE}, ${process.env.CLAUDE_CODE_ENTRYPOINT ?? "cli"}${agentSdkVersion}${clientApp}${workloadSuffix})`;
87647
87648
  }
87648
87649
  function getMCPUserAgent() {
87649
87650
  const parts = [];
@@ -87657,7 +87658,7 @@ function getMCPUserAgent() {
87657
87658
  parts.push(`client-app/${process.env.CLAUDE_AGENT_SDK_CLIENT_APP}`);
87658
87659
  }
87659
87660
  const suffix = parts.length > 0 ? ` (${parts.join(", ")})` : "";
87660
- return `claude-code/${"2.2.2"}${suffix}`;
87661
+ return `claude-code/${"2.2.3"}${suffix}`;
87661
87662
  }
87662
87663
  function getWebFetchUserAgent() {
87663
87664
  return `Claude-User (${getClaudeCodeUserAgent()}; +https://support.anthropic.com/)`;
@@ -95513,6 +95514,16 @@ var init_modelCapabilities = __esm(() => {
95513
95514
  });
95514
95515
 
95515
95516
  // src/utils/context.ts
95517
+ function getContextWindowOverrideKey(model) {
95518
+ return `${getCwd()}|${model}`;
95519
+ }
95520
+ function getContextWindowOverride(model) {
95521
+ const overrides = getGlobalConfig().contextWindowOverrides;
95522
+ if (!overrides)
95523
+ return;
95524
+ const v = overrides[getContextWindowOverrideKey(model)];
95525
+ return typeof v === "number" && v > 0 ? v : undefined;
95526
+ }
95516
95527
  function getEnvAlias2(localKey, legacyKey) {
95517
95528
  return process.env[localKey] ?? process.env[legacyKey];
95518
95529
  }
@@ -95561,6 +95572,9 @@ function getContextWindowForModel(model, betas) {
95561
95572
  if (has1mContext(model)) {
95562
95573
  return 1e6;
95563
95574
  }
95575
+ const projectOverride = getContextWindowOverride(model);
95576
+ if (projectOverride)
95577
+ return projectOverride;
95564
95578
  const persisted = getGlobalConfig().compactContextWindowTokens;
95565
95579
  if (persisted && persisted > 0) {
95566
95580
  return persisted;
@@ -95691,6 +95705,7 @@ function getMaxThinkingTokensForModel(model) {
95691
95705
  var MODEL_CONTEXT_WINDOW_DEFAULT = 131072, COMPACT_CONTEXT_WINDOW_CHOICES, COMPACT_MAX_OUTPUT_TOKENS = 20000, MAX_OUTPUT_TOKENS_DEFAULT = 32000, MAX_OUTPUT_TOKENS_UPPER_LIMIT = 64000, CAPPED_DEFAULT_MAX_TOKENS = 8000, ESCALATED_MAX_TOKENS = 64000, _localProviderContextWindow = null;
95692
95706
  var init_context = __esm(() => {
95693
95707
  init_betas();
95708
+ init_cwd();
95694
95709
  init_config();
95695
95710
  init_envUtils();
95696
95711
  init_model();
@@ -130808,7 +130823,7 @@ function getAttributionHeader(fingerprint) {
130808
130823
  if (!isAttributionHeaderEnabled()) {
130809
130824
  return "";
130810
130825
  }
130811
- const version = `${"2.2.2"}.${fingerprint}`;
130826
+ const version = `${"2.2.3"}.${fingerprint}`;
130812
130827
  const entrypoint = process.env.CLAUDE_CODE_ENTRYPOINT ?? "unknown";
130813
130828
  const cch = "";
130814
130829
  const workload = getWorkload();
@@ -146995,7 +147010,7 @@ var init_metadata = __esm(() => {
146995
147010
  COMPOUND_OPERATOR_REGEX = /\s*(?:&&|\|\||[;|])\s*/;
146996
147011
  WHITESPACE_REGEX = /\s+/;
146997
147012
  getVersionBase = memoize_default(() => {
146998
- const match = "2.2.2".match(/^\d+\.\d+\.\d+(?:-[a-z]+)?/);
147013
+ const match = "2.2.3".match(/^\d+\.\d+\.\d+(?:-[a-z]+)?/);
146999
147014
  return match ? match[0] : undefined;
147000
147015
  });
147001
147016
  buildEnvContext = memoize_default(async () => {
@@ -147035,9 +147050,9 @@ var init_metadata = __esm(() => {
147035
147050
  isGithubAction: isEnvTruthy(process.env.GITHUB_ACTIONS),
147036
147051
  isClaudeCodeAction: isEnvTruthy(process.env.CLAUDE_CODE_ACTION),
147037
147052
  isClaudeAiAuth: isClaudeAISubscriber(),
147038
- version: "2.2.2",
147053
+ version: "2.2.3",
147039
147054
  versionBase: getVersionBase(),
147040
- buildTime: "2026-05-09T18:58:40.127Z",
147055
+ buildTime: "2026-05-10T15:39:35.289Z",
147041
147056
  deploymentEnvironment: env3.detectDeploymentEnvironment(),
147042
147057
  ...isEnvTruthy(process.env.GITHUB_ACTIONS) && {
147043
147058
  githubEventName: process.env.GITHUB_EVENT_NAME,
@@ -172936,6 +172951,18 @@ async function streamCompactSummary({
172936
172951
  statusSetter?.("compacting");
172937
172952
  }, 30000, context4.setSDKStatus) : undefined;
172938
172953
  try {
172954
+ const cleanRoomFirst = await tryCleanRoomCompactSummary({
172955
+ messages,
172956
+ summaryRequest,
172957
+ context: context4,
172958
+ preCompactTokenCount
172959
+ });
172960
+ if (cleanRoomFirst) {
172961
+ const cleanText = getAssistantMessageText(cleanRoomFirst);
172962
+ if (cleanText && !cleanRoomFirst.isApiErrorMessage && !cleanText.startsWith(PROMPT_TOO_LONG_ERROR_MESSAGE)) {
172963
+ return cleanRoomFirst;
172964
+ }
172965
+ }
172939
172966
  if (promptCacheSharingEnabled) {
172940
172967
  try {
172941
172968
  const result = await runForkedAgent({
@@ -172975,18 +173002,6 @@ async function streamCompactSummary({
172975
173002
  });
172976
173003
  }
172977
173004
  }
172978
- const cleanRoomResponse = await tryCleanRoomCompactSummary({
172979
- messages,
172980
- summaryRequest,
172981
- context: context4,
172982
- preCompactTokenCount
172983
- });
172984
- if (cleanRoomResponse) {
172985
- const cleanText = getAssistantMessageText(cleanRoomResponse);
172986
- if (cleanText && !cleanRoomResponse.isApiErrorMessage && !cleanText.startsWith(PROMPT_TOO_LONG_ERROR_MESSAGE)) {
172987
- return cleanRoomResponse;
172988
- }
172989
- }
172990
173005
  const retryEnabled = getFeatureValue_CACHED_MAY_BE_STALE("tengu_compact_streaming_retry", false);
172991
173006
  const maxAttempts = retryEnabled ? MAX_COMPACT_STREAMING_RETRIES : 1;
172992
173007
  for (let attempt = 1;attempt <= maxAttempts; attempt++) {
@@ -179577,7 +179592,7 @@ function getTelemetryAttributes() {
179577
179592
  attributes["session.id"] = sessionId;
179578
179593
  }
179579
179594
  if (shouldIncludeAttribute("OTEL_METRICS_INCLUDE_VERSION")) {
179580
- attributes["app.version"] = "2.2.2";
179595
+ attributes["app.version"] = "2.2.3";
179581
179596
  }
179582
179597
  const oauthAccount = getOauthAccountInfo();
179583
179598
  if (oauthAccount) {
@@ -179947,6 +179962,40 @@ var init_postCompactCleanup = __esm(() => {
179947
179962
  init_microCompact();
179948
179963
  });
179949
179964
 
179965
+ // src/services/SessionMemory/sessionMemoryUtils.ts
179966
+ function setLastSummarizedMessageId2(messageId) {
179967
+ lastSummarizedMessageId = messageId;
179968
+ }
179969
+ async function getSessionMemoryContent() {
179970
+ const fs2 = getFsImplementation();
179971
+ const memoryPath = getSessionMemoryPath();
179972
+ try {
179973
+ const content = await fs2.readFile(memoryPath, { encoding: "utf-8" });
179974
+ logEvent("tengu_session_memory_loaded", {
179975
+ content_length: content.length
179976
+ });
179977
+ return content;
179978
+ } catch (e) {
179979
+ if (isFsInaccessible(e))
179980
+ return null;
179981
+ throw e;
179982
+ }
179983
+ }
179984
+ var DEFAULT_SESSION_MEMORY_CONFIG, sessionMemoryConfig, lastSummarizedMessageId;
179985
+ var init_sessionMemoryUtils = __esm(() => {
179986
+ init_errors();
179987
+ init_fsOperations();
179988
+ init_filesystem();
179989
+ DEFAULT_SESSION_MEMORY_CONFIG = {
179990
+ minimumMessageTokensToInit: 1e4,
179991
+ minimumTokensBetweenUpdate: 5000,
179992
+ toolCallsBetweenUpdates: 3
179993
+ };
179994
+ sessionMemoryConfig = {
179995
+ ...DEFAULT_SESSION_MEMORY_CONFIG
179996
+ };
179997
+ });
179998
+
179950
179999
  // src/services/compact/autoCompact.ts
179951
180000
  function getEffectiveContextWindowSize(model) {
179952
180001
  const reservedTokensForSummary = Math.min(getMaxOutputTokensForModel(model), MAX_OUTPUT_TOKENS_FOR_SUMMARY);
@@ -180038,7 +180087,7 @@ async function autoCompactIfNeeded(messages, toolUseContext, cacheSafeParams, qu
180038
180087
  };
180039
180088
  try {
180040
180089
  const compactionResult = await compactConversation(messages, toolUseContext, cacheSafeParams, true, undefined, true, recompactionInfo);
180041
- setLastSummarizedMessageId(undefined);
180090
+ setLastSummarizedMessageId2(undefined);
180042
180091
  runPostCompactCleanup(querySource);
180043
180092
  return {
180044
180093
  wasCompacted: true,
@@ -180069,6 +180118,7 @@ var init_autoCompact = __esm(() => {
180069
180118
  init_llm();
180070
180119
  init_compact();
180071
180120
  init_postCompactCleanup();
180121
+ init_sessionMemoryUtils();
180072
180122
  });
180073
180123
 
180074
180124
  // src/constants/errorIds.ts
@@ -241830,7 +241880,7 @@ function getInstallationEnv() {
241830
241880
  return;
241831
241881
  }
241832
241882
  function getClaudeCodeVersion() {
241833
- return "2.2.2";
241883
+ return "2.2.3";
241834
241884
  }
241835
241885
  async function getInstalledVSCodeExtensionVersion(command) {
241836
241886
  const { stdout } = await execFileNoThrow(command, ["--list-extensions", "--show-versions"], {
@@ -247104,7 +247154,7 @@ async function setupSdkMcpClients(sdkMcpConfigs, sendMcpMessage) {
247104
247154
  const client4 = new Client({
247105
247155
  name: "localclawd",
247106
247156
  title: "localclawd",
247107
- version: "2.2.2",
247157
+ version: "2.2.3",
247108
247158
  description: "local-first AI coding tool",
247109
247159
  websiteUrl: PRODUCT_URL
247110
247160
  }, {
@@ -247446,7 +247496,7 @@ var init_client9 = __esm(() => {
247446
247496
  const client4 = new Client({
247447
247497
  name: "localclawd",
247448
247498
  title: "localclawd",
247449
- version: "2.2.2",
247499
+ version: "2.2.3",
247450
247500
  description: "local-first AI coding tool",
247451
247501
  websiteUrl: PRODUCT_URL
247452
247502
  }, {
@@ -261848,7 +261898,7 @@ function computeFingerprint(messageText, version) {
261848
261898
  }
261849
261899
  function computeFingerprintFromMessages(messages) {
261850
261900
  const firstMessageText = extractFirstMessageText(messages);
261851
- return computeFingerprint(firstMessageText, "2.2.2");
261901
+ return computeFingerprint(firstMessageText, "2.2.3");
261852
261902
  }
261853
261903
  var FINGERPRINT_SALT = "59cf53e54c78";
261854
261904
  var init_fingerprint = () => {};
@@ -261890,7 +261940,7 @@ async function sideQuery(opts) {
261890
261940
  betas.push(STRUCTURED_OUTPUTS_BETA_HEADER);
261891
261941
  }
261892
261942
  const messageText = extractFirstUserMessageText(messages);
261893
- const fingerprint = computeFingerprint(messageText, "2.2.2");
261943
+ const fingerprint = computeFingerprint(messageText, "2.2.3");
261894
261944
  const attributionHeader = getAttributionHeader(fingerprint);
261895
261945
  const systemBlocks = [
261896
261946
  attributionHeader ? { type: "text", text: attributionHeader } : null,
@@ -282642,7 +282692,7 @@ var init_user = __esm(() => {
282642
282692
  deviceId,
282643
282693
  sessionId: getSessionId(),
282644
282694
  email: getEmail(),
282645
- appVersion: "2.2.2",
282695
+ appVersion: "2.2.3",
282646
282696
  platform: getHostPlatformForAnalytics(),
282647
282697
  organizationUuid,
282648
282698
  accountUuid,
@@ -283707,7 +283757,7 @@ async function initializeBetaTracing(resource) {
283707
283757
  });
283708
283758
  logs.setGlobalLoggerProvider(loggerProvider);
283709
283759
  setLoggerProvider(loggerProvider);
283710
- const eventLogger = logs.getLogger("com.anthropic.claude_code.events", "2.2.2");
283760
+ const eventLogger = logs.getLogger("com.anthropic.claude_code.events", "2.2.3");
283711
283761
  setEventLogger(eventLogger);
283712
283762
  process.on("beforeExit", async () => {
283713
283763
  await loggerProvider?.forceFlush();
@@ -283747,7 +283797,7 @@ async function initializeTelemetry() {
283747
283797
  const platform2 = getPlatform();
283748
283798
  const baseAttributes = {
283749
283799
  [ATTR_SERVICE_NAME4]: "claude-code",
283750
- [ATTR_SERVICE_VERSION4]: "2.2.2"
283800
+ [ATTR_SERVICE_VERSION4]: "2.2.3"
283751
283801
  };
283752
283802
  if (platform2 === "wsl") {
283753
283803
  const wslVersion = getWslVersion();
@@ -283792,7 +283842,7 @@ async function initializeTelemetry() {
283792
283842
  } catch {}
283793
283843
  };
283794
283844
  registerCleanup(shutdownTelemetry2);
283795
- return meterProvider2.getMeter("com.anthropic.claude_code", "2.2.2");
283845
+ return meterProvider2.getMeter("com.anthropic.claude_code", "2.2.3");
283796
283846
  }
283797
283847
  const meterProvider = new MeterProvider4({
283798
283848
  resource,
@@ -283812,7 +283862,7 @@ async function initializeTelemetry() {
283812
283862
  });
283813
283863
  logs.setGlobalLoggerProvider(loggerProvider);
283814
283864
  setLoggerProvider(loggerProvider);
283815
- const eventLogger = logs.getLogger("com.anthropic.claude_code.events", "2.2.2");
283865
+ const eventLogger = logs.getLogger("com.anthropic.claude_code.events", "2.2.3");
283816
283866
  setEventLogger(eventLogger);
283817
283867
  logForDebugging("[3P telemetry] Event logger set successfully");
283818
283868
  process.on("beforeExit", async () => {
@@ -283874,7 +283924,7 @@ Current timeout: ${timeoutMs}ms
283874
283924
  }
283875
283925
  };
283876
283926
  registerCleanup(shutdownTelemetry);
283877
- return meterProvider.getMeter("com.anthropic.claude_code", "2.2.2");
283927
+ return meterProvider.getMeter("com.anthropic.claude_code", "2.2.3");
283878
283928
  }
283879
283929
  async function flushTelemetry() {
283880
283930
  const meterProvider = getMeterProvider();
@@ -285064,7 +285114,7 @@ function detectLinuxGlobPatternWarnings() {
285064
285114
  }
285065
285115
  async function getDoctorDiagnostic() {
285066
285116
  const installationType = await getCurrentInstallationType();
285067
- const version = typeof MACRO !== "undefined" ? "2.2.2" : "unknown";
285117
+ const version = typeof MACRO !== "undefined" ? "2.2.3" : "unknown";
285068
285118
  const installationPath = await getInstallationPath();
285069
285119
  const invokedBinary = getInvokedBinary();
285070
285120
  const multipleInstallations = await detectMultipleInstallations();
@@ -286005,8 +286055,8 @@ async function updateLatest(channelOrVersion, forceReinstall = false) {
286005
286055
  const maxVersion = await getMaxVersion();
286006
286056
  if (maxVersion && gt(version, maxVersion)) {
286007
286057
  logForDebugging(`Native installer: maxVersion ${maxVersion} is set, capping update from ${version} to ${maxVersion}`);
286008
- if (gte("2.2.2", maxVersion)) {
286009
- logForDebugging(`Native installer: current version ${"2.2.2"} is already at or above maxVersion ${maxVersion}, skipping update`);
286058
+ if (gte("2.2.3", maxVersion)) {
286059
+ logForDebugging(`Native installer: current version ${"2.2.3"} is already at or above maxVersion ${maxVersion}, skipping update`);
286010
286060
  logEvent("tengu_native_update_skipped_max_version", {
286011
286061
  latency_ms: Date.now() - startTime,
286012
286062
  max_version: maxVersion,
@@ -286017,7 +286067,7 @@ async function updateLatest(channelOrVersion, forceReinstall = false) {
286017
286067
  version = maxVersion;
286018
286068
  }
286019
286069
  }
286020
- if (!forceReinstall && version === "2.2.2" && await versionIsAvailable(version) && await isPossibleLocalClawdBinary(executablePath)) {
286070
+ if (!forceReinstall && version === "2.2.3" && await versionIsAvailable(version) && await isPossibleLocalClawdBinary(executablePath)) {
286021
286071
  logForDebugging(`Found ${version} at ${executablePath}, skipping install`);
286022
286072
  logEvent("tengu_native_update_complete", {
286023
286073
  latency_ms: Date.now() - startTime,
@@ -332292,7 +332342,7 @@ function getAnthropicEnvMetadata() {
332292
332342
  function getBuildAgeMinutes() {
332293
332343
  if (false)
332294
332344
  ;
332295
- const buildTime = new Date("2026-05-09T18:58:40.127Z").getTime();
332345
+ const buildTime = new Date("2026-05-10T15:39:35.289Z").getTime();
332296
332346
  if (isNaN(buildTime))
332297
332347
  return;
332298
332348
  return Math.floor((Date.now() - buildTime) / 60000);
@@ -360321,7 +360371,7 @@ function Feedback({
360321
360371
  platform: env3.platform,
360322
360372
  gitRepo: envInfo.isGit,
360323
360373
  terminal: env3.terminal,
360324
- version: "2.2.2",
360374
+ version: "2.2.3",
360325
360375
  transcript: normalizeMessagesForAPI(messages),
360326
360376
  errors: sanitizedErrors,
360327
360377
  lastApiRequest: getLastAPIRequest(),
@@ -360513,7 +360563,7 @@ function Feedback({
360513
360563
  ", ",
360514
360564
  env3.terminal,
360515
360565
  ", v",
360516
- "2.2.2"
360566
+ "2.2.3"
360517
360567
  ]
360518
360568
  }, undefined, true, undefined, this)
360519
360569
  ]
@@ -360619,7 +360669,7 @@ ${sanitizedDescription}
360619
360669
  ` + `**Environment Info**
360620
360670
  ` + `- Platform: ${env3.platform}
360621
360671
  ` + `- Terminal: ${env3.terminal}
360622
- ` + `- Version: ${"2.2.2"}
360672
+ ` + `- Version: ${"2.2.3"}
360623
360673
  ` + `- Feedback ID: ${feedbackId}
360624
360674
  ` + `
360625
360675
  **Errors**
@@ -363228,7 +363278,7 @@ function buildPrimarySection() {
363228
363278
  }, undefined, false, undefined, this);
363229
363279
  return [{
363230
363280
  label: "Version",
363231
- value: "2.2.2"
363281
+ value: "2.2.3"
363232
363282
  }, {
363233
363283
  label: "Session name",
363234
363284
  value: nameValue
@@ -367909,7 +367959,7 @@ function Config({
367909
367959
  }
367910
367960
  }, undefined, false, undefined, this)
367911
367961
  }, undefined, false, undefined, this) : showSubmenu === "ChannelDowngrade" ? /* @__PURE__ */ jsx_dev_runtime176.jsxDEV(ChannelDowngradeDialog, {
367912
- currentVersion: "2.2.2",
367962
+ currentVersion: "2.2.3",
367913
367963
  onChoice: (choice) => {
367914
367964
  setShowSubmenu(null);
367915
367965
  setTabsHidden(false);
@@ -367921,7 +367971,7 @@ function Config({
367921
367971
  autoUpdatesChannel: "stable"
367922
367972
  };
367923
367973
  if (choice === "stay") {
367924
- newSettings.minimumVersion = "2.2.2";
367974
+ newSettings.minimumVersion = "2.2.3";
367925
367975
  }
367926
367976
  updateSettingsForSource("userSettings", newSettings);
367927
367977
  setSettingsData((prev_27) => ({
@@ -383444,6 +383494,100 @@ var init_sysprompt2 = __esm(() => {
383444
383494
  sysprompt_default = sysprompt;
383445
383495
  });
383446
383496
 
383497
+ // src/services/api/providerContextDetect.ts
383498
+ var exports_providerContextDetect = {};
383499
+ __export(exports_providerContextDetect, {
383500
+ resetContextWindowDetection: () => resetContextWindowDetection,
383501
+ autoDetectProviderContextWindow: () => autoDetectProviderContextWindow
383502
+ });
383503
+ function normalizeUrl3(base) {
383504
+ const trimmed = base.trim().replace(/\/+$/, "");
383505
+ return trimmed.endsWith("/v1") ? trimmed : `${trimmed}/v1`;
383506
+ }
383507
+ async function fetchJson(url3, apiKey) {
383508
+ const headers = { "Content-Type": "application/json" };
383509
+ if (apiKey)
383510
+ headers["Authorization"] = `Bearer ${apiKey}`;
383511
+ const res = await fetch(url3, { headers, signal: AbortSignal.timeout(4000) });
383512
+ if (!res.ok)
383513
+ throw new Error(`HTTP ${res.status}`);
383514
+ return res.json();
383515
+ }
383516
+ function parseVllmContextWindow(data, modelHint) {
383517
+ if (!data || typeof data !== "object")
383518
+ return null;
383519
+ const d = data;
383520
+ const models = Array.isArray(d["data"]) ? d["data"] : [];
383521
+ if (models.length === 0)
383522
+ return null;
383523
+ let entry = modelHint ? models.find((m2) => typeof m2 === "object" && m2 !== null && (m2["id"] === modelHint || String(m2["id"]).includes(modelHint))) : undefined;
383524
+ if (!entry)
383525
+ entry = models[0];
383526
+ const maxLen = entry["max_model_len"];
383527
+ if (typeof maxLen === "number" && maxLen > 0)
383528
+ return maxLen;
383529
+ return null;
383530
+ }
383531
+ function parseOllamaContextWindow(data, modelHint) {
383532
+ if (!data || typeof data !== "object")
383533
+ return null;
383534
+ const d = data;
383535
+ const models = Array.isArray(d["data"]) ? d["data"] : [];
383536
+ for (const m2 of models) {
383537
+ if (!m2 || typeof m2 !== "object")
383538
+ continue;
383539
+ const entry = m2;
383540
+ if (modelHint && entry["id"] !== modelHint)
383541
+ continue;
383542
+ const info = entry["model_info"];
383543
+ const ctxLen = info?.["context_length"] ?? info?.["llama.context_length"] ?? entry["context_length"];
383544
+ if (typeof ctxLen === "number" && ctxLen > 0)
383545
+ return ctxLen;
383546
+ }
383547
+ return null;
383548
+ }
383549
+ function resetContextWindowDetection() {
383550
+ _detected = false;
383551
+ }
383552
+ async function autoDetectProviderContextWindow() {
383553
+ if (_detected)
383554
+ return;
383555
+ _detected = true;
383556
+ try {
383557
+ const configured = getGlobalConfig().compactContextWindowTokens;
383558
+ if (configured && configured > 0) {
383559
+ setLocalProviderContextWindow(configured);
383560
+ logForDebugging(`[context] Using persisted context window: ${configured} tokens`);
383561
+ return;
383562
+ }
383563
+ const provider = getLocalLLMProvider();
383564
+ const baseUrl = normalizeUrl3(getLocalLLMBaseUrl(provider));
383565
+ const apiKey = getLocalLLMApiKey(provider);
383566
+ const modelHint = getLocalLLMModel(provider);
383567
+ const data = await fetchJson(`${baseUrl}/models`, apiKey);
383568
+ let detected = null;
383569
+ if (provider === "ollama") {
383570
+ detected = parseOllamaContextWindow(data, modelHint);
383571
+ } else {
383572
+ detected = parseVllmContextWindow(data, modelHint);
383573
+ }
383574
+ if (detected && detected > 0) {
383575
+ setLocalProviderContextWindow(detected);
383576
+ saveGlobalConfig((c5) => ({ ...c5, compactContextWindowTokens: detected }));
383577
+ logForDebugging(`[context] Auto-detected context window from ${provider}: ${detected} tokens (persisted)`);
383578
+ }
383579
+ } catch (err2) {
383580
+ logForDebugging(`[context] Auto-detect context window failed (non-fatal): ${err2}`);
383581
+ }
383582
+ }
383583
+ var _detected = false;
383584
+ var init_providerContextDetect = __esm(() => {
383585
+ init_debug();
383586
+ init_providers();
383587
+ init_context();
383588
+ init_config();
383589
+ });
383590
+
383447
383591
  // src/commands/ctx/ctx.tsx
383448
383592
  var exports_ctx = {};
383449
383593
  __export(exports_ctx, {
@@ -383477,23 +383621,36 @@ var call51 = async (onDone, context7, args) => {
383477
383621
  onDone(`Invalid size "${valueStr}". Use: 200k | 1m | 131072`, { display: "system" });
383478
383622
  return null;
383479
383623
  }
383480
- saveGlobalConfig((c5) => ({ ...c5, compactContextWindowTokens: parsed }));
383624
+ const key = getContextWindowOverrideKey(model);
383625
+ saveGlobalConfig((c5) => ({
383626
+ ...c5,
383627
+ contextWindowOverrides: { ...c5.contextWindowOverrides ?? {}, [key]: parsed }
383628
+ }));
383481
383629
  onDone([
383482
- `Context window set to ${fmtTokens(parsed)} tokens.`,
383630
+ `Context window set to ${fmtTokens(parsed)} tokens for ${model} in this directory.`,
383483
383631
  `Effective window: ${fmtTokens(getEffectiveContextWindowSize(model))} (minus output reservation).`,
383484
- `Auto-compact threshold: ${fmtTokens(getAutoCompactThreshold(model))}.`
383632
+ `Auto-compact threshold: ${fmtTokens(getAutoCompactThreshold(model))}.`,
383633
+ `Persists until /ctx reset or model switch.`
383485
383634
  ].join(`
383486
383635
  `), { display: "system" });
383487
383636
  return null;
383488
383637
  }
383489
383638
  if (sub === "reset") {
383639
+ const key = getContextWindowOverrideKey(model);
383490
383640
  saveGlobalConfig((c5) => {
383491
- const { compactContextWindowTokens: _2, ...rest } = c5;
383492
- return rest;
383641
+ const { compactContextWindowTokens: _2, contextWindowOverrides, ...rest } = c5;
383642
+ const nextOverrides = { ...contextWindowOverrides ?? {} };
383643
+ delete nextOverrides[key];
383644
+ return {
383645
+ ...rest,
383646
+ ...Object.keys(nextOverrides).length > 0 ? { contextWindowOverrides: nextOverrides } : {}
383647
+ };
383493
383648
  });
383649
+ resetContextWindowDetection();
383650
+ autoDetectProviderContextWindow();
383494
383651
  onDone([
383495
- "Context window reset to model default.",
383496
- `Current model default: ${fmtTokens(getContextWindowForModel(model))} tokens.`
383652
+ "Context window reset. Re-detecting from provider...",
383653
+ `Will use ${fmtTokens(getContextWindowForModel(model))} tokens until detection completes.`
383497
383654
  ].join(`
383498
383655
  `), { display: "system" });
383499
383656
  return null;
@@ -383517,7 +383674,8 @@ var call51 = async (onDone, context7, args) => {
383517
383674
  const tokenUsage = tokenCountWithEstimation(context7.messages);
383518
383675
  const autoCompact = isAutoCompactEnabled();
383519
383676
  const usagePct = Math.min(100, Math.round(tokenUsage / totalWindow * 100));
383520
- const source = configuredCap ? `user-configured (${fmtTokens(configuredCap)})` : detectedFromProvider ? `detected (${fmtTokens(detectedFromProvider)})` : "model default";
383677
+ const projectOverride = getContextWindowOverride(model);
383678
+ const source = projectOverride ? `project override (${fmtTokens(projectOverride)} for ${model} here)` : configuredCap ? `user-configured (${fmtTokens(configuredCap)})` : detectedFromProvider ? `detected (${fmtTokens(detectedFromProvider)})` : "model default";
383521
383679
  const lines = [
383522
383680
  "─── Context Window ───────────────────────────────────────",
383523
383681
  ` Total window: ${fmtTokens(totalWindow)} tokens [${source}]`,
@@ -383540,6 +383698,7 @@ var call51 = async (onDone, context7, args) => {
383540
383698
  };
383541
383699
  var init_ctx = __esm(() => {
383542
383700
  init_config();
383701
+ init_providerContextDetect();
383543
383702
  init_context();
383544
383703
  init_autoCompact();
383545
383704
  init_tokens();
@@ -383586,9 +383745,13 @@ var call52 = async (onDone, context7, args) => {
383586
383745
  onDone(`Invalid size "${value}". Use: 128k | 200k | 1m | 131072`, { display: "system" });
383587
383746
  return null;
383588
383747
  }
383589
- saveGlobalConfig((c5) => ({ ...c5, compactContextWindowTokens: parsed }));
383590
383748
  const model = context7.options.mainLoopModel;
383591
- onDone(`Context size set to ${fmtTokens2(parsed)}. Auto-compact triggers at ${fmtTokens2(getAutoCompactThreshold(model))}.`, { display: "system" });
383749
+ const key = getContextWindowOverrideKey(model);
383750
+ saveGlobalConfig((c5) => ({
383751
+ ...c5,
383752
+ contextWindowOverrides: { ...c5.contextWindowOverrides ?? {}, [key]: parsed }
383753
+ }));
383754
+ onDone(`Context size set to ${fmtTokens2(parsed)} for ${model} in this directory. Auto-compact triggers at ${fmtTokens2(getAutoCompactThreshold(model))}.`, { display: "system" });
383592
383755
  return null;
383593
383756
  };
383594
383757
  var init_contextsize = __esm(() => {
@@ -385173,7 +385336,7 @@ function Help(t0) {
385173
385336
  let t6;
385174
385337
  if ($2[31] !== tabs) {
385175
385338
  t6 = /* @__PURE__ */ jsx_dev_runtime218.jsxDEV(Tabs, {
385176
- title: `localclawd v${"2.2.2"}`,
385339
+ title: `localclawd v${"2.2.3"}`,
385177
385340
  color: "professionalBlue",
385178
385341
  defaultTab: "general",
385179
385342
  children: tabs
@@ -402435,7 +402598,7 @@ function getRecentReleaseNotes(currentVersion, previousVersion, changelogContent
402435
402598
  }
402436
402599
  return [];
402437
402600
  }
402438
- async function checkForReleaseNotes(lastSeenVersion, currentVersion = "2.2.2") {
402601
+ async function checkForReleaseNotes(lastSeenVersion, currentVersion = "2.2.3") {
402439
402602
  if (process.env.USER_TYPE === "ant") {
402440
402603
  const changelog = MACRO.VERSION_CHANGELOG;
402441
402604
  if (changelog) {
@@ -402462,7 +402625,7 @@ async function checkForReleaseNotes(lastSeenVersion, currentVersion = "2.2.2") {
402462
402625
  releaseNotes
402463
402626
  };
402464
402627
  }
402465
- function checkForReleaseNotesSync(lastSeenVersion, currentVersion = "2.2.2") {
402628
+ function checkForReleaseNotesSync(lastSeenVersion, currentVersion = "2.2.3") {
402466
402629
  if (process.env.USER_TYPE === "ant") {
402467
402630
  const changelog = MACRO.VERSION_CHANGELOG;
402468
402631
  if (changelog) {
@@ -402619,7 +402782,7 @@ function getRecentActivitySync() {
402619
402782
  return cachedActivity;
402620
402783
  }
402621
402784
  function getLogoDisplayData() {
402622
- const version = process.env.DEMO_VERSION ?? "2.2.2";
402785
+ const version = process.env.DEMO_VERSION ?? "2.2.3";
402623
402786
  const serverUrl = getDirectConnectServerUrl();
402624
402787
  const displayPath = process.env.DEMO_VERSION ? "/code/claude" : getDisplayPath(getCwd());
402625
402788
  const cwd2 = serverUrl ? `${displayPath} in ${serverUrl.replace(/^https?:\/\//, "")}` : displayPath;
@@ -403719,7 +403882,7 @@ function Logo() {
403719
403882
  if ($2[2] === Symbol.for("react.memo_cache_sentinel")) {
403720
403883
  t2 = () => {
403721
403884
  const currentConfig = getGlobalConfig();
403722
- if (currentConfig.lastReleaseNotesSeen === "2.2.2") {
403885
+ if (currentConfig.lastReleaseNotesSeen === "2.2.3") {
403723
403886
  return;
403724
403887
  }
403725
403888
  saveGlobalConfig(_temp325);
@@ -404378,12 +404541,12 @@ function Logo() {
404378
404541
  return t41;
404379
404542
  }
404380
404543
  function _temp325(current) {
404381
- if (current.lastReleaseNotesSeen === "2.2.2") {
404544
+ if (current.lastReleaseNotesSeen === "2.2.3") {
404382
404545
  return current;
404383
404546
  }
404384
404547
  return {
404385
404548
  ...current,
404386
- lastReleaseNotesSeen: "2.2.2"
404549
+ lastReleaseNotesSeen: "2.2.3"
404387
404550
  };
404388
404551
  }
404389
404552
  function _temp240(s_0) {
@@ -434842,7 +435005,7 @@ async function captureMemoryDiagnostics(trigger, dumpNumber = 0) {
434842
435005
  smapsRollup,
434843
435006
  platform: process.platform,
434844
435007
  nodeVersion: process.version,
434845
- ccVersion: "2.2.2"
435008
+ ccVersion: "2.2.3"
434846
435009
  };
434847
435010
  }
434848
435011
  async function performHeapDump(trigger = "manual", dumpNumber = 0) {
@@ -435427,7 +435590,7 @@ var init_bridge_kick = __esm(() => {
435427
435590
  var call87 = async () => {
435428
435591
  return {
435429
435592
  type: "text",
435430
- value: `${"2.2.2"} (built ${"2026-05-09T18:58:40.127Z"})`
435593
+ value: `${"2.2.3"} (built ${"2026-05-10T15:39:35.289Z"})`
435431
435594
  };
435432
435595
  }, version, version_default;
435433
435596
  var init_version = __esm(() => {
@@ -443371,7 +443534,7 @@ function generateHtmlReport(data, insights) {
443371
443534
  </html>`;
443372
443535
  }
443373
443536
  function buildExportData(data, insights, facets, remoteStats) {
443374
- const version2 = typeof MACRO !== "undefined" ? "2.2.2" : "unknown";
443537
+ const version2 = typeof MACRO !== "undefined" ? "2.2.3" : "unknown";
443375
443538
  const remote_hosts_collected = remoteStats?.hosts.filter((h) => h.sessionCount > 0).map((h) => h.name);
443376
443539
  const facets_summary = {
443377
443540
  total: facets.size,
@@ -447572,7 +447735,7 @@ var init_sessionStorage = __esm(() => {
447572
447735
  init_settings2();
447573
447736
  init_slowOperations();
447574
447737
  init_uuid();
447575
- VERSION6 = typeof MACRO !== "undefined" ? "2.2.2" : "unknown";
447738
+ VERSION6 = typeof MACRO !== "undefined" ? "2.2.3" : "unknown";
447576
447739
  MAX_TOMBSTONE_REWRITE_BYTES = 50 * 1024 * 1024;
447577
447740
  SKIP_FIRST_PROMPT_PATTERN = /^(?:\s*<[a-z][\w-]*[\s>]|\[Request interrupted by user[^\]]*\])/;
447578
447741
  EPHEMERAL_PROGRESS_TYPES = new Set([
@@ -448703,7 +448866,7 @@ var init_filesystem = __esm(() => {
448703
448866
  });
448704
448867
  getBundledSkillsRoot = memoize_default(function getBundledSkillsRoot2() {
448705
448868
  const nonce = randomBytes20(16).toString("hex");
448706
- return join153(getClaudeTempDir(), "bundled-skills", "2.2.2", nonce);
448869
+ return join153(getClaudeTempDir(), "bundled-skills", "2.2.3", nonce);
448707
448870
  });
448708
448871
  getResolvedWorkingDirPaths = memoize_default(getPathsForPermissionCheck);
448709
448872
  });
@@ -457940,7 +458103,7 @@ function buildSystemInitMessage(inputs) {
457940
458103
  slash_commands: inputs.commands.filter((c5) => c5.userInvocable !== false).map((c5) => c5.name),
457941
458104
  apiKeySource: getAnthropicApiKeyWithSource().source,
457942
458105
  betas: getSdkBetas(),
457943
- claude_code_version: "2.2.2",
458106
+ claude_code_version: "2.2.3",
457944
458107
  output_style: outputStyle2,
457945
458108
  agents: inputs.agents.map((agent) => agent.agentType),
457946
458109
  skills: inputs.skills.filter((s) => s.userInvocable !== false).map((skill) => skill.name),
@@ -472097,7 +472260,7 @@ var init_useVoiceEnabled = __esm(() => {
472097
472260
  function getSemverPart(version2) {
472098
472261
  return `${import_semver10.major(version2, { loose: true })}.${import_semver10.minor(version2, { loose: true })}.${import_semver10.patch(version2, { loose: true })}`;
472099
472262
  }
472100
- function useUpdateNotification(updatedVersion, initialVersion = "2.2.2") {
472263
+ function useUpdateNotification(updatedVersion, initialVersion = "2.2.3") {
472101
472264
  const [lastNotifiedSemver, setLastNotifiedSemver] = import_react214.useState(() => getSemverPart(initialVersion));
472102
472265
  if (!updatedVersion) {
472103
472266
  return null;
@@ -472137,7 +472300,7 @@ function AutoUpdater({
472137
472300
  return;
472138
472301
  }
472139
472302
  if (false) {}
472140
- const currentVersion = "2.2.2";
472303
+ const currentVersion = "2.2.3";
472141
472304
  const channel = getInitialSettings()?.autoUpdatesChannel ?? "latest";
472142
472305
  let latestVersion = await getLatestVersion(channel);
472143
472306
  const isDisabled = isAutoUpdaterDisabled();
@@ -472348,12 +472511,12 @@ function NativeAutoUpdater({
472348
472511
  logEvent("tengu_native_auto_updater_start", {});
472349
472512
  try {
472350
472513
  const maxVersion = await getMaxVersion();
472351
- if (maxVersion && gt("2.2.2", maxVersion)) {
472514
+ if (maxVersion && gt("2.2.3", maxVersion)) {
472352
472515
  const msg = await getMaxVersionMessage();
472353
472516
  setMaxVersionIssue(msg ?? "affects your version");
472354
472517
  }
472355
472518
  const result = await installLatest(channel);
472356
- const currentVersion = "2.2.2";
472519
+ const currentVersion = "2.2.3";
472357
472520
  const latencyMs = Date.now() - startTime;
472358
472521
  if (result.lockFailed) {
472359
472522
  logEvent("tengu_native_auto_updater_lock_contention", {
@@ -472488,17 +472651,17 @@ function PackageManagerAutoUpdater(t0) {
472488
472651
  const maxVersion = await getMaxVersion();
472489
472652
  if (maxVersion && latest && gt(latest, maxVersion)) {
472490
472653
  logForDebugging(`PackageManagerAutoUpdater: maxVersion ${maxVersion} is set, capping update from ${latest} to ${maxVersion}`);
472491
- if (gte("2.2.2", maxVersion)) {
472492
- logForDebugging(`PackageManagerAutoUpdater: current version ${"2.2.2"} is already at or above maxVersion ${maxVersion}, skipping update`);
472654
+ if (gte("2.2.3", maxVersion)) {
472655
+ logForDebugging(`PackageManagerAutoUpdater: current version ${"2.2.3"} is already at or above maxVersion ${maxVersion}, skipping update`);
472493
472656
  setUpdateAvailable(false);
472494
472657
  return;
472495
472658
  }
472496
472659
  latest = maxVersion;
472497
472660
  }
472498
- const hasUpdate = latest && !gte("2.2.2", latest) && !shouldSkipVersion(latest);
472661
+ const hasUpdate = latest && !gte("2.2.3", latest) && !shouldSkipVersion(latest);
472499
472662
  setUpdateAvailable(!!hasUpdate);
472500
472663
  if (hasUpdate) {
472501
- logForDebugging(`PackageManagerAutoUpdater: Update available ${"2.2.2"} -> ${latest}`);
472664
+ logForDebugging(`PackageManagerAutoUpdater: Update available ${"2.2.3"} -> ${latest}`);
472502
472665
  }
472503
472666
  };
472504
472667
  $2[0] = t1;
@@ -472532,7 +472695,7 @@ function PackageManagerAutoUpdater(t0) {
472532
472695
  wrap: "truncate",
472533
472696
  children: [
472534
472697
  "currentVersion: ",
472535
- "2.2.2"
472698
+ "2.2.3"
472536
472699
  ]
472537
472700
  }, undefined, true, undefined, this);
472538
472701
  $2[3] = verbose;
@@ -480092,7 +480255,7 @@ function buildStatusLineCommandInput(permissionMode, exceedsHalfContext, setting
480092
480255
  project_dir: getOriginalCwd(),
480093
480256
  added_dirs: addedDirs
480094
480257
  },
480095
- version: "2.2.2",
480258
+ version: "2.2.3",
480096
480259
  output_style: {
480097
480260
  name: outputStyleName
480098
480261
  },
@@ -491664,7 +491827,7 @@ async function submitTranscriptShare(messages, trigger, appearanceId) {
491664
491827
  } catch {}
491665
491828
  const data = {
491666
491829
  trigger,
491667
- version: "2.2.2",
491830
+ version: "2.2.3",
491668
491831
  platform: process.platform,
491669
491832
  transcript,
491670
491833
  subagentTranscripts: Object.keys(subagentTranscripts).length > 0 ? subagentTranscripts : undefined,
@@ -492237,37 +492400,6 @@ var init_prompts4 = __esm(() => {
492237
492400
  init_log2();
492238
492401
  });
492239
492402
 
492240
- // src/services/SessionMemory/sessionMemoryUtils.ts
492241
- async function getSessionMemoryContent() {
492242
- const fs6 = getFsImplementation();
492243
- const memoryPath = getSessionMemoryPath();
492244
- try {
492245
- const content = await fs6.readFile(memoryPath, { encoding: "utf-8" });
492246
- logEvent("tengu_session_memory_loaded", {
492247
- content_length: content.length
492248
- });
492249
- return content;
492250
- } catch (e) {
492251
- if (isFsInaccessible(e))
492252
- return null;
492253
- throw e;
492254
- }
492255
- }
492256
- var DEFAULT_SESSION_MEMORY_CONFIG, sessionMemoryConfig;
492257
- var init_sessionMemoryUtils = __esm(() => {
492258
- init_errors();
492259
- init_fsOperations();
492260
- init_filesystem();
492261
- DEFAULT_SESSION_MEMORY_CONFIG = {
492262
- minimumMessageTokensToInit: 1e4,
492263
- minimumTokensBetweenUpdate: 5000,
492264
- toolCallsBetweenUpdates: 3
492265
- };
492266
- sessionMemoryConfig = {
492267
- ...DEFAULT_SESSION_MEMORY_CONFIG
492268
- };
492269
- });
492270
-
492271
492403
  // src/services/compact/sessionMemoryCompact.ts
492272
492404
  function shouldUseSessionMemoryCompaction() {
492273
492405
  if (isEnvTruthy(process.env.ENABLE_CLAUDE_CODE_SM_COMPACT)) {
@@ -508668,7 +508800,7 @@ function appendToLog(path17, message) {
508668
508800
  cwd: getFsImplementation().cwd(),
508669
508801
  userType: process.env.USER_TYPE,
508670
508802
  sessionId: getSessionId(),
508671
- version: "2.2.2"
508803
+ version: "2.2.3"
508672
508804
  };
508673
508805
  getLogWriter(path17).write(messageWithTimestamp);
508674
508806
  }
@@ -508816,93 +508948,6 @@ var init_iTermBackup = __esm(() => {
508816
508948
  init_log2();
508817
508949
  });
508818
508950
 
508819
- // src/services/api/providerContextDetect.ts
508820
- var exports_providerContextDetect = {};
508821
- __export(exports_providerContextDetect, {
508822
- autoDetectProviderContextWindow: () => autoDetectProviderContextWindow
508823
- });
508824
- function normalizeUrl3(base) {
508825
- return base.replace(/\/+$/, "");
508826
- }
508827
- async function fetchJson(url3, apiKey) {
508828
- const headers = { "Content-Type": "application/json" };
508829
- if (apiKey)
508830
- headers["Authorization"] = `Bearer ${apiKey}`;
508831
- const res = await fetch(url3, { headers, signal: AbortSignal.timeout(4000) });
508832
- if (!res.ok)
508833
- throw new Error(`HTTP ${res.status}`);
508834
- return res.json();
508835
- }
508836
- function parseVllmContextWindow(data, modelHint) {
508837
- if (!data || typeof data !== "object")
508838
- return null;
508839
- const d = data;
508840
- const models = Array.isArray(d["data"]) ? d["data"] : [];
508841
- if (models.length === 0)
508842
- return null;
508843
- let entry = modelHint ? models.find((m2) => typeof m2 === "object" && m2 !== null && (m2["id"] === modelHint || String(m2["id"]).includes(modelHint))) : undefined;
508844
- if (!entry)
508845
- entry = models[0];
508846
- const maxLen = entry["max_model_len"];
508847
- if (typeof maxLen === "number" && maxLen > 0)
508848
- return maxLen;
508849
- return null;
508850
- }
508851
- function parseOllamaContextWindow(data, modelHint) {
508852
- if (!data || typeof data !== "object")
508853
- return null;
508854
- const d = data;
508855
- const models = Array.isArray(d["data"]) ? d["data"] : [];
508856
- for (const m2 of models) {
508857
- if (!m2 || typeof m2 !== "object")
508858
- continue;
508859
- const entry = m2;
508860
- if (modelHint && entry["id"] !== modelHint)
508861
- continue;
508862
- const info = entry["model_info"];
508863
- const ctxLen = info?.["context_length"] ?? info?.["llama.context_length"] ?? entry["context_length"];
508864
- if (typeof ctxLen === "number" && ctxLen > 0)
508865
- return ctxLen;
508866
- }
508867
- return null;
508868
- }
508869
- async function autoDetectProviderContextWindow() {
508870
- if (_detected)
508871
- return;
508872
- _detected = true;
508873
- try {
508874
- const configured = getGlobalConfig().compactContextWindowTokens;
508875
- if (configured && configured > 0) {
508876
- logForDebugging(`[context] Skipping auto-detect because context window is user-configured: ${configured} tokens`);
508877
- return;
508878
- }
508879
- const provider = getLocalLLMProvider();
508880
- const baseUrl = normalizeUrl3(getLocalLLMBaseUrl(provider));
508881
- const apiKey = getLocalLLMApiKey(provider);
508882
- const modelHint = getLocalLLMModel(provider);
508883
- const data = await fetchJson(`${baseUrl}/models`, apiKey);
508884
- let detected = null;
508885
- if (provider === "ollama") {
508886
- detected = parseOllamaContextWindow(data, modelHint);
508887
- } else {
508888
- detected = parseVllmContextWindow(data, modelHint);
508889
- }
508890
- if (detected && detected > 0) {
508891
- setLocalProviderContextWindow(detected);
508892
- logForDebugging(`[context] Auto-detected context window from ${provider} /models: ${detected} tokens`);
508893
- }
508894
- } catch (err2) {
508895
- logForDebugging(`[context] Auto-detect context window failed (non-fatal): ${err2}`);
508896
- }
508897
- }
508898
- var _detected = false;
508899
- var init_providerContextDetect = __esm(() => {
508900
- init_debug();
508901
- init_providers();
508902
- init_context();
508903
- init_config();
508904
- });
508905
-
508906
508951
  // src/setup.ts
508907
508952
  var exports_setup = {};
508908
508953
  __export(exports_setup, {
@@ -512554,8 +512599,8 @@ async function getEnvLessBridgeConfig() {
512554
512599
  }
512555
512600
  async function checkEnvLessBridgeMinVersion() {
512556
512601
  const cfg = await getEnvLessBridgeConfig();
512557
- if (cfg.min_version && lt("2.2.2", cfg.min_version)) {
512558
- return `Your version of localclawd (${"2.2.2"}) is too old for Remote Control.
512602
+ if (cfg.min_version && lt("2.2.3", cfg.min_version)) {
512603
+ return `Your version of localclawd (${"2.2.3"}) is too old for Remote Control.
512559
512604
  Version ${cfg.min_version} or higher is required. Run \`localclawd update\` to update.`;
512560
512605
  }
512561
512606
  return null;
@@ -513027,7 +513072,7 @@ async function initBridgeCore(params) {
513027
513072
  const rawApi = createBridgeApiClient({
513028
513073
  baseUrl,
513029
513074
  getAccessToken,
513030
- runnerVersion: "2.2.2",
513075
+ runnerVersion: "2.2.3",
513031
513076
  onDebug: logForDebugging,
513032
513077
  onAuth401,
513033
513078
  getTrustedDeviceToken
@@ -518746,7 +518791,7 @@ async function startMCPServer(cwd3, debug4, verbose) {
518746
518791
  setCwd(cwd3);
518747
518792
  const server = new Server({
518748
518793
  name: "claude/tengu",
518749
- version: "2.2.2"
518794
+ version: "2.2.3"
518750
518795
  }, {
518751
518796
  capabilities: {
518752
518797
  tools: {}
@@ -519827,7 +519872,7 @@ function WelcomeLogo() {
519827
519872
  dimColor: true,
519828
519873
  children: [
519829
519874
  "v",
519830
- "2.2.2"
519875
+ "2.2.3"
519831
519876
  ]
519832
519877
  }, undefined, true, undefined, this)
519833
519878
  ]
@@ -520018,7 +520063,7 @@ __export(exports_update, {
520018
520063
  });
520019
520064
  async function update() {
520020
520065
  logEvent("tengu_update_check", {});
520021
- writeToStdout(`Current version: ${"2.2.2"}
520066
+ writeToStdout(`Current version: ${"2.2.3"}
520022
520067
  `);
520023
520068
  const channel = getInitialSettings()?.autoUpdatesChannel ?? "latest";
520024
520069
  writeToStdout(`Checking for updates to ${channel} version...
@@ -520093,8 +520138,8 @@ async function update() {
520093
520138
  writeToStdout(`localclawd is managed by Homebrew.
520094
520139
  `);
520095
520140
  const latest = await getLatestVersion(channel);
520096
- if (latest && !gte("2.2.2", latest)) {
520097
- writeToStdout(`Update available: ${"2.2.2"} → ${latest}
520141
+ if (latest && !gte("2.2.3", latest)) {
520142
+ writeToStdout(`Update available: ${"2.2.3"} → ${latest}
520098
520143
  `);
520099
520144
  writeToStdout(`
520100
520145
  `);
@@ -520110,8 +520155,8 @@ async function update() {
520110
520155
  writeToStdout(`localclawd is managed by winget.
520111
520156
  `);
520112
520157
  const latest = await getLatestVersion(channel);
520113
- if (latest && !gte("2.2.2", latest)) {
520114
- writeToStdout(`Update available: ${"2.2.2"} → ${latest}
520158
+ if (latest && !gte("2.2.3", latest)) {
520159
+ writeToStdout(`Update available: ${"2.2.3"} → ${latest}
520115
520160
  `);
520116
520161
  writeToStdout(`
520117
520162
  `);
@@ -520125,8 +520170,8 @@ async function update() {
520125
520170
  writeToStdout(`localclawd is managed by apk.
520126
520171
  `);
520127
520172
  const latest = await getLatestVersion(channel);
520128
- if (latest && !gte("2.2.2", latest)) {
520129
- writeToStdout(`Update available: ${"2.2.2"} → ${latest}
520173
+ if (latest && !gte("2.2.3", latest)) {
520174
+ writeToStdout(`Update available: ${"2.2.3"} → ${latest}
520130
520175
  `);
520131
520176
  writeToStdout(`
520132
520177
  `);
@@ -520191,11 +520236,11 @@ async function update() {
520191
520236
  `);
520192
520237
  await gracefulShutdown(1);
520193
520238
  }
520194
- if (result.latestVersion === "2.2.2") {
520195
- writeToStdout(source_default.green(`localclawd is up to date (${"2.2.2"})`) + `
520239
+ if (result.latestVersion === "2.2.3") {
520240
+ writeToStdout(source_default.green(`localclawd is up to date (${"2.2.3"})`) + `
520196
520241
  `);
520197
520242
  } else {
520198
- writeToStdout(source_default.green(`Successfully updated from ${"2.2.2"} to version ${result.latestVersion}`) + `
520243
+ writeToStdout(source_default.green(`Successfully updated from ${"2.2.3"} to version ${result.latestVersion}`) + `
520199
520244
  `);
520200
520245
  await regenerateCompletionCache();
520201
520246
  }
@@ -520255,12 +520300,12 @@ async function update() {
520255
520300
  `);
520256
520301
  await gracefulShutdown(1);
520257
520302
  }
520258
- if (latestVersion === "2.2.2") {
520259
- writeToStdout(source_default.green(`localclawd is up to date (${"2.2.2"})`) + `
520303
+ if (latestVersion === "2.2.3") {
520304
+ writeToStdout(source_default.green(`localclawd is up to date (${"2.2.3"})`) + `
520260
520305
  `);
520261
520306
  await gracefulShutdown(0);
520262
520307
  }
520263
- writeToStdout(`New version available: ${latestVersion} (current: ${"2.2.2"})
520308
+ writeToStdout(`New version available: ${latestVersion} (current: ${"2.2.3"})
520264
520309
  `);
520265
520310
  writeToStdout(`Installing update...
520266
520311
  `);
@@ -520305,7 +520350,7 @@ async function update() {
520305
520350
  logForDebugging(`update: Installation status: ${status2}`);
520306
520351
  switch (status2) {
520307
520352
  case "success":
520308
- writeToStdout(source_default.green(`Successfully updated from ${"2.2.2"} to version ${latestVersion}`) + `
520353
+ writeToStdout(source_default.green(`Successfully updated from ${"2.2.3"} to version ${latestVersion}`) + `
520309
520354
  `);
520310
520355
  await regenerateCompletionCache();
520311
520356
  break;
@@ -521547,7 +521592,7 @@ Run with --debug for more details.
521547
521592
  }
521548
521593
  }
521549
521594
  logForDiagnosticsNoPII("info", "started", {
521550
- version: "2.2.2",
521595
+ version: "2.2.3",
521551
521596
  is_native_binary: isInBundledMode()
521552
521597
  });
521553
521598
  registerCleanup(async () => {
@@ -522331,7 +522376,7 @@ Usage: localclawd --remote "your task description"`, () => gracefulShutdown(1));
522331
522376
  pendingHookMessages
522332
522377
  }, renderAndRun);
522333
522378
  }
522334
- }).version("2.2.2 (localclawd)", "-v, --version", "Output the version number");
522379
+ }).version("2.2.3 (localclawd)", "-v, --version", "Output the version number");
522335
522380
  program2.option("-w, --worktree [name]", "Create a new git worktree for this session (optionally specify a name)");
522336
522381
  program2.option("--tmux", "Create a tmux session for the worktree (requires --worktree). Uses iTerm2 native panes when available; use --tmux=classic for traditional tmux.");
522337
522382
  if (canUserConfigureAdvisor()) {
@@ -522845,7 +522890,7 @@ if (false) {}
522845
522890
  async function main2() {
522846
522891
  const args = process.argv.slice(2);
522847
522892
  if (args.length === 1 && (args[0] === "--version" || args[0] === "-v" || args[0] === "-V")) {
522848
- console.log(`${"2.2.2"} (localclawd)`);
522893
+ console.log(`${"2.2.3"} (localclawd)`);
522849
522894
  return;
522850
522895
  }
522851
522896
  const {
@@ -522936,4 +522981,4 @@ localclawd crashed: ${msg}
522936
522981
  process.exit(1);
522937
522982
  });
522938
522983
 
522939
- //# debugId=7031B70DB63264A864756E2164756E21
522984
+ //# debugId=5847296E05691FE964756E2164756E21
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "localclawd",
3
- "version": "2.2.2",
3
+ "version": "2.2.3",
4
4
  "description": "Local-first coding CLI for vLLM, Ollama, and OpenAI-compatible backends.",
5
5
  "private": false,
6
6
  "type": "module",