fix: added on_other field for approval nodes so users can specify an alternative free-text target when none of the options match what they want

This commit is contained in:
2026-05-14 16:35:08 -06:00
parent 48c52b5829
commit 3f4fd91b3f
4 changed files with 58 additions and 21 deletions
+9
View File
@@ -174,6 +174,13 @@ pub struct ApprovalNode {
pub routes: HashMap<String, String>,
/// REQUIRED. The user_ask tool always permits a free-form "type your
/// own answer" response in addition to the listed `options`. When the
/// user supplies any answer that does NOT match a key in `routes`,
/// execution routes to this node. The free-form text is available to
/// downstream nodes via `state_updates` (e.g. `clarification: "{{choice}}"`).
pub on_other: String,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub state_updates: Option<HashMap<String, String>>,
@@ -427,6 +434,7 @@ nodes:
routes:
yes: i
no: e
on_other: e
i:
id: i
type: input
@@ -559,6 +567,7 @@ routes:
approve: apply
reject: end_reject
edit: edit_loop
on_other: edit_loop
"#;
let node: Node = serde_yaml::from_str(yaml).unwrap();
let approval = match node.node_type {