fix(coding-agent): Clean up Path Handling (#4873)
This commit is contained in:
@@ -2,6 +2,7 @@ import { join } from "node:path";
|
||||
import type { ThinkingLevel } from "@earendil-works/pi-agent-core";
|
||||
import type { Model } from "@earendil-works/pi-ai";
|
||||
import { getAgentDir } from "../config.ts";
|
||||
import { resolvePath } from "../utils/paths.ts";
|
||||
import { AuthStorage } from "./auth-storage.ts";
|
||||
import type { SessionStartEvent, ToolDefinition } from "./extensions/index.ts";
|
||||
import { ModelRegistry } from "./model-registry.ts";
|
||||
@@ -129,8 +130,8 @@ function applyExtensionFlagValues(
|
||||
export async function createAgentSessionServices(
|
||||
options: CreateAgentSessionServicesOptions,
|
||||
): Promise<AgentSessionServices> {
|
||||
const cwd = options.cwd;
|
||||
const agentDir = options.agentDir ?? getAgentDir();
|
||||
const cwd = resolvePath(options.cwd);
|
||||
const agentDir = options.agentDir ? resolvePath(options.agentDir) : getAgentDir();
|
||||
const authStorage = options.authStorage ?? AuthStorage.create(join(agentDir, "auth.json"));
|
||||
const settingsManager = options.settingsManager ?? SettingsManager.create(cwd, agentDir);
|
||||
const modelRegistry = options.modelRegistry ?? ModelRegistry.create(authStorage, join(agentDir, "models.json"));
|
||||
|
||||
Reference in New Issue
Block a user