添加cadfs_to_cdsl代码,优化cad生成
This commit is contained in:
@@ -96,6 +96,19 @@ class WorkspaceStore:
|
||||
def read_conversation(self, conversation_id: str) -> dict[str, Any] | None:
|
||||
return _read_json(self.conversation_path(conversation_id))
|
||||
|
||||
def clear_current_task_references(self) -> int:
|
||||
"""Detach conversations from task artifacts removed by a protocol reset."""
|
||||
cleared = 0
|
||||
for path in self.settings.conversation_root.glob("conv_*/conversation.json"):
|
||||
record = _read_json(path)
|
||||
if not isinstance(record, dict) or not record.get("current_task_id"):
|
||||
continue
|
||||
record["current_task_id"] = ""
|
||||
record["updated_at"] = now_iso()
|
||||
_write_json(path, record)
|
||||
cleared += 1
|
||||
return cleared
|
||||
|
||||
def append_conversation_message(self, conversation_id: str, message: dict[str, Any], current_task_id: str | None = None) -> dict[str, Any]:
|
||||
record = self.ensure_conversation(conversation_id, current_task_id)
|
||||
known = {str(item.get("id") or "") for item in record["messages"] if isinstance(item, dict)}
|
||||
|
||||
Reference in New Issue
Block a user