fix(coding-agent): parse quoted import paths and missing files
This commit is contained in:
@@ -33,6 +33,16 @@ export type CreateAgentSessionRuntimeFactory = (options: {
|
||||
sessionStartEvent?: SessionStartEvent;
|
||||
}) => Promise<CreateAgentSessionRuntimeResult>;
|
||||
|
||||
export class SessionImportFileNotFoundError extends Error {
|
||||
readonly filePath: string;
|
||||
|
||||
constructor(filePath: string) {
|
||||
super(`File not found: ${filePath}`);
|
||||
this.name = "SessionImportFileNotFoundError";
|
||||
this.filePath = filePath;
|
||||
}
|
||||
}
|
||||
|
||||
function extractUserMessageText(content: string | Array<{ type: string; text?: string }>): string {
|
||||
if (typeof content === "string") {
|
||||
return content;
|
||||
@@ -251,7 +261,7 @@ export class AgentSessionRuntime {
|
||||
async importFromJsonl(inputPath: string, cwdOverride?: string): Promise<{ cancelled: boolean }> {
|
||||
const resolvedPath = resolve(inputPath);
|
||||
if (!existsSync(resolvedPath)) {
|
||||
throw new Error(`File not found: ${resolvedPath}`);
|
||||
throw new SessionImportFileNotFoundError(resolvedPath);
|
||||
}
|
||||
|
||||
const sessionDir = this.session.sessionManager.getSessionDir();
|
||||
|
||||
Reference in New Issue
Block a user