---
title: Unexpected request routing or rejection
summary: Diagnose whether an unexpected outcome came from validation, Decision Router classification, or specialist handoffs.
version: 1.0.0
type: runbooks
order: 2
badges:
  - content: Runbook
    backgroundColor: orange
    textColor: orange
---

## Trigger / Symptom & Blast Radius

A [[service|chat-api]] request is rejected, receives an English-only or out-of-scope reply, pauses with a disambiguation prompt, reaches the wrong specialist, or only partially answers a mixed request. Blast radius is limited to conversational routing quality; transactional services remain unaffected.

<Admonition type="warning">
	Prompts exceeding `2,000` characters are truncated to the first `1,900` characters before routing.
	A book UUID or primary question at the end of a long prompt may be clipped, causing misrouting.
</Admonition>

## Pre-Flight Check

Stream recent [[service|chat-api]] logs in `<ENV>` to inspect routing and guardrail decisions:

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

## Quick Recovery Procedure

<Steps>
<Step title="Match the customer reply to the gate that fired">

| Reply text                                          | Gate                | Cause                                                                       |
| :-------------------------------------------------- | :------------------ | :-------------------------------------------------------------------------- |
| `Your message appears to be empty.`                 | Input validation    | Prompt empty after trimming                                                 |
| `I can't process that request...`                   | Safety guardrail    | Matched suspicious pattern, governance safety policy, or `P(is_safe) < 0.5` |
| `BookWorm Chat currently supports English only...`  | Language guardrail  | `P(is_english) < 0.5`                                                       |
| `I can only help with BookWorm bookstore topics...` | Scope guardrail     | `P(is_in_scope) < 0.5`                                                      |
| `Which area best fits your request?`                | Disambiguation port | Route confidence below `0.6`                                                |

</Step>
<Step title="Inspect Decision Router logs">

Filter [[service|chat-api]] logs around the request timestamp for `Decision router` entries (`P(is_safe)`, `P(is_english)`, `P(is_in_scope)`, and selected target `Book`, `QA`, or `Rating` with confidence score). Compare against expected routing:

**[[agent|book-agent]]:** Book search, recommendations, catalog details, or review questions without a book ID.

**[[agent|qa-agent]]:** Store policies, shipping, returns, accounts, orders, or billing.

**[[agent|rating-agent]]:** Review summaries or rating analysis when a book catalog ID is already present.

</Step>
<Step title="Check disambiguation resume and mixed-intent handoffs">

If paused for disambiguation, confirm the follow-up turn sent a tool result or recognized plain-text choice (`1`/`book`, `2`/`qa`/`policy`, `3`/`rating`/`review`). For mixed requests, confirm the trace shows `handoff_to_book`, `handoff_to_qa`, or `handoff_to_rating`.

</Step>
</Steps>

## Verification

Replay a sanitized equivalent prompt and confirm the trace logs the expected specialist selection (`confidence >= 0.6`) and handoff completion:

```text
Decision router selected <Book|QA|Rating> (confidence >= 0.600)
```

## Rollback / Escalation

- **Rollback:** If a recent `Microsoft-Decision-1` configuration or prompt-policy update caused false rejections, revert the policy/revision in `<RESOURCE_GROUP>`.
- **Escalation:** Log false-positive regex/guardrail rejections (without raw PII) and escalate to [[team|ai-capabilities-team]].

## Related documentation

- [[flow|agent-orchestration]] — Routing thresholds and handoff rules.
- [[adr|adr-007-system-one-decision-model-routing-and-tool-selection]] — Decision model routing architecture.
