Skip to content

feat(simulate): save generated scenarios, generate from sessions, default to ./scenarios.yaml - #969

Open
u9g wants to merge 4 commits into
mainfrom
jason/simulate-scenarios-from-sessions
Open

feat(simulate): save generated scenarios, generate from sessions, default to ./scenarios.yaml#969
u9g wants to merge 4 commits into
mainfrom
jason/simulate-scenarios-from-sessions

Conversation

@u9g

@u9g u9g commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Summary

Follows the CLI DX discussion with Ben and Nic's first-run feedback in #project-simulations.

  • Generated scenarios get saved. When a source-generated run's scenarios arrive, the TUI asks once whether to write them to scenarios.yaml in the project. Accepting when that name is already taken opens the existing file-name dialog instead of overwriting. The s key still saves later. The generate → simulate flow is otherwise unchanged.
  • ./scenarios.yaml is the default. lk agent simulate (and simulate audio) picks it up without --scenarios; --agent-name is satisfied by it too. So the second run in a project uses what the first run saved.
  • lk agent simulate generate [SESSION_ID...] derives one scenario per recorded session via CreateScenarioFromSession and appends to the scenarios file without running anything. Without IDs it offers the project's recent sessions to pick from; explicit IDs are the non-interactive path.

Notes

  • Recent-session listing uses the analytics sessions API, which is plan-gated (Scale+). Below that, generate without IDs reports "Scale plan or higher is required" and users pass session IDs from the dashboard. Lifting that needs a non-gated session list on the simulation service.
  • Docs in web (CLI agent reference, agents/start/testing/simulations) should mention the default file, the save prompt, and generate; follow-up.

Test plan

  • go test ./cmd/lk passes; new VRT frame simulate_save_offer
  • lk agent simulate generate RM_x reaches the cloud and reports the per-session error
  • --agent-name without a scenarios file prints the new error
  • Save prompt end to end on a real generated run
  • Interactive session picker on a Scale-plan project

🤖 Generated with Claude Code

u9g added 2 commits September 8, 2026 13:27
analyticsGET takes a ProjectConfig so other commands can read the
project's sessions without going through the analytics command's
package-level project.
…/scenarios.yaml

`lk agent simulate` now picks up ./scenarios.yaml without --scenarios.

`lk agent simulate generate [SESSION_ID...]` derives one scenario per
recorded session via CreateScenarioFromSession and appends them to the
scenarios file without running anything. Without IDs it offers the
project's recent sessions to pick from.
@u9g
u9g force-pushed the jason/simulate-scenarios-from-sessions branch from 9843393 to 74d0709 Compare September 8, 2026 19:01
@u9g u9g changed the title feat(simulate): derive scenarios from recent sessions, default to ./scenarios.yaml feat(simulate): save generated scenarios, generate from sessions, default to ./scenarios.yaml Sep 8, 2026
u9g added 2 commits September 8, 2026 15:07
When a source-generated run's scenarios arrive, the TUI asks once
whether to write them to scenarios.yaml in the project. Accepting when
that name is taken opens the existing file-name dialog instead of
overwriting. The s key still saves later.
@u9g
u9g force-pushed the jason/simulate-scenarios-from-sessions branch from 74d0709 to 3e9ca4d Compare September 8, 2026 19:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant