Skip to content

TaskList is disconnected from messages #2058

@hayescode

Description

@hayescode

Describe the bug
In previous versions before 2.0.0 making a TaskList with Tasks assigned to messages via forId would let you click on the Task and it would highlight the attached message.

Documentation: https://docs.chainlit.io/api-reference/elements/tasklist

Perhaps TaskList should be re-thought because this is a great capability for multi-agents (my use case) and it would be great to have "Agent Name" (author) above each task, integrate with the state of the Step/Message (if end is not null it's "processing") and things like that.

To Reproduce

import chainlit as cl


@cl.on_chat_start
async def main():
    # Create the TaskList
    task_list = cl.TaskList()
    task_list.status = "Running..."

    # Create a task and put it in the running state
    message1 = await cl.Message(content="Started processing data").send()
    task1 = cl.Task(title="Processing data", status=cl.TaskStatus.RUNNING, forId=message1.id)
    await task_list.add_task(task1)
    # Create another task that is in the ready state
    message2 = await cl.Message(content="Analyzing data").send()
    task2 = cl.Task(title="Analyzing data", status=cl.TaskStatus.READY, forId=message2.id)
    await task_list.add_task(task2)

    # Update the task list in the interface
    await task_list.send()

    # Perform some action on your end
    await cl.sleep(3)

    # Update the task statuses
    task1.status = cl.TaskStatus.DONE
    task2.status = cl.TaskStatus.RUNNING
    await task_list.send()
    await cl.sleep(3)

    task2.status = cl.TaskStatus.FAILED
    task_list.status = "Failed"
    await task_list.send()

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingenhancementNew feature or requestkeep-for-a-whileDon’t mark as stale. This label should be used only for confirmed bugs or other important thingsneeds-triage

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions