Skip to content

doheny-surf-desk: fresh install can resolve to livekit-agents==1.3.2 causing task_ids NameError; plugin/agents version mismatch can cause OpenAI ImportError after upgrade #76

@AnsImran

Description

@AnsImran

Summary

In complex-agents/doheny-surf-desk, the current dependency constraints allow livekit-agents==1.3.2 on a fresh install. With that resolved version, the agent can crash during the mobile-number step — not due to speech/digit parsing, but because strict tool schema generation fails with a NameError: task_ids is not defined.

After bumping livekit-agents, the example can also fail at startup with:
ImportError: cannot import name 'to_fnc_ctx' ... (from livekit.plugins.openai)
This occurs when the OpenAI plugin is not compatible with the installed livekit-agents version.

Why this happens

The example currently uses minimum-version constraints like:

  • livekit-agents>=1.3.2
  • livekit-plugins-openai>=1.3.2

So uv can legitimately resolve to livekit-agents==1.3.2, which triggers the task_ids failure. Additionally, if livekit-agents is upgraded but the OpenAI plugin remains on an older compatible-by-range version, the import mismatch (to_fnc_ctx) can occur.

Environment

  • OS: Windows 10 (10.0.19045.6466)
  • Python: 3.11.x
  • Package manager: uv
  • Example: complex-agents/doheny-surf-desk

Repro steps (fresh clone)

  1. Clone repo
  2. cd complex-agents/doheny-surf-desk
  3. Install deps from current pyproject.toml
  4. uv run python agent.py dev
  5. Provide name, then speak digits when asked for mobile number (e.g., “It’s zero three zero zero …”)

Expected

Agent continues collecting the phone number and proceeds to the next task.

Actual (failure mode #1)

LLM/tool schema building fails during strict tool schema generation.

Key excerpt (trimmed):

  • NameError: name 'task_ids' is not defined
  • then retries and terminates with “failed to generate LLM completion after 4 attempts”

Actual (failure mode #2 after upgrading agents)

Startup can fail with:
ImportError: cannot import name 'to_fnc_ctx' from 'livekit.agents.inference.llm'
(from livekit.plugins.openai)

Proposed fix (validated)

Bump minimum versions for BOTH agents and OpenAI plugin to avoid the known-bad versions:

  • livekit-agents>=1.3.4
  • livekit-plugins-openai>=1.3.4

Tested on Windows: fresh clone → update these two lines → uv syncuv run python agent.py works out of the box.

(Optionally, a short README note could explain that to_fnc_ctx ImportError indicates a plugin/agents version mismatch.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions