---
title: Chat request does not return a usable response
summary: Triage an interactive request that fails to return a useful assistant response.
version: 1.0.0
type: runbooks
order: 1
badges:
  - content: Runbook
    backgroundColor: orange
    textColor: orange
---

## Trigger / Symptom & Blast Radius

A customer sends a chat message through Storefront and receives an HTTP error (`401`, `403`, `429`, `5xx`), a stalled stream, an empty reply, or the generic rephrase fallback. Blast radius is isolated to interactive [[service|chat-api]] conversations; catalog browsing, basket, and checkout remain unaffected.

<Admonition type="danger">
	Never include raw customer prompts, names, email addresses, or personal data in incident tickets
	or logs. Record only the request category, stage outcomes, and correlation IDs.
</Admonition>

## Pre-Flight Check

Verify [[service|chat-api]] container status and stream recent logs in `<ENV>`:

```bash
az containerapp show --name <SERVICE_NAME> --resource-group <RESOURCE_GROUP> --query "properties.runningStatus" -o tsv
az containerapp logs show --name <SERVICE_NAME> --resource-group <RESOURCE_GROUP> --tail 200
```

## Quick Recovery Procedure

<Steps>
<Step title="Check ingress status and endpoint">

Confirm the request targeted `/chatting/ag-ui` (forwarded to `/ag-ui` on [[service|chat-api]]). Interpret HTTP status codes:

**`401` / `403`:** Missing/invalid Entra ID token or missing `customer` role / `chatting_read` + `chatting_write` scopes.

**`429`:** Per-user rate limit exceeded; honor `Retry-After`.

**`5xx` or `200` with fallback text:** Continue to dependency and trace checks.

</Step>
<Step title="Trace workflow stages in OpenTelemetry">

Inspect the trace in Aspire Dashboard (local) or Azure Log Analytics (`<ENV>`):

**Input validation:** Confirm whether the turn was accepted or rejected as empty/unsafe.

**Decision router:** Confirm `Microsoft-Decision-1` selected [[agent|book-agent]], [[agent|qa-agent]], or [[agent|rating-agent]].

**Specialist & formatter:** Confirm the selected specialist produced text or a client UI tool call (an empty text string with a tool call is expected for Storefront cards).

</Step>
<Step title="Check downstream dependencies">

Look for failed spans or timeouts across:

**Microsoft Foundry:** Model errors, throttling, or `CognitiveServicesUser` RBAC failures.

**[[service|presidio-api]]:** PII analyzer/anonymizer failures.

**[[service|mcp-server]]:** Catalog tool errors during [[agent|book-agent]] execution.

**[[service|rating-api]]:** A2A gRPC timeouts (2-minute client timeout) or Entra Agent Identity token exchange errors.

</Step>
<Step title="Verify session storage if history was lost">

[[service|chat-api]] persists conversation transcripts in [[container|chat-session-blob]]. Confirm the Storage Account (or local Azurite) is reachable and the [[service|chat-api]] Managed Identity holds `Storage Blob Data Contributor`.

</Step>
</Steps>

## Verification

Replay an equivalent sanitized request against `/chatting/ag-ui` and confirm HTTP `200` with a non-fallback assistant response or expected UI tool call in the trace:

```bash
az containerapp logs show --name <SERVICE_NAME> --resource-group <RESOURCE_GROUP> --tail 50
```

Expected trace progression:

```text
1. /ag-ui returns 200 with an event stream
2. Input validation -> accepted
3. Decision router -> selected specialist (<Book|QA|Rating>)
4. Specialist -> assistant text or client UI tool call
```

## Rollback / Escalation

- **Rollback:** If a recent [[service|chat-api]] deployment introduced regressions in prompts, routing, or middleware, roll back to the previous Container App revision in `<RESOURCE_GROUP>`.
- **Escalation:** Escalate repeated fallbacks or dependency faults to [[team|ai-capabilities-team]] (code/prompts) or [[team|platform-engineering-team]] (Foundry/RBAC/Storage).

## Related documentation

- [[flow|agent-orchestration]] — End-to-end conversational workflow.
- [[adr|adr-002-fail-closed-pii-middleware]] — Fail-closed PII filtering behavior.
