Skip to content

fix: oracle asr timestamp not resolved#2123

Merged
plutoless merged 18 commits into
TEN-framework:mainfrom
zshbleaker:main
Apr 2, 2026
Merged

fix: oracle asr timestamp not resolved#2123
plutoless merged 18 commits into
TEN-framework:mainfrom
zshbleaker:main

Conversation

@zshbleaker

Copy link
Copy Markdown
Contributor

No description provided.

@plutoless
plutoless merged commit e07f6c7 into TEN-framework:main Apr 2, 2026
17 checks passed
@github-actions

github-actions Bot commented Apr 2, 2026

Copy link
Copy Markdown

Code review posted - see details in response

@github-actions

github-actions Bot commented Apr 2, 2026

Copy link
Copy Markdown

Code Review

Summary

This PR fixes Oracle ASR timestamp field names (startTimeMs/endTimeMs -> startTimeInMs/endTimeInMs), adds TTS cancellation support for in-flight OCI API calls, and introduces a custom_headers feature to openai_llm2_python to support Oracle's opc-compartment-id requirement. Overall the changes are clean and well-targeted.


Core Bug Fix - oracle_asr_python/extension.py

The one-liner fix is correct. Renaming startTimeMs/endTimeMs to startTimeInMs/endTimeInMs matches the Oracle Speech API actual response shape. Simple and accurate.


oracle_tts_python/oracle_tts.py - _get_audio_bytes_cancellable

The cancellation approach is a genuine improvement over the previous blocking asyncio.to_thread call. Two things worth noting:

1. Use asyncio.get_running_loop() instead of asyncio.get_event_loop()

get_event_loop() emits a DeprecationWarning in Python 3.10+ when called from a coroutine that does not own the loop. get_running_loop() is the correct call inside async functions and raises RuntimeError clearly if there is no running loop, rather than silently creating one:

fut = asyncio.get_running_loop().run_in_executor(None, self._get_audio_bytes, text)

2. fut.cancel() does not stop an already-running thread

ThreadPoolExecutor futures can only be cancelled before the thread starts. Once _get_audio_bytes begins executing the OCI SDK call, fut.cancel() returns False and the thread runs to completion. The function still correctly returns None and the result is discarded, so the observable behavior is right - but a short comment would help future readers understand that cancellation is best-effort, not preemptive.


openai_llm2_python/openai.py - custom_headers

Clean implementation. One minor point: header keys are passed through str(key) without whitespace or colon validation. HTTP header field names must not contain spaces or colons (RFC 7230 s3.2). In practice this is unlikely to cause issues since configs are author-controlled, but malformed keys could produce confusing HTTP-level errors. The value-type guard (rejecting dict/list) is a good defensive touch.


property.json - voice_assistant_oracle graph

The graph structure is correct and follows the established pattern. OCI_KEY_FILE_BASE64 for the PEM private key is a sensible approach for env-var transport of multi-line secrets.

One minor observation: the greeting field is set in both the llm node and the main_control node with identical text. Other voice-assistant graphs in this file only set it in main_control. The duplication is harmless but inconsistent - worth aligning.


Overall

The core fix is solid and the supporting changes are well-considered. The two items most worth a follow-up are the get_event_loop() -> get_running_loop() change (correctness and forward-compatibility with Python 3.10+) and a clarifying comment on the thread-cancellation behavior. Everything else is minor.

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.

2 participants