Skip to content

fix: sprint 22 bug fixes (#363, #506, #508, #510) and translation GPU fixes

David FORDEN requested to merge sprint-22-bug-fixes into main

Summary

Bug fixes for Sprint 22 plus translation GPU infrastructure improvements.

Bug Fixes

  • #363 (closed): GPU-to-CPU fallback no longer permanently mutates this.backend / this.backendType. Per-request CPU fallback uses a local cpuBackend variable instead.
  • #506 (closed): Added timeout=aiohttp.ClientTimeout(total=30) to all 7 aiohttp.ClientSession() calls in genieai_chatqna.py (3) and genieai_dataprep_arangodb.py (4).
  • #508 (closed): Replaced hardcoded placeholder URL https://<HOST>/<PORT> with BACKEND_SERVICE_URL env var in genieai_chatqna.py.
  • #510 (closed): Downgraded sensitive logs from logger.info to logger.debug in genieai_chatqna.py (3 occurrences) and genieai_dataprep_arangodb.py (2 occurrences).

Additional Fixes

  • Downgraded UserProvisioning PII log (name, email, realm_access, resource_access) from logger.info to logger.debug.
  • Added VLLM_TRANSLATION_MODEL_ID to backend service environment in docker-compose.yaml. Previously the backend hardcoded google/gemma-3-4b-it as default, ignoring the env var. Now it matches the model loaded in vllm-translation-guardrail.
  • GPU backend (gpu-translate-backend.js): Added fetchModelInfo() to query /v1/models at init and discover the model's max_model_len. formatRequest() now calculates max_tokens = max_model_len - 128 instead of hardcoded 4096, preventing 400 errors on models with smaller context windows (e.g. gemma-3-1b-it with 1024 tokens).

Infrastructure

  • Added LOG_LEVEL env var support:
    • Backend shared-lib logger (components/shared/lib/logger.js) reads LOG_LEVEL from env (default: info)
    • Document-repository (components/document-repository/src/config/appConfig.js) also reads LOG_LEVEL from env (default: info)
    • Added LOG_LEVEL to both backend and document-repository service environments in docker-compose.yaml
    • Added to Ansible env.j2 template (Section 7: Backend Service Configuration)
    • Documented log_level in deploy/ansible/README.md (covers both backend and document-repository)
    • Documented in env template

Files Changed

File Change
components/gov-chat-backend/services/translation-service.js #363 (closed): Local CPU fallback variable
components/gov-chat-backend/services/translation/gpu-translate-backend.js fetchModelInfo + dynamic max_tokens
components/gov-chat-backend/services/user-provisioning-service.js PII log downgraded to debug
components/shared/lib/logger.js LOG_LEVEL env var support
docker-compose.yaml VLLM_TRANSLATION_MODEL_ID + LOG_LEVEL for backend and document-repository
env LOG_LEVEL documentation
genie-ai-overlay/chatqna/genieai_chatqna.py #506 (closed) timeouts, #508 (closed) URL fix, #510 (closed) log downgrade
genie-ai-overlay/dataprep/genieai_dataprep_arangodb.py #506 (closed) timeouts, #510 (closed) log downgrade
deploy/ansible/templates/env.j2 LOG_LEVEL in Section 7
deploy/ansible/README.md log_level variable documentation

Ansible Deployment

No new env vars were added that aren't already in the Ansible env.j2 template:

  • VLLM_TRANSLATION_MODEL_ID — already in env.j2 line 143 (Section 10: Translation Model)
  • LOG_LEVEL — added to env.j2 Section 7 (Backend Service Configuration) and documented in README

Both backend and document-repository consume LOG_LEVEL from the generated .env file.

Test plan

  • GPU translation works without falling back to CPU (model ID matches, max_tokens within context limit)
  • OPEA services start without hanging (aiohttp timeouts)
  • No PII or sensitive data in INFO-level logs
  • File read URL correct in RAG chat with file context (#508 (closed) — needs RAG pipeline running)
  • Verify LOG_LEVEL=debug produces debug output in backend logs
  • Verify LOG_LEVEL=debug produces debug output in document-repository logs
Edited by david-full

Merge request reports

Loading