mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-09-13 18:32:12 +03:00
Landed with the design call resolved per the owner's pick — **option 1**: the synced store is now endpoint-agnostic (persistDiscoveredModels and managedModelImport no longer drop non-chat models at write time), and chat selectability moved to read time (auto-pool expansion in autoStrategy applies filterChatSelectableModels; the models-route projection already had its chatOnly filter). Your discovery test now passes end-to-end (3/3): /api/show capabilities persist per connection and image/embedding requests route through the advertising host. Reconciliation notes: conflicted areas merged onto the current tip (adobe discovery import, requestedModel preflight signature, resolvedProvider fast-path coexists with the synced-route override — explicit resolution wins); carried base-red drains (#10055 memoization, #11071 test variants) dropped as already-landed; the managed-model-import exclusion test was propagated to the new contract (image/video models persist; the read filter still hides them from chat pickers — pinned by a new assertion). Full battery: 205/206 focused (the one red is a confirmed periodic-timer timing flake on the loaded devbox — 20/20 isolated), autoCombo vitest 30/30, combo suites 46/46, gates + typecheck clean. Thank you @yourspraveen — the capability probe + routing design was right; it just needed the store contract opened up. Fixes #11087.
66 lines
3.1 KiB
TypeScript
66 lines
3.1 KiB
TypeScript
/**
|
|
* tests/unit/claude-codex-identity-version-sync.test.ts
|
|
*
|
|
* Guards the pinned CLI identity versions against drift. The Claude Code version
|
|
* lives in FOUR places (claudeIdentity, anthropicHeaders, claudeCodeCompatible,
|
|
* ccBridgeTransforms) and MUST stay in lockstep — a partial bump produces an
|
|
* inconsistent wire fingerprint. The Codex client version lives in codexClient.
|
|
*
|
|
* When you capture a newer claude-cli / codex release, bump ALL constants and
|
|
* update the pinned values below in the same change.
|
|
*/
|
|
|
|
import test from "node:test";
|
|
import assert from "node:assert/strict";
|
|
|
|
const id = await import("../../open-sse/executors/claudeIdentity.ts");
|
|
const hdr = await import("../../open-sse/config/anthropicHeaders.ts");
|
|
const compat = await import("../../open-sse/services/claudeCodeCompatible.ts");
|
|
const bridge = await import("../../open-sse/services/ccBridgeTransforms.ts");
|
|
const codexCfg = await import("../../open-sse/config/codexClient.ts");
|
|
const canonical = await import("../../src/shared/constants/claudeCodeClient.ts");
|
|
|
|
test("Claude CLI version constants are in lockstep across all 4 sources", () => {
|
|
const V = canonical.CLAUDE_CODE_CLIENT_VERSION;
|
|
assert.equal(id.CLAUDE_CODE_VERSION, V, "claudeIdentity.CLAUDE_CODE_VERSION drift");
|
|
assert.equal(hdr.CLAUDE_CLI_VERSION, V, "anthropicHeaders.CLAUDE_CLI_VERSION drift");
|
|
assert.equal(compat.CLAUDE_CODE_COMPATIBLE_VERSION, V, "claudeCodeCompatible version drift");
|
|
assert.equal(bridge.DEFAULT_CLAUDE_CODE_VERSION, V, "ccBridgeTransforms version drift");
|
|
assert.equal(
|
|
hdr.CLAUDE_CLI_USER_AGENT,
|
|
`claude-cli/${V} (external, cli)`,
|
|
"CLAUDE_CLI_USER_AGENT drift"
|
|
);
|
|
assert.equal(
|
|
compat.CLAUDE_CODE_COMPATIBLE_USER_AGENT,
|
|
`claude-cli/${V} (external, sdk-cli)`,
|
|
"CLAUDE_CODE_COMPATIBLE_USER_AGENT drift"
|
|
);
|
|
});
|
|
|
|
test("Claude CLI wire versions match the captured 2.1.220 binary", () => {
|
|
assert.equal(canonical.CLAUDE_CODE_CLIENT_VERSION, "2.1.220");
|
|
assert.equal(canonical.CLAUDE_CODE_CLIENT_BUILD_REVISION, "1f2");
|
|
assert.equal(canonical.CLAUDE_CODE_CLIENT_BILLING_VERSION, "2.1.220.1f2");
|
|
assert.equal(canonical.CLAUDE_CODE_SDK_PACKAGE_VERSION, "0.94.0");
|
|
assert.equal(canonical.CLAUDE_CODE_RUNTIME_VERSION, "v26.3.0");
|
|
assert.equal(
|
|
compat.CLAUDE_CODE_COMPATIBLE_STAINLESS_PACKAGE_VERSION,
|
|
canonical.CLAUDE_CODE_SDK_PACKAGE_VERSION
|
|
);
|
|
assert.equal(
|
|
compat.CLAUDE_CODE_COMPATIBLE_STAINLESS_RUNTIME_VERSION,
|
|
canonical.CLAUDE_CODE_RUNTIME_VERSION
|
|
);
|
|
assert.equal(hdr.CLAUDE_CLI_STAINLESS_PACKAGE_VERSION, canonical.CLAUDE_CODE_SDK_PACKAGE_VERSION);
|
|
assert.equal(hdr.CLAUDE_CLI_STAINLESS_RUNTIME_VERSION, canonical.CLAUDE_CODE_RUNTIME_VERSION);
|
|
assert.equal(hdr.CLAUDE_CLI_BILLING_VERSION, canonical.CLAUDE_CODE_CLIENT_BILLING_VERSION);
|
|
});
|
|
|
|
test("Codex client is pinned to the captured 0.149.0 release", () => {
|
|
assert.equal(codexCfg.getCodexClientVersion(), "0.149.0");
|
|
assert.equal(codexCfg.getCodexUserAgent(), "codex-cli/0.149.0 (Windows 10.0.26200; x64)");
|
|
assert.equal(codexCfg.getCodexDefaultHeaders().Version, "0.149.0");
|
|
assert.equal(codexCfg.getCodexCliRsHeaders()["User-Agent"], "codex_cli_rs/0.149.0");
|
|
});
|