Skip to content

verbose=True crashes on any tool-calling response (AttributeError on ChatCompletionMessageToolCall) #54

Description

SDK version

0.3.0

Python version

Python 3.9.18, Python 3.12.12

Platform

Darwin 24.6.0 arm64 arm

Error type

AttributeError

What issue are you seeing?

Running
DedalusRunner(client, verbose=True).run(..., tools=[...])
crashes on the first response that contains tool calls. verbose=False works fine. The bug is entirely in the verbose-only logging branches, not in the agent execution path.

Steps to reproduce

import os
from dedalus_labs import Dedalus
from dedalus_labs.lib.runner import DedalusRunner


def add(a: int, b: int) -> int:
    """Add two numbers."""
    return a + b


client = Dedalus(api_key=os.environ["DEDALUS_API_KEY"])
runner = DedalusRunner(client, verbose=True)  # <-- the trigger

runner.run(
    model="openai/gpt-5-nano",
    input="What is 3 + 4? You MUST call the add tool.",
    tools=[add],
)

Setting verbose=False (the default) on the same script completes successfully (tools_called=['add'], final_output='The sum is 7...'), which isolates the bug to the verbose-print path.

Verified to crash on a clean uv venv --python 3.12 && uv pip install -e . install of dedalus-labs@v0.3.0.

Expected behavior

With verbose=True, the runner should print the names of tool calls in the response and continue executing the agent loop, same behavior as verbose=False, just with extra logs. No exception.

Additional context

Happy to open a PR with solving the issue.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions