simplify(compat): tools-A — repoint 4 stale docstring references (tools.approval.*, tools.transcription_tools.*) to the defining modules

This commit is contained in:
Teknium
2026-09-03 14:37:14 -07:00
parent a2a8207711
commit b92308b1d2
4 changed files with 6 additions and 6 deletions

View File

@@ -115,12 +115,12 @@ _AUTHORIZATION_GATE_LOCK_TIMEOUT_S = 360.0
def _authorization_gate_lock_timeout() -> float:
"""Authorization-lock bound = ``tools.approval.human_wait_ceiling`` (approval timeout +
"""Authorization-lock bound = ``tools.approval_human_wait.human_wait_ceiling`` (approval timeout +
margin, capped so it can't overflow Lock.acquire): never break serialization while a
prompt is answerable, never let a wedged holder park workers forever. Deliberately NOT
min()'d with the fallback so the gate never gives up early.
Delegates to ``tools.approval.human_wait_ceiling`` — the same bound that clamps a human-wait window's
Delegates to ``tools.approval_human_wait.human_wait_ceiling`` — the same bound that clamps a human-wait window's
deadline contribution — so the two can't drift. Long enough that serialization is never broken while a
legitimate approval prompt is still answerable; short enough that a wedged holder (hanging
``pre_tool_call`` plugin, dead approval client) cannot park other workers forever (#79719). Resolved

View File

@@ -243,7 +243,7 @@ def _is_command_provider_block(value: Any) -> bool:
"""True when *value* declares a command-type voice provider.
Mirrors the runtime discriminators (``tools.tts_command_provider._is_command_provider_config`` /
``tools.transcription_tools._is_command_stt_provider_config``) and the desktop's
``tools.transcription_command._is_command_stt_provider_config``) and the desktop's
``isCommandProvider``: ``type`` is OPTIONAL and case/space-insensitive (absent or
normalizing to ``"command"``); ``command`` MUST be a non-empty string.
"""

View File

@@ -13,7 +13,7 @@ away — had two coupled failure modes:
``remaining = (deadline + (now - window_started)) - now = deadline - window_started``.
The fix moves deadline exclusion to the source of the human wait
(``tools.approval.human_wait_window`` around the CLI prompt and the gateway
(``tools.approval_human_wait.human_wait_window`` around the CLI prompt and the gateway
approval poll loop) and bounds the serialization lock acquire. A wedged
plugin now contributes nothing to the exclusion, so the batch times out
normally; a genuine approval wait is still excluded in full.

View File

@@ -4,7 +4,7 @@ propagation into concurrent tool worker threads.
Background
----------
Gateway adapters (Slack, Telegram, Discord, ...) set
``tools.approval._approval_session_key`` as a ContextVar before calling
``tools.approval_context._approval_session_key`` as a ContextVar before calling
``agent.run_conversation`` so that dangerous-command approval prompts route
back to the channel/session that initiated the tool call. When the agent
dispatches multiple tools in parallel, it uses
@@ -77,7 +77,7 @@ def test_run_tool_worker_sees_parent_approval_session_key():
Mirrors the exact shape of the fixed call site in
``run_agent.py::_execute_tool_calls_concurrent`` — a
``ThreadPoolExecutor`` with ``executor.submit(ctx.run, fn, *args)``.
Sets the real ``tools.approval._approval_session_key`` ContextVar
Sets the real ``tools.approval_context._approval_session_key`` ContextVar
in the caller and asserts the worker observes it via
``tools.approval.get_current_session_key()``.