cd471c4c95
When X-Agent-Name or X-Agent-Id is present and matches an agent_models
entry, Festinger routes the main inference request to the configured
provider — not just the memory-writing utility model.
Protocol translation:
- Incoming OpenAI → outgoing Claude: system-message extraction,
max_tokens defaulting, response translated back to OpenAI format
- Incoming OpenAI → outgoing LM Studio/OpenAI: model + base_url swap
- All responses returned as OpenAI-compatible JSON or SSE
Also adds streaming synthesis for /v1/chat/completions (OpenAI SSE)
and X-Agent-Id fallback in _agent_name_from_headers so numeric
AGENT_ID env vars work without needing AGENT_NAME.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>