Skip to content

feat(live): Support asynchronous non-blocking tools - #6522

Merged
wuliang229 merged 4 commits into
v1from
port-async-non-blocking-tools-v1
Jul 30, 2026
Merged

feat(live): Support asynchronous non-blocking tools#6522
wuliang229 merged 4 commits into
v1from
port-async-non-blocking-tools-v1

Conversation

@wuliang229

Copy link
Copy Markdown
Collaborator

Port live API non-blocking function response scheduling and background task execution from main to v1 branch.

  • Add response_scheduling attribute to BaseTool
  • Mark response_scheduling & live streaming tools as NON_BLOCKING declarations
  • Execute non-blocking tools in background asyncio.Task without blocking live event stream
  • Add active_non_blocking_tool_tasks to InvocationContext for task tracking
  • Guard against emitting None function-response events in live stream

Port live API non-blocking function response scheduling and background task execution from main to v1 branch.

- Add response_scheduling attribute to BaseTool
- Mark response_scheduling & live streaming tools as NON_BLOCKING declarations
- Execute non-blocking tools in background asyncio.Task without blocking live event stream
- Add active_non_blocking_tool_tasks to InvocationContext for task tracking
- Guard against emitting None function-response events in live stream
@wuliang229 wuliang229 changed the title feat(live): Support asynchronous non-blocking tools in v1 feat(live): Support asynchronous non-blocking tools Jul 30, 2026
Port complete unit test suite for response scheduling, non-blocking tool declarations, deferred function call handling, and parallel/exception background task execution from main to v1 branch.
… mypy

- Import asyncio in invocation_context.py
- Add -> Optional[Event] return type annotation to _run_with_trace in functions.py
@wuliang229
wuliang229 requested a review from wukath July 30, 2026 16:42
@wuliang229
wuliang229 merged commit c299420 into v1 Jul 30, 2026
13 of 14 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