fix CC: use real UUID for threadId
This commit is contained in:
Binary file not shown.
@@ -744,9 +744,11 @@ class Handler(http.server.BaseHTTPRequestHandler):
|
|||||||
cc_msgs.append({"role": "tool", "tool_call_id": m["tool_call_id"],
|
cc_msgs.append({"role": "tool", "tool_call_id": m["tool_call_id"],
|
||||||
"content": [{"type": "text", "text": m.get("content", "")}]})
|
"content": [{"type": "text", "text": m.get("content", "")}]})
|
||||||
|
|
||||||
thread_id = body.get("request_id") or body.get("id") or uid("thread")
|
thread_id = body.get("request_id") or body.get("id") or ""
|
||||||
if len(thread_id) < 32:
|
try:
|
||||||
thread_id = uid("thread")
|
uuid.UUID(thread_id)
|
||||||
|
except (ValueError, AttributeError):
|
||||||
|
thread_id = str(uuid.uuid4())
|
||||||
|
|
||||||
cc_body = {
|
cc_body = {
|
||||||
"config": _cc_config(),
|
"config": _cc_config(),
|
||||||
|
|||||||
Reference in New Issue
Block a user