Skip to content

feat: add dependency-aware tool execution - #7385

Open
vznh wants to merge 8 commits into
livekit:mainfrom
vznh:feat/tool-dependency-ordering-6399
Open

vznh wants to merge 8 commits into
livekit:mainfrom
vznh:feat/tool-dependency-ordering-6399

Conversation

@vznh

@vznh vznh commented Sep 21, 2026 •

Copy link
Copy Markdown

Problem

Related to #6399.

Tools returned together currently start in parallel, even when one depends on another. Awaiting the existing executor is insufficient because ctx.update() returns control before the tool finishes.

Behavior

Adds optional local execution ordering:

@function_tool(after=("save_room",))
async def save_meal(ctx: RunContext, meal: str) -> str:
    ...

Independent calls start eagerly. Dependents wait until the function stream closes and all matching prerequisites finish. Tools without dependency metadata retain parallel execution.

  • Dependencies apply within one function-stream batch; an absent prerequisite creates no wait. Arguments are not regenerated.
  • Progress updates do not satisfy a dependency. Prerequisite errors or individual cancellation do; ordering does not require success.
  • Configured name cycles are rejected before dispatch. Session close, stream cancellation, and permanent handoff abandon queued calls while preserving the existing lifetime of admitted session-scoped tools.

Validation

After merging main: 215 focused tests passed, along with make fix, make check, and all executed CI checks on 1ce5bc455.

Coverage includes ordering, progress/result delivery, malformed calls, cancellation, handoff, and provider commit failures. Earlier local unit/audio validation had two baseline process-memory permission failures. Live-provider/evaluation jobs were skipped; live services and physical audio remain unvalidated.

@CLAassistant

CLAassistant commented Sep 21, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

Remove configurable prerequisite failure policy and its inheritance. Preserve ordering after failed prerequisites and settle deferred delivery task exceptions explicitly.
@vznh
vznh marked this pull request as ready for review September 22, 2026 21:40
@vznh
vznh requested a review from a team as a code owner September 22, 2026 21:40
devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

@vznh

vznh commented Sep 22, 2026

Copy link
Copy Markdown
Author

Devin approved ^_^

@vznh

vznh commented Sep 24, 2026

Copy link
Copy Markdown
Author

@tinalenguyen would it be possible to check this over? thank you :-)

This branch has not been deployed

No deployments
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