fix: preserve native model switches and bound project searches
This commit is contained in:
1 parent
db5e876f40
commit
e7d3080e0a
14 files changed
+371
-35
No files matched your search
@@ -54,6 +54,22 @@ def foreign(req):
|
||||
return False
|
||||
|
||||
|
||||
def native_opaque(req):
|
||||
"""Native encrypted state belongs to the subscription, even in mixed history."""
|
||||
return any(isinstance(item, dict) and item.get("type") == "compaction" and item.get("encrypted_content")
|
||||
and not str(item["encrypted_content"]).startswith(ozet_kopru.ISARET)
|
||||
for item in req.get("input") or [])
|
||||
|
||||
|
||||
def foreign_history(req):
|
||||
"""Semantic migration evidence, excluding tool ID format mismatches."""
|
||||
return any(isinstance(item, dict) and (
|
||||
"chatcmpl-" in str(item.get("id") or "")
|
||||
or "astrabridge" in str(item.get("id") or "")
|
||||
or str(item.get("encrypted_content") or "").startswith(ozet_kopru.ISARET))
|
||||
for item in req.get("input") or [])
|
||||
|
||||
|
||||
def normalize(req):
|
||||
"""Repair local wrappers/IDs, retaining real OpenAI encrypted compaction.
|
||||
|
||||
@@ -82,6 +98,10 @@ def normalize(req):
|
||||
if any(visible):
|
||||
result.append(ozet_kopru._ozet_mesaji("\n".join(visible)))
|
||||
continue
|
||||
if ("chatcmpl-" in str(identity) or "astrabridge" in str(identity)) and (
|
||||
item.get("type") == "message" or item.get("role")):
|
||||
# Inline message content is portable; its foreign server ID is not.
|
||||
item.pop("id", None)
|
||||
prefix = PREFIXES.get(item.get("type"))
|
||||
if prefix and isinstance(identity, str) and identity and not identity.startswith(prefix + "_"):
|
||||
item["id"] = prefix + "_" + identity.split("_", 1)[-1]
|
||||
|
||||
Reference in new issue
Block a user