fix CC: use real UUID for threadId
This commit is contained in:
@@ -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(),
|
||||
|
||||
Reference in New Issue
Block a user