fix: redact smallest tts headers and report asr connection status - #2293
Open
harshitajain165 wants to merge 2 commits into
Open
Conversation
harshitajain165
force-pushed
the
fix/smallest-header-redaction-and-connection-status
branch
from
August 25, 2026 20:43
e3dd962 to
5417a45
Compare
3 tasks
SmallestTTSConfig.to_str(sensitive_handling=True) only masked params.api_key; headers (including a supported Authorization auth path) were logged in plaintext during KEYPOINT vendor_config logging. Redact headers with the shared ten_ai_base.utils.redact_headers() helper, and add coverage for Authorization and API-key header variants.
smallest_asr_python never called the base on_connected() after a successful WebSocket handshake, and never called on_disconnected() on connect failure or an unexpected socket close/error. The base class only emits CONNECTING before start_connection() runs, so the reported connection_status_changed state stayed "connecting" even once the socket was usable or had already failed. Call on_connected() immediately after ws_connect() succeeds, and on_disconnected() with the available error/close details before scheduling a reconnect.
harshitajain165
force-pushed
the
fix/smallest-header-redaction-and-connection-status
branch
from
August 25, 2026 20:54
5417a45 to
3256876
Compare
|
Please add the Guarder integration test results to this PR. task asr-guarder-test EXTENSION=<asr_extension_name> CONFIG_DIR=tests/configsfor the tts extension, run: Please include the exact command, a summary of passed tests, and any failures. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Addresses both issues raised in #2203 (comment):
Security:
SmallestTTSConfig.to_str(sensitive_handling=True)masked onlyparams.api_key;headers(including a supportedAuthorizationauth path merged into the actual HTTP request) were logged in plaintext duringKEYPOINT vendor_configlogging. Now redacted with the sharedten_ai_base.utils.redact_headers()helper, with test coverage forAuthorizationand API-key header variants.Connection status:
smallest_asr_pythonnever called the baseon_connected()after a successful WebSocket handshake, and never calledon_disconnected()on connect failure or an unexpected socket close/error. The base class only emitsCONNECTINGbeforestart_connection()runs, so the reportedconnection_status_changedstate stayed"connecting"even once the socket was usable or had already failed. Now callson_connected()immediately afterws_connect()succeeds, andon_disconnected()with the available error/close details before scheduling a reconnect.Testing
Ran the real pytest suite (not just static checks) inside the project's Linux dev container, since
ten_runtime_pythonis a compiled native extension:smallest_tts_python: 16/16 passed, including 3 new tests for header redaction.smallest_asr_python: 9/10 passed (newtest_connection_status.py+ all pre-existing tests). The one failure (test_invalid_params) is a pre-existing, unrelated environment issue — the dev container has a realSMALLEST_API_KEYset, which invalidates that specific test's "no key anywhere" assumption. Not touched by this diff (onlystart_connection()/_process_messages()were changed;test_invalid_paramsexerciseson_init).