fix: serialize ready diagnostic close and exact native prompt handling

This commit is contained in:
阿白叔 committed 2026-11-17 04:20:05 +08:00
1 parent eaff46e50e
commit fd50805380
6 files changed
+233 -16

No files matched your search

+7 -2
View File
@@ -116,7 +116,7 @@ def _read_document(path: Path) -> list[dict[str, Any]]:
return rules
def load_rules(default_path: Path, override_path: Path | None = None) -> tuple[DialogRule, ...]:
def load_rules(default_path: Path, override_path: Path | None = None, *, diagnostic_only=False) -> tuple[DialogRule, ...]:
ordered: list[str] = []
raw_by_id: dict[str, dict[str, Any]] = {}
for raw in _read_document(default_path):
@@ -137,7 +137,12 @@ def load_rules(default_path: Path, override_path: Path | None = None) -> tuple[D
else:
ordered.append(rule_id)
raw_by_id[rule_id] = dict(override)
return tuple(_parse_rule(raw_by_id[rule_id]) for rule_id in ordered)
rules = tuple(_parse_rule(raw_by_id[rule_id]) for rule_id in ordered)
if diagnostic_only:
# The process-bound diagnostic checker declines this prompt after proving the loaded project.
rules = tuple(replace(rule, category='OBSERVE_PROGRESS', action='', channels=(), target=())
if rule.rule_id == 'forward-annotation-confirm' else rule for rule in rules)
return rules
def _semantic_text(snapshot: WindowSnapshot) -> str: