@axiom-lattice/gateway 3.0.8 → 3.0.10

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.
package/dist/index.js CHANGED
@@ -6912,11 +6912,10 @@ var WorkspaceController = class {
6912
6912
  projectId
6913
6913
  };
6914
6914
  const filename2 = getFilenameFromPath(resolvedPath);
6915
- const isBinary = this.isBinaryContentType(filename2);
6916
6915
  const volumeBackend = await sandboxManager.getVolumeBackendForPath(volumeConfig, resolvedPath);
6917
6916
  let buf;
6918
6917
  if (volumeBackend) {
6919
- if (isBinary && volumeBackend.readBinary) {
6918
+ if (volumeBackend.readBinary) {
6920
6919
  buf = await volumeBackend.readBinary(resolvedPath);
6921
6920
  } else {
6922
6921
  const fileData = await volumeBackend.readRaw(resolvedPath);
@@ -6931,10 +6930,12 @@ var WorkspaceController = class {
6931
6930
  return reply.status(200).type(inferredContentType).header("Content-Disposition", contentDisposition).send(buf);
6932
6931
  }
6933
6932
  const { backend } = await this.getBackend(tenantId, workspaceId, projectId, assistantId, resolvedPath);
6934
- const content = await backend.read(resolvedPath, 0, Infinity);
6933
+ if (!backend.readBinary) {
6934
+ throw new Error("Filesystem backend does not support binary reads");
6935
+ }
6936
+ const buffer = await backend.readBinary(resolvedPath);
6935
6937
  const filename = getFilenameFromPath(resolvedPath);
6936
6938
  const mimeType = getContentTypeFromFilename(filename);
6937
- const buffer = Buffer.from(content, "utf-8");
6938
6939
  return reply.status(200).type(mimeType).header("Content-Disposition", `attachment; filename*=UTF-8''${encodeURIComponent(filename)}`).send(buffer);
6939
6940
  } catch (error) {
6940
6941
  const message = error instanceof Error ? error.message : String(error);
@@ -8413,12 +8414,15 @@ var EvalRunner = class {
8413
8414
  }
8414
8415
  resolvedJudgeModelKey = judgeModelKey;
8415
8416
  } else {
8416
- const firstModel = import_core31.modelLatticeManager.getAllLattices()[0];
8417
- if (!firstModel) {
8417
+ const models = import_core31.modelLatticeManager.getAllLattices();
8418
+ const defaultModel = models.find((m) => m.key === "default");
8419
+ resolvedJudgeModelKey = defaultModel?.key ?? models[0]?.key ?? "";
8420
+ if (!resolvedJudgeModelKey) {
8418
8421
  throw new Error("No model registered \u2014 cannot run eval without a judge model");
8419
8422
  }
8420
- resolvedJudgeModelKey = firstModel.key;
8421
- console.warn(`[eval-runner] Project "${project.name}" has no judge modelKey \u2014 falling back to first registered model "${firstModel.key}"`);
8423
+ if (!defaultModel) {
8424
+ console.warn(`[eval-runner] Project "${project.name}" has no judge modelKey and no "default" model \u2014 falling back to first registered model "${resolvedJudgeModelKey}"`);
8425
+ }
8422
8426
  }
8423
8427
  const runId = (0, import_uuid4.v4)();
8424
8428
  const concurrency = Math.max(1, Math.floor(project.concurrency) || 3);