fix: Failed to take screenshot: Error: ENAMETOOLONG: name too long, open '/home/runner/work/TidGi-Desktop/TidGi-Desktop/userData-test/logs/screenshots/Agent workflow - Create notes- update embeddings- then search/2025-10-30T11-46-28-891Z-I type -在 wiki 工作区创建一个名为 AI Agent Guide 的笔记-内容是-智能体是一种可以执行任务的AI系统-它可以使用工具-搜索信息并与用户交互- in -chat input- element with selec-PASSED-page.png'

This commit is contained in:
lin onetwo 2025-10-30 23:18:37 +08:00
parent 3d2e36bcbf
commit aed9843455

View file

@ -222,10 +222,12 @@ AfterStep(async function(this: ApplicationWorld, { pickle, pickleStep, result })
}
}
const scenarioName = pickle.name;
const cleanScenarioName = makeSlugPath(scenarioName);
const scenarioName = pickle.name;
// Limit scenario slug to avoid extremely long directory names
const cleanScenarioName = makeSlugPath(scenarioName, 60);
const cleanStepText = makeSlugPath(stepText, 120);
// Limit step text slug to avoid excessively long filenames which can trigger ENAMETOOLONG
const cleanStepText = makeSlugPath(stepText, 80);
const stepStatus = result && typeof result.status === 'string' ? result.status : 'unknown-status';
const featureDirectory = path.resolve(screenshotsDirectory, cleanScenarioName);