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

Binary file not shown.

View File

@@ -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(),