feat(runtime): sync experience bus and learner stack into main

This commit is contained in:
Apple
2026-03-05 11:30:17 -08:00
parent edd0427c61
commit ef6ebe3583
22 changed files with 2837 additions and 22 deletions

View File

@@ -75,6 +75,10 @@ async def send_to_router(body: Dict[str, Any]) -> Dict[str, Any]:
system_prompt = body.get("system_prompt") or context.get("system_prompt")
system_prompt = _apply_agent_style_guardrails(agent_id, system_prompt)
system_prompt = _apply_runtime_communication_guardrails(system_prompt, metadata)
request_id = str(metadata.get("request_id") or metadata.get("trace_id") or "").strip()
if request_id:
metadata["request_id"] = request_id
metadata["trace_id"] = request_id
if system_prompt:
logger.info(f"Using system prompt ({len(system_prompt)} chars) for agent {agent_id}")
@@ -124,7 +128,8 @@ async def send_to_router(body: Dict[str, Any]) -> Dict[str, Any]:
try:
async with httpx.AsyncClient(timeout=ROUTER_TIMEOUT) as client:
response = await client.post(infer_url, json=infer_body)
headers = {"X-Request-Id": request_id} if request_id else None
response = await client.post(infer_url, json=infer_body, headers=headers)
response.raise_for_status()
result = response.json()