fix: harden conversational mode draft revisions
This commit is contained in:
@@ -983,6 +983,22 @@ class CodexAssistantService:
|
||||
if draft.get("existing_mode_id")
|
||||
else "确认后可保存为功能模式。"
|
||||
)
|
||||
requested_operation_count = draft.get("requested_operation_count")
|
||||
changed_operation_count = draft.get("changed_operation_count")
|
||||
no_effective_change = (
|
||||
isinstance(requested_operation_count, int)
|
||||
and not isinstance(requested_operation_count, bool)
|
||||
and requested_operation_count > 0
|
||||
and isinstance(changed_operation_count, int)
|
||||
and not isinstance(changed_operation_count, bool)
|
||||
and changed_operation_count == 0
|
||||
)
|
||||
if no_effective_change:
|
||||
return (
|
||||
f"待保存的“{name}”模式中,该项原本已是目标状态,"
|
||||
f"已保持不变并重新校验全部{operation_count}项组合动作。"
|
||||
f"原草稿未被保存或执行,可以继续调整;{persistence_hint}"
|
||||
)
|
||||
return (
|
||||
f"已调整待保存的“{name}”模式,并重新校验全部"
|
||||
f"{operation_count}项组合动作。原草稿未被保存或执行,"
|
||||
@@ -1839,6 +1855,8 @@ class CodexAssistantService:
|
||||
"generation_source",
|
||||
"draft_revision",
|
||||
"revises_source_request_id",
|
||||
"requested_operation_count",
|
||||
"changed_operation_count",
|
||||
)
|
||||
if key in mode_profile_draft
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user