重命名分离模块 problem_descriptionadvice 并同步更新相关校验逻辑与测试
Project CI / Repository checks (pull_request) Failing after 13s
Project CI / Backend tests (pull_request) Failing after 9s
Project CI / Frontend tests (pull_request) Successful in 2m28s
Project CI / Native shell tests (pull_request) Failing after 14m32s

This commit is contained in:
2026-09-10 18:54:10 +08:00
parent 4bbc77fc32
commit c5c7339c4a
3 changed files with 6 additions and 6 deletions
@@ -230,7 +230,7 @@ mod tests {
0,
&[BindingDecision::NeedRework {
to_node: id.clone(),
problem_description: note.to_string(),
advice: note.to_string(),
}],
&paths,
)
@@ -276,7 +276,7 @@ mod tests {
};
let decision = BindingDecision::NeedRework {
to_node: node.id.clone(),
problem_description: "x".repeat(MAX_REWORK_NOTE_CHARS + 1),
advice: "x".repeat(MAX_REWORK_NOTE_CHARS + 1),
};
assert!(validate_binding_response(
&BindingResp {
@@ -39,7 +39,7 @@ pub enum BindingDecision {
to_node: NodeId,
},
NeedRework {
problem_description: String,
advice: String,
to_node: NodeId,
},
}
@@ -252,14 +252,14 @@ pub fn validate_binding_response(
return Err(format!("视觉绑定重复返回节点:{}", node_id.as_str()));
}
if let BindingDecision::NeedRework {
problem_description,
advice,
..
} = decision
{
if problem_description.trim().is_empty() {
if advice.trim().is_empty() {
return Err("NeedRework 必须包含问题描述".to_string());
}
if problem_description.chars().count() > MAX_REWORK_NOTE_CHARS {
if advice.chars().count() > MAX_REWORK_NOTE_CHARS {
return Err(format!(
"NeedRework 问题描述不能超过 {MAX_REWORK_NOTE_CHARS} 个字符"
));