Commit Graph
7 Commits
Author SHA1 Message Date
Théo MonnomandLong Chen 6b1b4a5ea8 Agents 2.0 beta
A framework for agents that hold a conversation with a person by voice
and by text, across days, and get real work done behind it. An agent is
a fast brain facing the person and a slow brain doing the work, talking
over A2A; the conversation lives in a durable thread on agent-db, a lane
per agent, continued by any worker.

Text mode (agent.run, the a2a_session door), HTTP routing on the node,
delegation with progress and verbatim answers, tasks awaited in text,
graphs, human in the loop, the start of the Rust core, three fast brain
and slow brain examples with simulation scenarios, the console, docs per
feature, and a migration skill.

Co-authored-by: Long Chen <longch1024@gmail.com>
2026-10-12 11:28:16 -07:00
u9g 50e1d6981f fix(voice): re-watch a completed AgentTask's awaiter in the active run (#7641) 2026-10-05 19:03:42 -04:00
u9g db28484c94 feat(agents): serialize the inline AgentTasks awaited from one turn (#6862) 2026-08-21 09:08:32 -04:00
Long Chen 9d1adbd503 fix(voice): race between session.run and an in-flight AgentTask handoff (#6315) 2026-07-06 09:36:35 +08:00
Arseny Boykov 8c71144c6d tests: speed up unit tests (#5980)
Running `pytest --unit` with these changes goes from 3 minutes 44 seconds to just **30 seconds**.  

### How does it work
#### Virtual time
Takes advantage of the fact that many of the tests rely on `asyncio.sleep()` to synchronize events in the loop. It unties it from the real time so that `await asyncio.sleep(60)` returns instantly with `loop.time()` reporting 60 seconds passed. `time.time()` is then patched to report loop time. This brings down `test_agent_session.py` test time form 90 seconds to just 1 second without any modifications to the test itself.

- To disable globally `--real-time` option can be used.
- To enable/disable per-module or per-test `pytest.mark.virtual_time`/`.real_time` can be used.

#### Concurrent tests
Tests with real I/O are groupped by their module and executed in a shared event loop. This shrinks wall time of the whole module to wall time of the slowest test + raw compute. `contextvars` are used to preserve input capture and track leaked tasks.

- To disable concurrent execution, `--no-concurrent` option can be used.
- To enable/disable per-module or per-test, `pytest.mark.no_concurrent`/`.no_concurrent` can be used.

### Changes
- Add `pytest-asyncio-concurrent` — gives the speedup for I/O bound tests
- Add `tests/concurrent.py` that extends on `pytest-asyncio-concurrent` and adds crucial features:
    - Captures stdout/stderr and reports on failure (same as `pytest`)
    - Allows leaked tasks detection in concurrent mode (so that `fail_on_leaked_tasks` continues to work)
    - adds `--concurrent`/`--no-concurrent` options
    - Adds live progress
- Add `tests/virtual_time.py` that provides instant and deterministic `asyncio` clock for time-bound execution

#### Changes to the tests sources
- https://github.com/livekit/agents/pull/5980/commits/04fe6cbb55c32d1058a01a4c0ddda790b5834770: Add `concurrent`/`virtual_time` markers to tests modules
- https://github.com/livekit/agents/pull/5980/changes/a8f5be0be8b76efefaa55743d8ad0a5d77b15b1b: Tighten timings in `test_audio_decoder.py`, `test_ipc.pt` and `test_room.py` 
- https://github.com/livekit/agents/pull/5980/changes/396bce8cbf4618a292ab28a257ea13f58bd3c5a6: Make `test_async_channel` and `test_proc_pool_launch_job_raises_when_all_spawns_fail` in `test_ipc.py` safe to run concurrently
2026-06-09 13:23:41 +04:00
Arseny BoykovandClaude daeacfeff7 test: categorize tests and select via pytest --unit/--plugin openai/ … flags (#5945)
Co-authored-by: Claude <noreply@anthropic.com>
2026-06-03 15:09:06 +04:00
Long Chenanddevin-ai-integration[bot] 90af80cf60 fix: AgentTask deadlock when on_enter awaits generate_reply that triggers another AgentTask (#5377)
Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-04-10 10:04:07 +08:00