feat: add saveSession flag to create scenario runs

- Add optional `saveSession` boolean parameter to CreateScenarioRunDto
- Add `saveSession` column to ScenarioRunEntity
- When saveSession=true and run completes, preserve the browser context as a named explore session instead of closing it
- Session name follows pattern: run-{runId}
- Automatically extracts token and localStorage for session persistence
- Injected SessionService and SessionContextService into ScenarioSchedulerService
- Updated MCP run_scenario tool to accept saveSession parameter
- Updated UI run dialog with checkbox to enable session preservation
- Client API updated to pass saveSession flag
This commit is contained in:
ars9 committed 2026-04-14 18:54:45 +03:00
1 parent 0e47623a6b
commit 196bf4c2e8
9 files changed
+88 -14

No files matched your search

+1 -1
View File
@@ -214,7 +214,7 @@ export class ScenarioController {
@Param("id", ParseUUIDPipe) id: string,
@Body() dto: CreateScenarioRunDto,
) {
return this.scenarioService.createRun(id, dto.environmentId);
return this.scenarioService.createRun(id, dto.environmentId, dto.saveSession);
}
@Get(":id/run/:runId")