clementine-agent 1.18.4 → 1.18.5

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/config.js +26 -0
  2. package/package.json +1 -1
package/dist/config.js CHANGED
@@ -27,6 +27,32 @@ function readEnvFile() {
27
27
  return parseEnvText(readFileSync(envPath, 'utf-8'));
28
28
  }
29
29
  const env = readEnvFile();
30
+ // ── Claude Code CLI runtime env propagation ─────────────────────────
31
+ //
32
+ // The Claude Code CLI binary bundled inside @anthropic-ai/claude-agent-sdk
33
+ // auto-attaches the `context-1m-2025-08-07` beta header for any model that
34
+ // supports a 1M context (Sonnet 4.6, Opus 4.6/4.7, etc.). On accounts
35
+ // without the "extra usage" entitlement, every API call then fails with
36
+ // "Extra usage is required for 1M context."
37
+ //
38
+ // We don't ask for 1M anywhere in our code, but the CLI does on its own.
39
+ // The CLI honors CLAUDE_CODE_DISABLE_1M_CONTEXT — when truthy, the auto-
40
+ // enable path is skipped and the standard 200K context is used.
41
+ //
42
+ // Default to disabled here so users without extra usage stop hitting the
43
+ // gate. Anyone who has paid for / been entitled to 1M can opt back in by
44
+ // setting CLAUDE_CODE_DISABLE_1M_CONTEXT=0 in their .env.
45
+ {
46
+ const userPref = env['CLAUDE_CODE_DISABLE_1M_CONTEXT'] ?? process.env.CLAUDE_CODE_DISABLE_1M_CONTEXT;
47
+ if (userPref === undefined || userPref === '') {
48
+ process.env.CLAUDE_CODE_DISABLE_1M_CONTEXT = '1';
49
+ }
50
+ else {
51
+ // Propagate the user's explicit choice from .env into process.env so the
52
+ // spawned CLI subprocess inherits it.
53
+ process.env.CLAUDE_CODE_DISABLE_1M_CONTEXT = userPref;
54
+ }
55
+ }
30
56
  // ── Keychain-ref resolution (lazy, cached) ──────────────────────────
31
57
  //
32
58
  // `.env` may store keychain stubs ("keychain:clementine-agent-FOO") in place
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clementine-agent",
3
- "version": "1.18.4",
3
+ "version": "1.18.5",
4
4
  "description": "Clementine — Personal AI Assistant (TypeScript)",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",