Ajustes conforme relatorio de testes 2026-08-27

This commit is contained in:
2026-08-29 09:53:32 -03:00
parent 0ecff719b7
commit 88e1f070d7
791 changed files with 27040 additions and 29038 deletions

View File

@@ -33,6 +33,7 @@ from agent_framework.billing.usage_repository import create_usage_repository
from agent_framework.sse.events import SSEHub
from app.workflows.agent_graph import AgentWorkflow
from app.observability.telemetry_observer import TelemetryBackedAgentObserver
from app.domain.contas.line_reference import extract_requested_line_reference
logging.basicConfig(level=settings.LOG_LEVEL)
logger = logging.getLogger("agent_template_backend")
@@ -184,6 +185,11 @@ async def _process_gateway_message(req: GatewayRequest, emit_sse: bool = False)
raise HTTPException(status_code=422, detail=str(exc)) from exc
payload = req.payload or {}
identity, normalized_context, business_context, missing_identity_keys = _resolve_identity(req, msg)
requested_line_reference = extract_requested_line_reference(msg.text)
if requested_line_reference:
# Referência conversacional apenas. A política de domínio decide se ela
# pode ou não virar linha efetiva; nunca substitui a identidade aqui.
normalized_context["requested_line_reference"] = requested_line_reference
agent_session_id = identity.conversation_key()
message_id = payload.get("message_id") or str(uuid4())
workflow_id = _extract_workflow_id(payload)