Update src/agentcore/orchestrator.py
Browse files
src/agentcore/orchestrator.py
CHANGED
|
@@ -294,6 +294,12 @@ def _log_agent_query(question: str, response: AgentResponse, start_time: float)
|
|
| 294 |
settings = get_settings()
|
| 295 |
worker_url = getattr(settings, "cloudflare_worker_url", "") or ""
|
| 296 |
if worker_url:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 297 |
_payload = {
|
| 298 |
"question": _redact_for_analytics(question),
|
| 299 |
"tool": f"{intent}:{tool}"[:80],
|
|
@@ -1040,6 +1046,4 @@ async def _agent_query_inner(
|
|
| 1040 |
response_time=time.time() - start_time,
|
| 1041 |
follow_up_question=follow_up_question,
|
| 1042 |
follow_up_suggestions=follow_up_suggestions,
|
| 1043 |
-
)
|
| 1044 |
-
|
| 1045 |
-
|
|
|
|
| 294 |
settings = get_settings()
|
| 295 |
worker_url = getattr(settings, "cloudflare_worker_url", "") or ""
|
| 296 |
if worker_url:
|
| 297 |
+
if getattr(settings, "analytics_client_side", False):
|
| 298 |
+
# The browser posts this record to the Worker directly; skipping
|
| 299 |
+
# here avoids duplicate rows.
|
| 300 |
+
_record_attempt("client_side", "logged by browser")
|
| 301 |
+
return
|
| 302 |
+
|
| 303 |
_payload = {
|
| 304 |
"question": _redact_for_analytics(question),
|
| 305 |
"tool": f"{intent}:{tool}"[:80],
|
|
|
|
| 1046 |
response_time=time.time() - start_time,
|
| 1047 |
follow_up_question=follow_up_question,
|
| 1048 |
follow_up_suggestions=follow_up_suggestions,
|
| 1049 |
+
)
|
|
|
|
|
|