Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(usage): resolve transcript dirs from providerInstances #6312

ClosedThYpHo0n(GitHub profile, opens in a new tab)wants to merge 1 commit intomain fromrefs/pull/6312/headopened View on GitHub

Showing 2 changed files with 95 additions and 21 deletions.

x
0 of 2 viewed, 2 left
44 additions and 0 deletionsapps/server/src/usage/UsageService.test.tsAdded
View file
@@ -0,0 +1,44 @@
+import * as NodeServices from "@effect/platform-node/NodeServices";
+import { describe, expect, it } from "@effect/vitest";
+import { ServerSettings } from "@t3tools/contracts";
+import * as Effect from "effect/Effect";
+import * as Path from "effect/Path";
+import * as Schema from "effect/Schema";
+​
+import { resolveTranscriptDirsForSettings } from "./UsageService.ts";
+​
+const decodeSettings = Schema.decodeSync(ServerSettings);
+​
+it.layer(NodeServices.layer)("resolveTranscriptDirsForSettings", (it) => {
+ describe("provider instances", () => {
+ it.effect("includes custom Codex homes and deduplicates legacy homes", () =>
+ Effect.gen(function* () {
+ const path = yield* Path.Path;
+ const legacyHome = path.resolve("/tmp/t3-legacy-codex-home");
+ const instanceHome = path.resolve("/tmp/t3-instance-codex-home");
+ const settings = decodeSettings({
+ providers: { codex: { homePath: legacyHome } },
+ providerInstances: {
+ codex_work: {
+ driver: "codex",
+ enabled: true,
+ config: { homePath: instanceHome },
+ },
+ codex_legacy_duplicate: {
+ driver: "codex",
+ enabled: true,
+ config: { homePath: legacyHome },