v3.9.5: sync

This commit is contained in:
2026-05-24 20:13:35 +00:00
Unverified
parent 6eaa2d900d
commit 7d589b3ba5

View File

@@ -4346,9 +4346,12 @@ class Handler(http.server.BaseHTTPRequestHandler):
except Exception:
args = {}
fc_part = {"functionCall": {"name": fname, "args": args, "id": call_id}}
stored_sig = _gemini_get_sig(f"fc:{call_id}")
stored_sig = _gemini_get_sig(f"fc:{call_id}") or _gemini_get_sig(f"fc:{fname}")
if stored_sig:
fc_part["thoughtSignature"] = stored_sig
fc_part["thought_signature"] = stored_sig
else:
fc_part["thought_signature"] = "skip_thought_signature_validator"
contents.append({"role": "model", "parts": [fc_part]})
elif t == "function_call_output":
call_id = item.get("call_id", item.get("id", ""))
@@ -4451,9 +4454,11 @@ class Handler(http.server.BaseHTTPRequestHandler):
break
if latest_user:
serialized = json.dumps(contents, ensure_ascii=False)
needle = latest_user.strip()[:120]
if needle and needle not in serialized:
print(f"[antigravity] WARNING: latest user instruction missing from contents! needle={needle[:60]}...", file=sys.stderr)
needle = latest_user.strip().replace("\n", " ")[:120]
escaped_serialized = serialized.replace("\\n", " ")
if needle and needle not in escaped_serialized:
print(f"[antigravity] latest user instruction missing from contents, appending", file=sys.stderr)
contents.append({"role": "user", "parts": [{"text": latest_user}]})
request_body = {"contents": contents}
if system_parts:
@@ -4597,10 +4602,16 @@ class Handler(http.server.BaseHTTPRequestHandler):
if sig:
if part.get("functionCall"):
fc_id = part["functionCall"].get("id") or part["functionCall"].get("name")
fc_name = part["functionCall"].get("name")
if fc_id:
_gemini_store_sig(f"fc:{fc_id}", sig)
if fc_name:
_gemini_store_sig(f"fc:{fc_name}", sig)
_gemini_store_sig(f"turn:{resp_id}", sig)
if part.get("thought"):
sig_from_thought = _extract_gemini_sig(part)
if sig_from_thought:
_gemini_store_sig(f"turn:{resp_id}", sig_from_thought)
continue
if "text" in part and not part.get("functionCall"):
text_delta = part["text"]