Skip to content

Fix Azure Government Speech routing and transcription failure reporting - #1947

Merged
Paul Lizer (paullizer) merged 1 commit into
Developmentfrom
paullizer-government-speech-development
Nov 17, 2026
Merged

Paul Lizer (paullizer) merged 1 commit into
Developmentfrom
paullizer-government-speech-development

Conversation

@paullizer

Copy link
Copy Markdown
Collaborator

Summary

  • Preserve the configured Government/custom endpoint for managed-identity voice discovery and synthesis. Construct SpeechConfig(endpoint=...), then assign the existing aad#resource-id#token authorization value; preserve public-cloud region-based MI and endpoint/key authentication.
  • Propagate chat Speech SDK service cancellations, unexpected interruptions, and incomplete 120-second recognition waits instead of returning silence/partial text as success. Preserve normal recognition/end-of-stream behavior, stop/disconnect cleanup, and safe HTTP errors.
  • Remove transcript/provider cancellation debug output and raw route traceback printing; emit sanitized application-owned failure codes. Add offline native-SDK/recognizer regressions and Government setup/fix documentation. No customer incident root cause is claimed without logs or deployment details.

Linked issue

Refs #1946. This is the Development implementation; a separate main port is coordinated independently. No merge or Azure deployment is authorized.

Release Notes & Latest Features

  • New Feature
  • Bug Fix
  • UI Enhancement
  • Breaking Change
  • Internal only

Is this visible to end users?

  • Yes
  • No

Is this admin-facing (Admin Settings, governance, deployment, config)?

  • Yes
  • No

Should this become a Latest Feature card?

  • Yes
  • No
  • Already added

Screenshot needed for the card?

  • Yes
  • No
  • Attached

Version bump

  • application/single_app/config.py VERSION third segment bumped, or not needed because this is docs-only
  • deployers/version.txt bumped, or not needed because deployers/ was not changed

Application: 0.261.449 -> 0.261.450. No deployer changes.

Testing / validation

All commands below ran offline where application behavior was exercised; no live Azure calls or customer credentials were used.

Speech regressions: python -m pytest functional_tests\test_government_speech.py -q -p no:cacheprovider — 2 passed on installed Speech SDK 1.47.0, then 2 passed again with pinned SDK 1.48.2 on PYTHONPATH (restored into a session-only dependency directory, not the repository/shared installation). The two fresh-process probes cover native SDK Government/custom endpoint retention and auth format; public MI/key compatibility; normal speech/silence/EOF; cancellation with/without partial text; interruption; timeout with/without partial text; late/startup failure; safe route responses; cleanup; logger sanitizer code retention; and Government/custom Fast API bypass.

Related regressions: the following exact PowerShell/Python invocation — 17 passed:

$env:PYTHONPATH = "$PWD\application\single_app;$PWD\functional_tests"; @'
import sys
from test_support.offline_bootstrap import offline_app_imports
with offline_app_imports():
    import pytest
    result = pytest.main(['functional_tests/test_tts_voice_fallback.py', 'functional_tests/test_tts_speech_speed_prosody_rate.py', 'functional_tests/test_v2_admin_speech_resource_id_save.py', '-q', '-p', 'no:cacheprovider'])
sys.exit(result)
'@ | python -

Affected document-owner runtime SDK evidence: the following exact command — 45 passed:

$env:PYTHONPATH = "$PWD\application\single_app;$PWD\functional_tests"; python -m pytest -p test_support.cosmos_network_guard functional_tests\test_document_search_metadata_sync.py::test_status_updates_preserve_sdk_points_etags_and_query_rows functional_tests\test_document_search_metadata_sync.py::test_held_status_updates_distinguish_processing_details_from_final_completion functional_tests\test_document_search_metadata_sync.py::test_status_update_cannot_write_after_its_operation_guard_expires functional_tests\test_document_chunk_bookkeeping.py::test_sdk_conditional_warning_cleanup functional_tests\test_document_chunk_bookkeeping.py::test_upload_finalizer_persists_actual_not_processor_estimated_count functional_tests\test_content_screening_upload_only_intake.py::test_model_generated_metadata_applies_without_a_hold functional_tests\test_excel_document_accessibility_extraction.py::test_ingestion_modes_scopes_native_properties_and_chunk_identity functional_tests\test_excel_document_delete_sdk_contract.py functional_tests\test_workspace_metadata_outcomes.py::test_upload_dispatcher_preserves_ready_content_after_metadata_failure -q -p no:cacheprovider

python scripts\check_cosmos_response_boundaries.py --refresh — completed. Reviewed only the 45 affected document-module entries after AST comparison proved that every storage owner and import remained unchanged; existing representative owner-runtime SDK evidence was rerun above. No source-only baseline expansion or unrelated review approval.

Known baseline blocker: python scripts\check_cosmos_response_boundaries.py --run-contracts — failed before executing its aggregate suite, reporting 18 pre-existing stale reviews in route_backend_orchestration.py (1,104 owners / 433 doubles). Those source files and inventory reviews are unchanged by this PR; all affected functions_documents.py entries are current. Do not interpret the separately passing owner checks as a green full Cosmos gate.

Additional exact commands/results:

  • python functional_tests\route_tests\test_route_blueprint_policy_inventory.py — 15/15 passed.
  • python functional_tests\route_tests\test_route_unauthenticated_policy_contract.py — 10/10 passed.
  • python functional_tests\route_tests\test_route_policy_test_coverage.py — 5/5 passed.
  • python functional_tests\test_docs_site_quality.py — 6/6 passed.
  • python functional_tests\test_docs_app_surface_coverage.py — 7/7 passed, generated surface inventory remains current; no surface additions/renames.
  • python -m py_compile application\single_app\functions_documents.py application\single_app\route_backend_speech.py functional_tests\test_government_speech.py — passed.
  • git -c core.whitespace=blank-at-eol,blank-at-eof,space-before-tab,cr-at-eol diff --check — passed.

No live Government resource smoke test was performed. RBAC, network reachability, actual service availability, and the customer's exact failing workflow remain environment-specific validation needs.

Documentation

  • Release notes updated, or not needed
  • Feature documentation updated, or not needed
  • Fix documentation updated, or not needed

Fix documentation: docs/explanation/fixes/AZURE_GOVERNMENT_SPEECH_FIX.md; related setup guide: docs/guides/azure-speech-managed-identity-setup.md. Release notes and issue progress comments are intentionally deferred to the coordinator's user decision.

Security checklist

  • New Flask routes include @swagger_route(security=get_auth_security())
  • Settings sent to non-admin frontends use sanitize_settings_for_user()
  • Browser JavaScript is served from local SimpleChat static assets only; no CDN-hosted JS
  • No secrets, keys, connection strings, or local-only artifacts are included

No routes, auth policies, settings response payloads, frontend assets, token scopes, or Government/custom Fast Transcription eligibility were added/changed. New diagnostics use [SPEECH] with failure_code values speech_sdk_canceled, speech_sdk_interrupted, and speech_sdk_timeout, not provider details or transcript/audio contents.

Refs #1946

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@paullizer
Paul Lizer (paullizer) merged commit 74d3bd0 into Development Nov 17, 2026
12 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant