fix CC: use real UUID for threadId

This commit is contained in:
admin
2026-05-19 18:41:22 +04:00
Unverified
parent 573b640f91
commit df4f852566
2 changed files with 5 additions and 3 deletions

View File

@@ -744,9 +744,11 @@ class Handler(http.server.BaseHTTPRequestHandler):
cc_msgs.append({"role": "tool", "tool_call_id": m["tool_call_id"],
"content": [{"type": "text", "text": m.get("content", "")}]})
thread_id = body.get("request_id") or body.get("id") or uid("thread")
if len(thread_id) < 32:
thread_id = uid("thread")
thread_id = body.get("request_id") or body.get("id") or ""
try:
uuid.UUID(thread_id)
except (ValueError, AttributeError):
thread_id = str(uuid.uuid4())
cc_body = {
"config": _cc_config(),