@velum-labs/routekit-daemon 1.0.18 → 1.0.19
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.
|
@@ -102,7 +102,7 @@ const acquireGatewayGeneration = Effect.fn("GatewayGeneration.acquire")(function
|
|
|
102
102
|
const requiredKinds = new Set(["claude-code", "codex"].filter((provider) => options.config.providers[provider] !== undefined &&
|
|
103
103
|
options.sources?.[provider] === undefined));
|
|
104
104
|
for (const kind of requiredKinds) {
|
|
105
|
-
if ((accountSets[kind]?.
|
|
105
|
+
if ((accountSets[kind]?.enrolledSize ?? 0) === 0) {
|
|
106
106
|
return yield* new RouteKitFailure({
|
|
107
107
|
message: `provider "${kind}" requires an enrolled account; ` +
|
|
108
108
|
`run \`routekit accounts login ${kind} --name <label>\``
|
|
@@ -10,6 +10,50 @@ import { createServiceRecordStore } from "@velum-labs/routekit-runtime/service";
|
|
|
10
10
|
import { runRouteKitEffect, runRouteKitEffectExit, throwRouteKitExit } from "@velum-labs/routekit-runtime/effect";
|
|
11
11
|
import { startRouteKitDaemon } from "../index.js";
|
|
12
12
|
import { mockProvider, nativeCredential, withMockNativeDiscovery } from "./daemon-fixtures.js";
|
|
13
|
+
test("broken optional subscription credentials do not block a healthy API provider", async () => {
|
|
14
|
+
const root = mkdtempSync(join(tmpdir(), "routekit-daemon-broken-subscription-"));
|
|
15
|
+
const stateHome = join(root, "state");
|
|
16
|
+
const configPath = join(root, "router.yaml");
|
|
17
|
+
const accountsDirectory = join(stateHome, "subscriptions", "codex");
|
|
18
|
+
mkdirSync(accountsDirectory, { recursive: true, mode: 0o700 });
|
|
19
|
+
writeFileSync(join(accountsDirectory, "broken.json"), "{not-json", { mode: 0o600 });
|
|
20
|
+
writeFileSync(configPath, [
|
|
21
|
+
"providers:",
|
|
22
|
+
" openai: {}",
|
|
23
|
+
" codex: {}",
|
|
24
|
+
"defaultModel: openai/mock-model",
|
|
25
|
+
""
|
|
26
|
+
].join("\n"));
|
|
27
|
+
const upstream = await mockProvider();
|
|
28
|
+
let daemon;
|
|
29
|
+
try {
|
|
30
|
+
daemon = await startRouteKitDaemon({
|
|
31
|
+
packageVersion: "1.2.3",
|
|
32
|
+
stateHome,
|
|
33
|
+
configPath,
|
|
34
|
+
port: 0,
|
|
35
|
+
portless: false,
|
|
36
|
+
env: {
|
|
37
|
+
HOME: root,
|
|
38
|
+
ROUTEKIT_HOME: stateHome,
|
|
39
|
+
OPENAI_API_KEY: "test-key",
|
|
40
|
+
OPENAI_BASE_URL: upstream.url,
|
|
41
|
+
ROUTEKIT_PORTLESS: "0"
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
const dataToken = readFileSync(daemon.record.authTokenFile, "utf8").trim();
|
|
45
|
+
const models = (await (await fetch(`${daemon.dataUrl}/v1/models`, {
|
|
46
|
+
headers: { authorization: `Bearer ${dataToken}` }
|
|
47
|
+
})).json());
|
|
48
|
+
assert.deepEqual(models.data.map((model) => model.id), ["openai/mock-model"]);
|
|
49
|
+
}
|
|
50
|
+
finally {
|
|
51
|
+
if (daemon !== undefined)
|
|
52
|
+
await daemon.close();
|
|
53
|
+
await upstream.close();
|
|
54
|
+
rmSync(root, { recursive: true, force: true });
|
|
55
|
+
}
|
|
56
|
+
});
|
|
13
57
|
test("this-checkout daemon routes model auto only from dimension-matrix evidence", async () => {
|
|
14
58
|
const root = mkdtempSync(join(tmpdir(), "routekit-daemon-eval-auto-"));
|
|
15
59
|
const stateHome = join(root, "state");
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@velum-labs/routekit-daemon",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.19",
|
|
5
5
|
"description": "Singleton RouteKit control daemon and stable model gateway.",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -44,15 +44,15 @@
|
|
|
44
44
|
"effect": "4.0.0-rc.108",
|
|
45
45
|
"posthog-node": "5.46.1",
|
|
46
46
|
"yaml": "2.9.0",
|
|
47
|
-
"@velum-labs/routekit-accounts": "1.0.
|
|
48
|
-
"@velum-labs/routekit-config": "1.0.
|
|
49
|
-
"@velum-labs/routekit-control": "1.0.
|
|
50
|
-
"@velum-labs/routekit-eval-contracts": "1.0.
|
|
51
|
-
"@velum-labs/routekit-eval-store": "1.0.
|
|
52
|
-
"@velum-labs/routekit-gateway": "1.0.
|
|
53
|
-
"@velum-labs/routekit-registry": "1.0.
|
|
54
|
-
"@velum-labs/routekit-runtime": "1.0.
|
|
55
|
-
"@velum-labs/routekit-telemetry-core": "1.0.
|
|
47
|
+
"@velum-labs/routekit-accounts": "1.0.19",
|
|
48
|
+
"@velum-labs/routekit-config": "1.0.19",
|
|
49
|
+
"@velum-labs/routekit-control": "1.0.19",
|
|
50
|
+
"@velum-labs/routekit-eval-contracts": "1.0.19",
|
|
51
|
+
"@velum-labs/routekit-eval-store": "1.0.19",
|
|
52
|
+
"@velum-labs/routekit-gateway": "1.0.19",
|
|
53
|
+
"@velum-labs/routekit-registry": "1.0.19",
|
|
54
|
+
"@velum-labs/routekit-runtime": "1.0.19",
|
|
55
|
+
"@velum-labs/routekit-telemetry-core": "1.0.19"
|
|
56
56
|
},
|
|
57
57
|
"scripts": {
|
|
58
58
|
"build": "tsc -b",
|