mirror of
https://github.com/getpaseo/paseo.git
synced 2026-07-29 12:01:31 +00:00
fix(server): resolve agent cwd to absolute path at creation time
Relative paths like "." resolve differently depending on where the server is started, causing agent history files to be stored under different directories. This fixes the empty state issue when loading agents created with relative paths. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { randomUUID } from "node:crypto";
|
||||
import { resolve } from "node:path";
|
||||
|
||||
import type {
|
||||
AgentCapabilityFlags,
|
||||
@@ -773,6 +774,12 @@ export class AgentManager {
|
||||
config: AgentSessionConfig
|
||||
): Promise<AgentSessionConfig> {
|
||||
const normalized: AgentSessionConfig = { ...config };
|
||||
|
||||
// Always resolve cwd to absolute path for consistent history file lookup
|
||||
if (normalized.cwd) {
|
||||
normalized.cwd = resolve(normalized.cwd);
|
||||
}
|
||||
|
||||
const resolvedModel = await resolveAgentModel({
|
||||
provider: normalized.provider,
|
||||
requestedModel: normalized.model,
|
||||
|
||||
Reference in New Issue
Block a user