opencode-anthropic-fix 0.3.0-beta.0 → 0.4.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.
@@ -131,12 +131,26 @@ export const ADAPTER_ENV_KEYS = Object.freeze([
131
131
  ]);
132
132
 
133
133
  /**
134
- * Protocol identity of the pinned profile (`claude-code-2.1.195`). Used to
135
- * decide whether a `profileOverride` is needed at all — see
136
- * `resolveProfileOverride` for the user-agent convergence argument.
134
+ * Protocol identity of the profile this adapter composes against
135
+ * (`claude-code-2.1.233-sdk-0.112.1`). Used to decide whether a
136
+ * `profileOverride` is needed at all — see `resolveProfileOverride` for the
137
+ * user-agent convergence argument.
138
+ *
139
+ * PROFILE INHERITANCE POLICY. The adapter never passes an explicit `profile`
140
+ * argument to the package's entry points; omitting it IS the mechanism by which
141
+ * the plugin inherits whatever `DEFAULT_PROFILE` the installed
142
+ * `@tormentalabs/claude-code-wire-compat` declares. The dependency is tracked at
143
+ * the `latest` dist-tag, so each package release can advance the default profile
144
+ * and the plugin follows without a code change to the composition path.
145
+ *
146
+ * These two constants are the ONLY thing that has to move in lockstep: they
147
+ * mirror the default profile's `cliVersion` / `userAgent` so that
148
+ * `resolveProfileOverride` stays silent in the common case. Keep them in sync
149
+ * with `FALLBACK_CLAUDE_CLI_VERSION` (lib/request-headers.mjs) on every package
150
+ * bump that changes the default profile.
137
151
  */
138
- export const PROFILE_CLI_VERSION = "2.1.195";
139
- export const PROFILE_USER_AGENT = "claude-cli/2.1.195 (external, cli)";
152
+ export const PROFILE_CLI_VERSION = "2.1.233";
153
+ export const PROFILE_USER_AGENT = "claude-cli/2.1.233 (external, cli)";
140
154
 
141
155
  // ---------------------------------------------------------------------------
142
156
  // Environment snapshot
@@ -179,12 +193,12 @@ export function buildAdapterUserAgent(version, env) {
179
193
  }
180
194
 
181
195
  /**
182
- * The pinned profile carries a FIXED `userAgent`
183
- * (`"claude-cli/2.1.195 (external, cli)"`) while the plugin builds one
196
+ * The inherited default profile carries a FIXED `userAgent`
197
+ * (`"claude-cli/2.1.233 (external, cli)"`) while the plugin builds one
184
198
  * dynamically from entrypoint / agent-sdk version / client-app. In the common
185
199
  * case — no `CLAUDE_CODE_ENTRYPOINT`, no `CLAUDE_AGENT_SDK_VERSION`, no
186
- * `CLAUDE_AGENT_SDK_CLIENT_APP`, detected CLI version `2.1.195` — both sides
187
- * produce the byte-identical `"claude-cli/2.1.195 (external, cli)"`, so no
200
+ * `CLAUDE_AGENT_SDK_CLIENT_APP`, detected CLI version `2.1.233` — both sides
201
+ * produce the byte-identical `"claude-cli/2.1.233 (external, cli)"`, so no
188
202
  * override is emitted and the request stays byte-identical to the profile.
189
203
  *
190
204
  * When they diverge, `userAgent` and `cliVersion` are validated TOGETHER by the
@@ -16,7 +16,10 @@
16
16
  // Version / build / SDK constants
17
17
  // ---------------------------------------------------------------------------
18
18
 
19
- export const FALLBACK_CLAUDE_CLI_VERSION = "2.1.195";
19
+ // Tracks the CLI version of the wire-compat package's DEFAULT_PROFILE (see
20
+ // lib/mimicry/adapter-input.mjs PROFILE_CLI_VERSION). Bump both together when
21
+ // the package ships a newer default profile.
22
+ export const FALLBACK_CLAUDE_CLI_VERSION = "2.1.233";
20
23
  export const CLAUDE_CODE_NPM_LATEST_URL = "https://registry.npmjs.org/@anthropic-ai/claude-code/latest";
21
24
  // Real build markers extracted from the 2.1.195 native binary
22
25
  // (Bun-embedded JS): `BUILD_TIME:"2026-06-26T01:00:56Z"`,
@@ -38,6 +41,11 @@ export const ANTHROPIC_SDK_VERSION = "0.94.0";
38
41
 
39
42
  // Map of CLI version to bundled SDK version (update when CLI version changes)
40
43
  export const CLI_TO_SDK_VERSION = new Map([
44
+ // 2.1.233: the wire-compat package's DEFAULT_PROFILE
45
+ // (`claude-code-2.1.233-sdk-0.112.1`) declares sdkVersion 0.112.1, so the
46
+ // legacy header path stays consistent with the adapter path when the tracked
47
+ // CLI version is the profile baseline.
48
+ ["2.1.233", "0.112.1"],
41
49
  // 2.1.160-2.1.195: refusal-fallback feature (server-side-fallback /
42
50
  // fallback-credit betas) is opt-in/GrowthBook-gated and never emitted on a
43
51
  // default /v1/messages turn; no wire SDK bump (binary-verified:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-anthropic-fix",
3
- "version": "0.3.0-beta.0",
3
+ "version": "0.4.0",
4
4
  "license": "GPL-3.0-or-later",
5
5
  "repository": {
6
6
  "type": "git",
@@ -55,6 +55,6 @@
55
55
  "vitest": "^4.0.18"
56
56
  },
57
57
  "dependencies": {
58
- "@tormentalabs/claude-code-wire-compat": "0.1.0"
58
+ "@tormentalabs/claude-code-wire-compat": "latest"
59
59
  }
60
60
  }