bazis 0.100.5 → 0.100.6

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.
@@ -232,7 +232,7 @@ export class CodexAppServerClient implements CodexClient {
232
232
  if (method === "account/updated") this.modelCache = undefined;
233
233
  }, () => { this.clearLogin(); this.modelCache = undefined; });
234
234
  const initialized = await client.request("initialize", {
235
- clientInfo: { name: "bazis", title: "Bazis", version: "0.100.5" }, capabilities: { experimentalApi: true },
235
+ clientInfo: { name: "bazis", title: "Bazis", version: "0.100.6" }, capabilities: { experimentalApi: true },
236
236
  }, 15_000, signal);
237
237
  if (resolve(text(initialized.codexHome, 4096)) !== this.paths.home) throw new CodexError("PROTOCOL_ERROR");
238
238
  client.notify("initialized");
@@ -34,6 +34,8 @@ export interface LlmConnectorOptions {
34
34
  * start instead of the first agent request. By default it runs in
35
35
  * development and production and not in the `test` environment, where a
36
36
  * test replaces the model; `true` checks there too, `false` never checks.
37
+ * The same choice applies to `/health`: in tests `infra:llm` does not call
38
+ * the provider and reports healthy.
37
39
  */
38
40
  readonly checkOnStart?: boolean;
39
41
  }
@@ -94,7 +96,7 @@ export function llmConnect<T extends LlmConfigShape>(
94
96
  adapter: LlmProviderAdapter,
95
97
  options: LlmConnectorOptions = {},
96
98
  ): InfraConnector<AgentModelProvider> {
97
- const described = new WeakMap<AgentModelProvider, { connection: LlmConnectionOptions; settings: string[]; check: boolean }>();
99
+ const described = new WeakMap<AgentModelProvider, { connection: LlmConnectionOptions; settings: string[]; check: boolean; offline: boolean }>();
98
100
  return identifyConnector({
99
101
  token: AGENT_MODEL_PROVIDER,
100
102
  config,
@@ -106,7 +108,9 @@ export function llmConnect<T extends LlmConfigShape>(
106
108
  // The environment of this kernel's configuration: tests do not call the real provider.
107
109
  const environment = (configs?.get(config) as { environment?: string } | undefined)?.environment;
108
110
  const check = options.checkOnStart ?? environment !== "test";
109
- described.set(provider, { connection, settings: settingNames(config, configs, ["baseUrl", "apiKey"]), check });
111
+ // In tests the provider is not reached at all, unless checkOnStart: true asks for it.
112
+ const offline = environment === "test" && options.checkOnStart !== true;
113
+ described.set(provider, { connection, settings: settingNames(config, configs, ["baseUrl", "apiKey"]), check, offline });
110
114
  return provider;
111
115
  },
112
116
  connect(provider, signal) {
@@ -126,8 +130,9 @@ export function llmConnect<T extends LlmConfigShape>(
126
130
  dispose(provider) {
127
131
  return adapter.dispose?.(provider);
128
132
  },
133
+ // Like the start check: a test does not reach the real provider.
129
134
  healthCheck: adapter.healthCheck
130
- ? (provider, signal) => adapter.healthCheck?.(provider, signal) ?? false
135
+ ? (provider, signal) => described.get(provider)?.offline === true || (adapter.healthCheck?.(provider, signal) ?? false)
131
136
  : undefined,
132
137
  }, "llm");
133
138
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bazis",
3
- "version": "0.100.5",
3
+ "version": "0.100.6",
4
4
  "description": "Modular backend framework for Bun in TypeScript: DI wired by codegen, HTTP, a PostgreSQL ORM, JWT, WebSocket, agents and a CLI.",
5
5
  "license": "MIT",
6
6
  "author": "Alexander Alenin",