Skip to content

agent simulate: read simulator flow nodes from scenarios.yaml - #1031

Draft
chenghao-mou wants to merge 2 commits into
mainfrom
chenghao/feat/AGT-3725-public-simulator-flow-schema
Draft

chenghao-mou wants to merge 2 commits into
mainfrom
chenghao/feat/AGT-3725-public-simulator-flow-schema

Conversation

@chenghao-mou

@chenghao-mou chenghao-mou commented Oct 12, 2026 •

Copy link
Copy Markdown
Member

lk agent simulate reads simulator flows from scenarios.yaml: a top-level nodes map, and start and max_duration on a scenario. They go to the server in the ScenarioGroup added by livekit/protocol#1856.

nodes:
  menu:
    say: "For appointments, press 1."
    speaker: MACHINE
    routes: [{ match: "1", to: sam }]
    timeout: { after: 8s, to: livekit/voicemail }
  sam:
    instructions: You are Sam Lee. Confirm tomorrow's 10am cleaning.
scenarios:
  - label: menu-to-sam
    start: menu
    agent_expectations: Presses 1, then confirms the appointment with Sam.
  • Each node is decoded with protojson, so field names, enum names, durations, and unknown keys behave exactly as on the server. An error names the node, for example node "menu": ....
  • The CLI checks two things locally: a scenario sets exactly one of start and instructions, and start names a node or a built-in (livekit/hangup, livekit/voicemail, livekit/unavailable). The server compiles and validates the rest at CreateSimulationRun.
  • The YAML export writes nodes, start, and max_duration back, and adding scenario ids leaves nodes untouched. Files without flows are unchanged.

Warning

Depends on livekit/protocol#1856; go.mod points at its branch until it ships.

Not in this PR: the public OpenAPI client in pkg/public/oapi, which regenerates after the protocol change ships. Copying a flow scenario from a run in the TUI still yields a stub without its nodes.

Addresses AGT-3725

Read the top-level `steps` map and the per-scenario `start` and
`max_duration` keys, and send them in the ScenarioGroup. Each step is
decoded with protojson, so field names, enum names, durations, and
unknown-key errors match the server's parser.

Check only clear user errors locally: a scenario must set exactly one
of `start` and `instructions`, and `start` must name a step or a
built-in. The server validates the rest at CreateSimulationRun.

Bump github.com/livekit/protocol to b440b893 for the new fields.

Addresses AGT-3725
Follows the protocol rename: scenarios.yaml takes a top-level `nodes` map,
and errors say node. A node can no longer be a voicemail box; scenarios
reach one through the built-in livekit/voicemail.
@chenghao-mou chenghao-mou changed the title agent simulate: read simulator flow steps from scenarios.yaml agent simulate: read simulator flow nodes from scenarios.yaml Oct 13, 2026
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