fix: commit uncommitted native JSON type changes on master
These changes (HashMap<String, String> → HashMap<String, Value> for front matter, json_value_to_yaml_scalar, and oneOf schema for front_matter) were left uncommitted on master after a previous merge, blocking the cherry-pick step of story 509's merge. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -353,17 +353,15 @@ pub(super) fn tool_update_story(args: &Value, ctx: &AppContext) -> Result<String
|
||||
let description = args.get("description").and_then(|v| v.as_str());
|
||||
|
||||
// Collect front matter fields: explicit `agent` param + arbitrary `front_matter` object.
|
||||
let mut front_matter: HashMap<String, String> = HashMap::new();
|
||||
// Values are passed as serde_json::Value so native booleans, numbers, and arrays are
|
||||
// preserved and encoded correctly as unquoted YAML by update_story_in_file.
|
||||
let mut front_matter: HashMap<String, Value> = HashMap::new();
|
||||
if let Some(agent) = args.get("agent").and_then(|v| v.as_str()) {
|
||||
front_matter.insert("agent".to_string(), agent.to_string());
|
||||
front_matter.insert("agent".to_string(), Value::String(agent.to_string()));
|
||||
}
|
||||
if let Some(obj) = args.get("front_matter").and_then(|v| v.as_object()) {
|
||||
for (k, v) in obj {
|
||||
let val = match v {
|
||||
Value::String(s) => s.clone(),
|
||||
other => other.to_string(),
|
||||
};
|
||||
front_matter.insert(k.clone(), val);
|
||||
front_matter.insert(k.clone(), v.clone());
|
||||
}
|
||||
}
|
||||
let front_matter_opt = if front_matter.is_empty() {
|
||||
|
||||
Reference in New Issue
Block a user