Skip to main content
Back to how-to guides Use this when support, QA, or partners must learn why a customer reached one specialist, or why a route did not fire.

Concept

A supervisor routes in layers. Each layer leaves its own trace events. A quoted plain-language WHEN matches only in the model choice layer, when the model picks that route. The pre-model layer skips it. The authored-order check shows whenOutcome: semantic_deferred and result: false. That result does not mean the route is broken. Routing events do not need a higher trace level. The runtime sets the level when it creates a session. Studio debug sessions use verbose. All other sessions use standard. If an event is missing, check the layer first.

Minimal working example

This supervisor sets two trace dimensions at session start and routes three ways. The specialists are short stand-ins for your real agents.

Read a routing decision

Start with the events for one turn. Match each need to an event. A model-selected check looks like this. Fields are trimmed.
evaluatedContext holds only the variables the condition names, plus intent when it is set. It does not hold the whole session.

The whenOutcome values

The reasonCode is handoff_condition_matched or handoff_condition_blocked for a model-selected route. For the authored-order check it is handoff_condition_matched, handoff_condition_skipped, or flow_return_handoff_suppressed. handoff_context_pass_resolved is narrow. It fires only when a PASS field named request, user_request, customer_request, query, message, utterance, or latest_user_utterance takes the customer’s current message. It does not list other passed fields. Read the handoff event context for those.

Common variations

Debug a route that is hidden by ENABLED_WHEN

A route with ENABLED_WHEN can be missing from the model’s choices. Three events explain it. The events carry the condition text and the missing paths. They never carry values.

Debug a plain-language condition

The fallback route above shows whenOutcome: semantic_deferred in the authored-order check. It matches only when the model calls handoff_to_Fallback_Triage_Agent. To see why the model did not choose it, read the route SUMMARY and WHEN text. Then read the other route calls in the same turn.

Debug a router that asked a question

A router supervisor asks through the clarification action. The trace shows a tool_call named __clarify_routing__ and no handoff.

Debug multiple requests in one message

Multi-intent plan events arrive as decision events. Read the type field inside data. When multi-intent handling is on, routes that read intent.category can defer to the model. The decision event then shows decision: deterministic_intent_routing_deferred_to_reasoning or decision: deterministic_intent_handoff_deferred_to_reasoning.

Add _meta trace dimensions

SET _meta.<name> writes a custom trace dimension. It is for filtering and grouping in analytics. It does not affect routing. You can set it in ON_START, flow steps, lifecycle hooks, and ON_ERROR and ESCALATE triggers. A rejected value does not stop the session. The SET has no effect and the runtime logs a warning. A successful write emits session_updated with target: custom_dimension. Use stable, low-cardinality values. Do not write the customer’s words.

Verification

  1. Validate the supervisor and all target agents together.
  2. Send “I was charged twice”. Expect a tool_call for handoff_to_Billing_Agent, then handoff_condition_check with result: true and whenOutcome: deterministic_pass.
  3. Check the handoff event. Expect returnExpected: false and reasonCode: handoff_permanent.
  4. Send “My router keeps dropping the connection”. Expect Technical_Support_Agent.
  5. Send “Tell me about your company”. Expect the fallback route if the model picks it. The authored-order check shows semantic_deferred for that route.
  6. Check that the session record carries entry_channel and routing_version as trace dimensions.

Production readiness checklist

  • Every route has a distinct SUMMARY and condition.
  • Test sessions cover a match, a non-match, a missing variable, and a fallback.
  • Each deterministic condition reads a variable with a known source.
  • The team knows which layer owns each route: before the model, model choice, or authored-order check.
  • _meta values are stable and low in cardinality, and they never hold customer text.
  • Support staff can read handoff_condition_check, route_condition_unresolved, and handoff in your trace viewer.

Common mistakes

Troubleshooting