Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Fix mixed-source chat excerpt truncation, default system prompt suppression, bracketed citations, and Semantic Ranker quota fallback

Abierto
#1,855 0 comentarios 0 reacciones 1 asignado Ver en GitHub

Los mantenedores suelen responder en 1 día

@paullizer ya está trabajando en esto.

Desde el 29/10/2026.

Evaluación

Este issue todavía no se ha evaluado.

Descripción

bug P1

Issue

When Enhanced Citations is enabled (which derives enable_mixed_source_chat_search = True and persists it in Cosmos DB app_settings), chat retrieval, narrative/XML chunk fidelity, default system-prompt injection, and inline citation rendering experience several regressions across paullizer-react-v2-ui, main, and earlier branches sharing the same backend services:

  1. default_system_prompt Suppressed: route_backend_chats.py checked whether any role == "system" message did not contain "retrieved document excerpts", causing mixed_source_handoff, chat-uploaded file/image messages, and other system augmentation messages to suppress settings['default_system_prompt'] (e.g., PLASO's persona and instructions).
  2. Narrative & XML Search Excerpt Truncation (4,000 chars -> 1,024 / 512 bytes): route_backend_chats.py skipped build_search_augmentation_system_prompt(retrieved_content) whenever is_mixed_source_chat_search_enabled(settings) was True, leaving the model with only the JSON evidence_envelopes preview (where _make_json_safe and _bound_json_value truncated every chunk string to 1,024 / 512 bytes and omitted document metadata and (Source: ..., Page: ...) [#citation_id] strings).
  3. Empty Content for Direct Chat File Uploads When Content Screening Is Off: Workspace-backed chat uploads (file_content_source: "workspace") store no inline file_content on the Cosmos message item, and _refresh_workspace_linked_history_message returned early when SCREENING_FIELD was absent, leaving file_content empty in build_conversation_history_segments.
  4. Bracketed Chunk IDs ([8ed56431_1]) Rendered as Raw Text: When models copied raw or 8-hex-prefix chunk IDs ([8ed56431_1], [15dce0d4_2; 8ed56431_2]) from JSON envelopes without a (Source: ...) prefix, citations.ts, chat-citations.js, and functions_citation_tracking.py did not resolve them against hybrid_citations.
  5. Hard Failure on Azure AI Search Semantic Ranker Free Quota Exhaustion: hybrid_search hardcoded query_type="semantic" without falling back to query_type="simple" (vector + BM25 keyword search) after recording the service health warning.

Steps to Reproduce

  1. Enable Enhanced Citations in Admin Settings and configure a default_system_prompt (e.g., PLASO instructions).
  2. Index or upload an .xml (or other narrative) document in chat and ask a question requiring full chunk details and inline citations.
  3. Observe that default_system_prompt is omitted when mixed_source_handoff or a chat file upload is present, narrative/XML chunks are truncated in the JSON envelope, and citations appear as bracketed IDs such as [8ed56431_1] or [15dce0d4_2; 8ed56431_2].
  4. Exceed the monthly free Semantic Ranker query quota on Azure AI Search and observe hybrid_search failing instead of falling back to vector + keyword search.

Expected Behavior

  • default_system_prompt is always preserved at the start of the prompt regardless of Enhanced Citations or augmentation/upload system messages.
  • Full narrative/XML search excerpts, metadata citations, and (Source: ..., Page: ...) [#citation_id] markers are included in chat augmentation, and workspace-backed chat uploads hydrate their indexed chunk text when Content Screening is off.
  • Bracketed chunk IDs ([8ed56431_1], [15dce0d4_2; 8ed56431_2]) resolve to inline citation chips/links and cited-source tracking.
  • When Semantic Ranker quota is exhausted, hybrid_search records the service-health warning and automatically falls back to query_type="simple" vector + keyword search.

Actual Behavior

  • default_system_prompt was skipped when mixed_source_handoff or file/image system messages existed.
  • build_search_augmentation_system_prompt was skipped in mixed-source chat mode, leaving only 1,024/512-byte JSON envelope previews.
  • Workspace-backed chat file uploads had empty file_content in history when Content Screening was off.
  • Bracketed chunk IDs rendered as raw text instead of clickable citations.
  • Semantic Ranker quota exhaustion caused hybrid_search to fail with SemanticSearchQuotaExceededError (HTTP 503 / empty context).

Impact

Affects RAG retrieval accuracy, XML and narrative document fidelity, persona/system-prompt determinism, and inline citation rendering across chat sessions.

Notes

Fixed in v0.261.392 (route_backend_chats.py, functions_mixed_source_orchestration.py, functions_search.py, functions_citation_tracking.py, citations.ts, chat-citations.js).

Lenguaje dominante
Python
Estrellas
157
Forks
117
Merge medio
3 h 6 min
PR fusionados (30 d)
219

Preparar el entorno

Abrir en Codespaces

Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de microsoft/simplechat

Todos los issues de microsoft/simplechat

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.