Files
hermes-agent/hermes_cli
Teknium 7e62d683a6 fix: native-http profile scope follows audio and OAuth work onto worker threads
native_profile_scope sets a secondary-profile native ticket's home as a
task-local override, so implicit selectors (no ?profile=) resolve in the
ticket's profile. The audio and provider-OAuth routers then moved work onto
run_in_executor or a bare threading.Thread, and neither copies contextvars.
The worker thread therefore resolved the LAUNCH profile:

- /api/audio/voice-config, the elevenlabs voices list, the TTS/STT lease
  routes and speak-stream read the launch profile's STT/TTS config and keys.
- The OAuth device-code poller saved provider tokens into the launch profile.

Native-http tickets are new in this PR, so this is not a main regression.
In-process probe: inside the event loop and under to_thread the home is the
secondary; under run_in_executor and in the poller thread it is the process
home. The fix uses asyncio.to_thread, which copies the context, and starts
the poller thread inside contextvars.copy_context().run. Other dashboard
threads (WhatsApp pairing, MCP OAuth) are given explicitly resolved paths and
were left alone.

(cherry picked from commit 57480ee1f5a88692e58b7f076223406356d91dbe)
2026-10-06 16:21:15 -07:00
..
…
…
…
…
…
…
…
…
…
…
…
…