mirror of
https://github.com/getpaseo/paseo.git
synced 2026-11-08 09:24:41 +00:00
fix(usage): preserve platform test contracts
This commit is contained in:
@@ -242,13 +242,18 @@ test("named profile ignores agent override and uses existing XDG profile data",
|
||||
);
|
||||
profileDb.close();
|
||||
expect(
|
||||
resolveOmpUsageReference("session-1", "openai-codex", {
|
||||
OMP_PROFILE: "work",
|
||||
PI_PROFILE: "other",
|
||||
PI_CODING_AGENT_DIR: f.agentDir,
|
||||
PI_CONFIG_DIR: join(root, "config"),
|
||||
XDG_DATA_HOME: join(root, "xdg"),
|
||||
}),
|
||||
resolveOmpUsageReference(
|
||||
"session-1",
|
||||
"openai-codex",
|
||||
{
|
||||
OMP_PROFILE: "work",
|
||||
PI_PROFILE: "other",
|
||||
PI_CODING_AGENT_DIR: f.agentDir,
|
||||
PI_CONFIG_DIR: join(root, "config"),
|
||||
XDG_DATA_HOME: join(root, "xdg"),
|
||||
},
|
||||
"linux",
|
||||
),
|
||||
).toEqual({ source: "codex", input: { accessToken: "profile-token" } });
|
||||
});
|
||||
|
||||
|
||||
@@ -129,6 +129,7 @@ export function resolveOmpUsageReference(
|
||||
sessionId: string,
|
||||
provider: string,
|
||||
env: NodeJS.ProcessEnv,
|
||||
platform: NodeJS.Platform = process.platform,
|
||||
): UsageReference | null {
|
||||
let source: string;
|
||||
if (provider === "openai-codex") source = "codex";
|
||||
@@ -136,7 +137,7 @@ export function resolveOmpUsageReference(
|
||||
else return null;
|
||||
if (!sessionId) return null;
|
||||
// Upstream: packages/utils/src/dirs.ts:82-94,330-343,583-585 (profile, override, agent dir).
|
||||
const paths = resolveOmpDiagnosticPaths(env);
|
||||
const paths = resolveOmpDiagnosticPaths(env, undefined, platform);
|
||||
if (hasKeyOverride(provider, env, paths.agentDir)) return null;
|
||||
let db: UsageDb;
|
||||
try {
|
||||
|
||||
@@ -29,7 +29,7 @@ async function checkInternalPluginBoundary(directory: string): Promise<void> {
|
||||
if (hostModules.has(specifier) || isBuiltin(specifier)) continue;
|
||||
const resolved = reader.resolve(specifier, file, dependency.kind);
|
||||
const relative = resolved && path.relative(directory, resolved);
|
||||
const owned = relative && /^(server|shared)\//.test(relative);
|
||||
const owned = relative && /^(server|shared)[\\/]/.test(relative);
|
||||
if (!specifier.startsWith(".") || !owned) {
|
||||
throw new Error(`Internal plugin import boundary: ${file} imports ${specifier}`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user