fix error default_topic

This commit is contained in:
2025-11-28 11:38:15 +08:00
parent f9992d8437
commit 1b69632c7b

View File

@@ -1098,6 +1098,23 @@ std::string CerebellumNode::ResolveTopicForSkill(const std::string & skill) cons
return c.topic;
}
}
if (skill_manager_) {
const auto & skills = skill_manager_->skills();
auto it = skills.find(skill);
if (it != skills.end()) {
const auto & spec = it->second;
for (const auto & iface : spec.interfaces) {
if (iface.find(".action") != std::string::npos) {
auto topic_it = spec.interface_default_topics.find(iface);
if (topic_it != spec.interface_default_topics.end()) {
return topic_it->second;
}
}
}
}
}
const std::string snake = ToSnake(skill);
if (action_clients_->has_client(snake)) {return snake;}
if (action_clients_->has_client(skill)) {return skill;}