Skip to content

graph::language::build_graph discards Routing::Conditional targets #167

Description

@senamakel

Problem

In crates/tinyagents-graph/src/language.rs, build_graph handles a node whose blueprint declares Routing::Conditional { .. } by calling mark_command_routing only. The declared (label, target) pairs are dropped: they are never passed to add_conditional_edges and never exposed through with_command_destinations.

Consequences:

  • The routing table written in a .rag blueprint is not structurally validated at compile time; an unknown target only fails at runtime when the handler emits Command::goto.
  • graph::export (topology / Mermaid / JSON) cannot see the conditional edges, so exported diagrams of blueprint-built graphs are missing them.
  • The materialised node handler must independently resolve the same labels the blueprint already declared.

Question

This may be intentional (factory-owned routing logic), but if so the blueprint's target list is dead data. If not, build_graph should at least forward the targets via with_command_destinations so validation and export see them.

An inline comment describing the current behaviour was added in #162; this issue tracks deciding which way it should go.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority: p2Soon. Real but survivable — a rough edge, a gap, a thing that will bite later.

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions