Skip to content

feat: include simulator flow nodes from other files - #1032

Open
chenghao-mou wants to merge 11 commits into
chenghao/feat/AGT-3725-public-simulator-flow-schemafrom
chenghao/feat/AGT-3707-simulator-flow-includes
Open

chenghao-mou wants to merge 11 commits into
chenghao/feat/AGT-3725-public-simulator-flow-schemafrom
chenghao/feat/AGT-3707-simulator-flow-includes

Conversation

@chenghao-mou

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

Copy link
Copy Markdown
Member

Shared nodes such as a menu or a person no longer need copying into every scenarios file:

include: [nodes/menus.yaml, nodes/people.yaml]
scenarios:
  - label: menu-to-sam
    start: menu   # defined in nodes/menus.yaml

Paths are relative to the naming file, includes nest, and each file loads once. An included file holds only nodes and include. Cycles, a node defined in two files, and missing paths fail with the files named. Includes resolve on the client, so the server still receives one flat nodes map.

Not in this PR: the path-based Python loader in agents-private, which AGT-3707 also asks for.

Warning

Stacked on #1031.

Addresses AGT-3707

Initial prompt and agent context

Model: Claude Opus 5.5

does it support reading from another file for the steps

Can you open a stacked PR on that for this

@chenghao-mou
chenghao-mou force-pushed the chenghao/feat/AGT-3707-simulator-flow-includes branch from e2fbefc to fb07d1c Compare October 13, 2026 14:04
@chenghao-mou chenghao-mou changed the title feat: include simulator flow steps from other files feat: include simulator flow nodes from other files Oct 13, 2026
@chenghao-mou
chenghao-mou force-pushed the chenghao/feat/AGT-3707-simulator-flow-includes branch 4 times, most recently from eb74116 to 7e50e50 Compare October 21, 2026 11:31
@chenghao-mou
chenghao-mou added this pull request to stack #1068 October 21, 2026 11:50
@chenghao-mou
chenghao-mou force-pushed the chenghao/feat/AGT-3707-simulator-flow-includes branch from 7e50e50 to ee4fd5b Compare October 21, 2026 11:50
@chenghao-mou
chenghao-mou marked this pull request as ready for review October 21, 2026 11:50
A scenarios file had to hold every node its scenarios use, so shared
nodes such as a menu or a person were copied into each file. A top-level
`include` list now takes the nodes of other files. Paths are relative to
the file that names them, includes nest, and each file loads once by its
real path. An included file holds only `nodes` and `include`.

Includes resolve here, on the client: the server receives one flat
`nodes` map, so the protocol and the server do not change.

Addresses AGT-3707
@chenghao-mou
chenghao-mou force-pushed the chenghao/feat/AGT-3707-simulator-flow-includes branch from c2eee74 to 6dc2ac4 Compare October 21, 2026 14:48
…to chenghao/feat/AGT-3707-simulator-flow-includes
…to chenghao/feat/AGT-3707-simulator-flow-includes
…to chenghao/feat/AGT-3707-simulator-flow-includes
devin-ai-integration[bot]

This comment was marked as resolved.

…to chenghao/feat/AGT-3707-simulator-flow-includes

# Conflicts:
#	cmd/lk/simulate.go
devin-ai-integration[bot]

This comment was marked as resolved.

Make the root path absolute before resolving symlinks, so one file reached
by relative and absolute paths loads once. Resolve relative includes beside
the path a file was named by, not beside a symlink's target. Name files
relative to the root in errors, reject empty and directory includes, and
reject unknown top-level keys in a scenarios file that uses flows.
Merge chenghao/feat/AGT-3725-public-simulator-flow-schema (8f65684), keeping
the per-file node loop and its file names in errors.

- Resolve every directory on an include path through symlinks before any
  `..` applies, so `link/../x.yaml` is the file beside link's target, not a
  file beside link.
- Identify files with os.SameFile, so one file under two letter cases or
  two spellings loads once.
- Allow top-level `x-` keys for YAML anchors in scenarios and included
  files; read only the keys when checking them, so the schema-aware reader
  reports anchors that contain themselves.
- Refuse to write scenario ids into a file with no `scenarios`, which
  would break every file that includes it.
…to chenghao/feat/AGT-3707-simulator-flow-includes
…to chenghao/feat/AGT-3707-simulator-flow-includes
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