feat(skill): improve multi-turn fast-slow routing

This commit is contained in:
wuyang6
2026-07-24 17:12:25 +08:00
parent a505261bde
commit e2bf012f60
15 changed files with 195 additions and 14 deletions
@@ -61,6 +61,16 @@ REQUIRED_FIELDS = {
OPTIONAL_FIELDS = {
"id",
"counterevidence",
"context_relation",
}
CONTEXT_RELATION_VALUES = {
"independent",
"resolved_direct",
"operation_continuation",
"constraint_extension",
"planning_continuation",
"clarification_completion",
"unresolved_reference",
}
@@ -285,6 +295,24 @@ def validate_record(record: Any, index: int) -> dict[str, Any]:
if not isinstance(record.get("context_used"), bool):
errors.append("context_used 必须是布尔值")
context_relation = record.get("context_relation")
if context_relation is not None and (
not isinstance(context_relation, str)
or context_relation not in CONTEXT_RELATION_VALUES
):
errors.append("context_relation 不是受支持的上下文关系")
if context_relation == "independent" and record.get("context_used") is True:
errors.append("context_relation=independent 时 context_used 必须为 false")
if context_relation not in {None, "independent"}:
if record.get("context_used") is not True:
errors.append("依赖上下文的 context_relation 要求 context_used=true")
if isinstance(structural_signals, dict) and (
structural_signals.get("context_dependent") is not True
):
errors.append(
"依赖上下文的 context_relation 要求 "
"structural_signals.context_dependent=true"
)
fast_system_pending = record.get("fast_system_pending")
if fast_system_pending is not None and not isinstance(fast_system_pending, bool):