Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(do-not-merge) new feature trunk: tasks #351

Open
wants to merge 32 commits into
base: dev
Choose a base branch
from
Open

(do-not-merge) new feature trunk: tasks #351

wants to merge 32 commits into from

Conversation

creatorrr
Copy link
Contributor

@creatorrr creatorrr commented May 30, 2024

Todo list

  • add option in task definition: tools_available: "all" which will automatically add all of the tools that the agent has access to
  • consistent and semantically correct naming of event types (running, started etc)
  • validations for all task, workflow and execution definitions
  • add checks to cozo queries


🚀 This description was created by Ellipsis for commit 6276f74

Summary:

Enhances task management with new features, refactoring, and validations, including CRUD operations, workflow execution, and migration scripts.

Key points:

  • Add tools_available: "all" option in task definition to include all tools accessible to the agent (agents-api/agents_api/autogen/openapi_model.py).
  • Ensure consistent and semantically correct naming of event types (e.g., running, started).
  • Implement validations for all task, workflow, and execution definitions.
  • Add checks to Cozo queries.
  • Add migration script agents-api/agents_api/migrations/migrate_1716939839_task_relations.py.
  • Introduce relations: tasks, executions, transitions with up (create) and down (remove) queries.
  • Use run function to execute queries formatted as JSON.
  • Rename list_sessions to list_tasks in agents-api/agents_api/routers/tasks/routers.py.
  • Modify activity definitions in agents-api/activities/task_steps/__init__.py for various workflow steps.
  • Add cel-python dependency in pyproject.toml.
  • Introduce prompt_step and transition_step activities.
  • Update TaskProtocol, ExecutionInput, StepContext, and TransitionInfo.
  • Modify create_execution_transition_query to handle new transition data.
  • Refactor llm_generate and caching mechanism.
  • Enhance PydanticPayloadConverter for better serialization.
  • Implement TaskExecutionWorkflow to manage task execution flow.
  • Update transition type logic in agents-api/agents_api/workflows/task_execution.py to handle awaiting_input, finish, and step states.
  • Add TasksManager and AsyncTasksManager classes in sdks/python/julep/managers/task.py for task management.
  • Introduce CRUD operations for tasks and task executions.
  • Update Client and AsyncClient classes in sdks/python/julep/client.py to include task management capabilities.
  • Add methods for listing, creating, retrieving, and starting task executions.
  • Ensure type checking with beartype decorator.
  • Add tests for task management in agents-api/tests/test_tasks.py and sdks/python/tests/test_tasks.py.

Generated with ❤️ by ellipsis.dev

@creatorrr creatorrr changed the title new feature trunk: tasks (do-not-merge) new feature trunk: tasks May 30, 2024
Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Looks good to me! Reviewed everything up to d1841b8 in 1 minute and 5 seconds

More details
  • Looked at 87 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 3 drafted comments based on config settings.
1. agents-api/migrations/migrate_1716939839_task_relations.py:1
  • Draft comment:
    The shebang line is incorrectly formatted. It should be #!/usr/bin/env python3 without a space after # to ensure proper execution.
  • Reason this comment was not posted:
    Confidence of 30% on close inspection, compared to threshold of 50%.
2. agents-api/migrations/migrate_1716939839_task_relations.py:10
  • Draft comment:
    The method of constructing the final query string in the run function might lead to invalid syntax. Each query should be correctly formatted as a complete JSON object if they are to be joined in this manner.
  • Reason this comment was not posted:
    Confidence of 30% on close inspection, compared to threshold of 50%.
3. agents-api/migrations/migrate_1716939839_task_relations.py:20
  • Draft comment:
    The type 'Validity' used for 'updated_at_ms' is not a standard SQL type. Please ensure it is correctly defined or replace it with a standard type if it's an error.
  • Reason this comment was not posted:
    Confidence of 40% on close inspection, compared to threshold of 50%.

Workflow ID: wflow_nP7XDMDpmq0Uf9ys


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

alt-glitch and others added 2 commits May 30, 2024 06:14
* openapi schema, definitions & sdks updated; endpoints added for tasks feature

* follow convention for naming routes
Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Looks good to me! Incremental review on 170c301 in 1 minute and 56 seconds

More details
  • Looked at 13 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. agents-api/agents_api/routers/tasks/routers.py:41
  • Draft comment:
    Ensure that the function call list_tasks_query is correctly named and intended to be used here, as the function name was changed in the endpoint but not inside the function body.
  • Reason this comment was not posted:
    Confidence of 0% on close inspection, compared to threshold of 50%.

Workflow ID: wflow_tDOnBnhWOJY4HOiQ


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

creatorrr and others added 4 commits June 6, 2024 07:21
* wip(agents-api): cozo queries for tasks

Signed-off-by: Diwank Tomer <[email protected]>

* doc: Add documentation for the new endpoints

* wip: Boilerplate for execution transitions queries

* wip: add boilerplate execution transitions queries

* wip: task feature routes and models

* feat(agents-api): Add tests for task queries and fix bugs

Signed-off-by: Diwank Tomer <[email protected]>

* fix(agents-api): Fix cozo queries and make tests pass

Signed-off-by: Diwank Tomer <[email protected]>

---------

Signed-off-by: Diwank Tomer <[email protected]>
Co-authored-by: Diwank Tomer <[email protected]>
Co-authored-by: Siddharth Balyan <[email protected]>
* wip: Fix openapi.yaml

Signed-off-by: Diwank Tomer <[email protected]>

* wip: generate sdk files

* feat(agents-api): Rename transition.type and execution.status

Signed-off-by: Diwank Tomer <[email protected]>

* fix(sdks/python): Minor fix

Signed-off-by: Diwank Tomer <[email protected]>

* wip: demo implementation of tasks

Signed-off-by: Diwank Tomer <[email protected]>

* wip: demo implementation of tasks

Signed-off-by: Diwank Tomer <[email protected]>

* wip(agents-api): temporal workflow codec

Signed-off-by: Diwank Tomer <[email protected]>

* wip: demo implementation of tasks

Signed-off-by: Diwank Tomer <[email protected]>

* feat(agents-api): Toy implementation of Tasks

Signed-off-by: Diwank Tomer <[email protected]>

---------

Signed-off-by: Diwank Tomer <[email protected]>
Co-authored-by: Diwank Tomer <[email protected]>
Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Looks good to me! Incremental review on ea7bbff in 1 minute and 53 seconds

More details
  • Looked at 109 lines of code in 2 files
  • Skipped 1 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. agents-api/pyproject.toml:36
  • Draft comment:
    The PR adds a new dependency cel-python which is used in the evaluate_step function. Please update the PR description to include this change for complete documentation.
  • Reason this comment was not posted:
    Confidence of 0% on close inspection, compared to threshold of 50%.

Workflow ID: wflow_IcFvtqyNtcgR4xl2


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❌ Changes requested. Incremental review on 5393c4b in 2 minutes and 9 seconds

More details
  • Looked at 563 lines of code in 6 files
  • Skipped 1 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. agents-api/agents_api/routers/sessions/session.py:84
  • Draft comment:
    The @cache decorator is incorrectly applied to llm_generate, which is not an instance method. This could lead to errors since cache expects a self parameter. Consider refactoring cache to support both instance and standalone functions or adjust the usage accordingly.
# Consider refactoring cache or using a different approach for caching standalone functions
  • Reason this comment was not posted:
    Confidence of 0% on close inspection, compared to threshold of 50%.

Workflow ID: wflow_lEnYDsIJAe72RRgr


Want Ellipsis to fix these issues? Tag @ellipsis-dev in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

Signed-off-by: Diwank Tomer <[email protected]>
Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❌ Changes requested. Incremental review on 16b53fa in 1 minute and 16 seconds

More details
  • Looked at 13 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 0 drafted comments based on config settings.

Workflow ID: wflow_vBL8MEKpmMdkHwLH


Want Ellipsis to fix these issues? Tag @ellipsis-dev in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.


# Transition type
transition_type = (
"awaiting_input" if should_wait else ("finish" if is_last else "step")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change in the order of conditions for determining transition_type might introduce logical errors, especially if the workflow is expected to finish on the last step regardless of whether it is awaiting further input. Consider reverting the order or ensuring that the new logic aligns with the intended workflow behavior.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should make it more explicit and document this thoroughly coz otherwise it could get too confusing and coz logical errors for sure

Signed-off-by: Diwank Tomer <[email protected]>
Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Looks good to me! Incremental review on 4248da9 in 1 minute and 49 seconds

More details
  • Looked at 39 lines of code in 2 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. agents-api/agents_api/workflows/task_execution.py:123
  • Draft comment:
    The variable should_wait is used here but it's only defined conditionally within the PromptWorkflowStep case. This can lead to a NameError if other step types are processed. Consider initializing should_wait before the match statement to ensure it always has a defined value.
        should_wait = False
  • Reason this comment was not posted:
    Confidence of 0% on close inspection, compared to threshold of 50%.

Workflow ID: wflow_mkz2a3M85NYCIxk1


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Looks good to me! Incremental review on 4770cbb in 2 minutes and 12 seconds

More details
  • Looked at 20 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. agents-api/agents_api/activities/task_steps/__init__.py:3
  • Draft comment:
    The import statement for celpy is commented out. If celpy is not used in this file or elsewhere in the project, consider removing this line to clean up the code.
  • Reason this comment was not posted:
    Confidence changes required: 33%
    The import statement for ChatCompletion has been updated to a more specific path, which is generally good for clarity and avoiding potential conflicts. However, the import statement for celpy is commented out, which might indicate that it's not used or needed anymore. This could be a cleanup opportunity if celpy is indeed not used elsewhere in the file.

Workflow ID: wflow_2f9gMFV2RkrZ3S4Q


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Looks good to me! Incremental review on 9a5a36e in 2 minutes and 4 seconds

More details
  • Looked at 143 lines of code in 5 files
  • Skipped 0 files when reviewing.
  • Skipped posting 0 drafted comments based on config settings.

Workflow ID: wflow_pUS8SnWCeDIoLd2a


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❌ Changes requested. Incremental review on 836d2c4 in 2 minutes and 26 seconds

More details
  • Looked at 161 lines of code in 7 files
  • Skipped 0 files when reviewing.
  • Skipped posting 0 drafted comments based on config settings.

Workflow ID: wflow_rDXiWCiv0baSmKb7


Want Ellipsis to fix these issues? Tag @ellipsis-dev in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.


class TransitionInfo(BaseModel):
from_: List[str | int] | Tuple[str | int]
to: List[str | int] | None = None
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider allowing the to field in TransitionInfo to also accept Tuple[str | int] for consistency with the from_ field.

Suggested change
to: List[str | int] | None = None
to: List[str | int] | Tuple[str | int] | None = None

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it should be Tuple[str, int] rather than Tuple[str | int]

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is fixed

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Looks good to me! Incremental review on ab9011c in 1 minute and 52 seconds

More details
  • Looked at 100 lines of code in 4 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. agents-api/agents_api/models/execution/create_execution_transition.py:17
  • Draft comment:
    The type annotation for the to parameter is inconsistent with the TransitionInfo class definition. Consider aligning the type annotations to ensure consistency and prevent type errors.
    to: List[str | int] | None,
  • Reason this comment was not posted:
    Confidence of 0% on close inspection, compared to threshold of 50%.

Workflow ID: wflow_KlpIGBbP6X0vThFy


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

Diwank Tomer and others added 3 commits June 19, 2024 11:34
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Looks good to me! Incremental review on 0c3b0fd in 2 minutes and 16 seconds

More details
  • Looked at 770 lines of code in 2 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. sdks/python/julep/managers/task.py:99
  • Draft comment:
    Using assert for input validation is not recommended in production code as it can be skipped with certain Python flags (-O, -OO). Consider using explicit exceptions or error handling mechanisms to ensure robustness.
if not is_valid_uuid4(agent_id):
    raise ValueError("Invalid UUID format for agent_id")
  • Reason this comment was not posted:
    Confidence of 20% on close inspection, compared to threshold of 50%.

Workflow ID: wflow_WF0J89L0VXmmzVsj


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❌ Changes requested. Incremental review on fe94701 in 2 minutes and 48 seconds

More details
  • Looked at 36 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 0 drafted comments based on config settings.

Workflow ID: wflow_PbBT1gc4zGW5K5mD


Want Ellipsis to fix these issues? Tag @ellipsis-dev in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

"""
assert is_valid_uuid4(agent_id)

return await self._list(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The _list method in BaseTasksManager is not defined as an asynchronous method, which could lead to issues when using await here. Consider modifying the _list method in the base class to be asynchronous or adjust the implementation here to handle the synchronous nature of _list.

creatorrr and others added 2 commits June 21, 2024 08:26
* feat: Update SDKs and openapi spec

Signed-off-by: Diwank Tomer <[email protected]>

* feat: Add session_id field to execution relation

Signed-off-by: Diwank Tomer <[email protected]>

* feat(agents-api): Get execution input query

Signed-off-by: Diwank Tomer <[email protected]>

* wip

Signed-off-by: Diwank Tomer <[email protected]>

* feat: Regenerate SDKs

Signed-off-by: Julep Developers <[email protected]>

* wip

Signed-off-by: Diwank Tomer <[email protected]>

* wip

* feat(tasks): Enable all fields of ExecutionInput

Signed-off-by: Diwank Tomer <[email protected]>

---------

Signed-off-by: Diwank Tomer <[email protected]>
Signed-off-by: Julep Developers <[email protected]>
Co-authored-by: Diwank Tomer <[email protected]>
Co-authored-by: Julep Developers <[email protected]>
Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Looks good to me! Incremental review on c72546e in 2 minutes and 30 seconds

More details
  • Looked at 368 lines of code in 4 files
  • Skipped 0 files when reviewing.
  • Skipped posting 2 drafted comments based on config settings.
1. sdks/python/tests/test_tasks.py:55
  • Draft comment:
    Using random UUIDs for agent_id and task_id in this test case might not accurately test the system's behavior. Consider using actual IDs from the fixtures to ensure the test is meaningful and accurate.
response = client.tasks.start_task_execution(
    agent_id=test_task.agent_id,
    task_id=test_task.id,
    arguments={},
    status="enqueued",
)
  • Reason this comment was not posted:
    Confidence of 30% on close inspection, compared to threshold of 50%.
2. sdks/python/tests/test_tasks.py:107
  • Draft comment:
    This test case should also use actual agent_id and task_id from the fixtures instead of random UUIDs to ensure the test is meaningful and accurate.
response = await client.tasks.start_task_execution(
    agent_id=test_task_async.agent_id,
    task_id=test_task_async.id,
    arguments={},
    status="enqueued",
)
  • Reason this comment was not posted:
    Marked as duplicate.

Workflow ID: wflow_vm4FULhBwZUtTn64


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

creatorrr and others added 2 commits June 22, 2024 08:36
* wip

Signed-off-by: Diwank Tomer <[email protected]>

* wip

Signed-off-by: Diwank Tomer <[email protected]>

* wip

Signed-off-by: Julep Developers <[email protected]>

* feat(tasks): Update execution transition relation

Signed-off-by: Diwank Tomer <[email protected]>

---------

Signed-off-by: Diwank Tomer <[email protected]>
Signed-off-by: Julep Developers <[email protected]>
Co-authored-by: Diwank Tomer <[email protected]>
Co-authored-by: Julep Developers <[email protected]>
Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❌ Changes requested. Incremental review on 27ef8fd in 1 minute and 57 seconds

More details
  • Looked at 95 lines of code in 5 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. agents-api/agents_api/routers/tasks/routers.py:81
  • Draft comment:
    Using default empty lists for tools_available and workflows in create_task_query might lead to unexpected behavior. Ensure these parameters are validated or have sensible defaults to prevent issues.
  • Reason this comment was not posted:
    Confidence of 40% on close inspection, compared to threshold of 50%.

Workflow ID: wflow_2V80Dia35UcvfMdK


Want Ellipsis to fix these issues? Tag @ellipsis-dev in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

transition_info: TransitionInfo,
) -> dict:
print("Running transition step")
# raise NotImplementedError()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The commented out raise NotImplementedError() might indicate incomplete implementation. If this function is not ready, it should explicitly raise NotImplementedError to avoid silent failures or unexpected behavior in production.

workflows
}

:returning
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The :returning clause in the query string is incomplete. Specify the fields to be returned after the :returning clause to ensure the query functions correctly.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Looks good to me! Incremental review on 112d101 in 1 minute and 55 seconds

More details
  • Looked at 144 lines of code in 4 files
  • Skipped 0 files when reviewing.
  • Skipped posting 2 drafted comments based on config settings.
1. agents-api/agents_api/models/task/list_tasks.py:25
  • Draft comment:
    The comment in the list_tasks_query function incorrectly states that it returns a pd.DataFrame. Please update the comment to reflect the actual return type, which is a tuple of a string and a dictionary.
  • Reason this comment was not posted:
    Confidence of 0% on close inspection, compared to threshold of 50%.
2. agents-api/agents_api/models/task/list_tasks.py:26
  • Draft comment:
    The comment in the list_tasks_query function incorrectly states that it returns a pd.DataFrame. Please update the comment to reflect the actual return type, which is a tuple of a string and a dictionary.
  • Reason this comment was not posted:
    Marked as duplicate.

Workflow ID: wflow_BBziS9At59XOCAgl


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❌ Changes requested. Incremental review on 49eb13d in 56 seconds

More details
  • Looked at 253 lines of code in 7 files
  • Skipped 0 files when reviewing.
  • Skipped posting 0 drafted comments based on config settings.

Workflow ID: wflow_Cbrrwf0JLeY9TbHh


Want Ellipsis to fix these issues? Tag @ellipsis-dev in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

arguments
}

:returning
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The :returning clause in the query string is not followed by any specific fields, which could lead to unexpected behavior or errors. Please specify the fields that should be returned after the :returning clause.

Suggested change
:returning
:returning [task_id, execution_id, session_id, status, arguments]

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❌ Changes requested. Incremental review on d76768e in 1 minute and 2 seconds

More details
  • Looked at 79 lines of code in 2 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. agents-api/agents_api/routers/tasks/routers.py:49
  • Draft comment:
    The TODO comment suggests adding :limit 1 to all get queries, but this has not been consistently applied across all relevant queries. Ensure that :limit 1 is added to other get queries like get_execution_query and get_execution_transition_query to maintain consistency and prevent potential bugs.
  • Reason this comment was not posted:
    Confidence of 0% on close inspection, compared to threshold of 50%.

Workflow ID: wflow_MBYfmAHazdpaCLZd


Want Ellipsis to fix these issues? Tag @ellipsis-dev in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

},
updated_at = to_int(updated_at_ms) / 1000,
id = to_uuid($task_id),
:limit 1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The :limit 1 clause is incorrectly placed inside the query block. It should be outside the closing bracket to limit the results of the entire query.

x_developer_id: Annotated[UUID4, Depends(get_developer_id)],
) -> ResourceCreatedResponse:
# TODO: Do thorough validation of the input against task input schema
# DO NOT let the user specify the status
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The function allows the user to specify the execution status, which contradicts the intended behavior as per the TODO comment. The status should be set internally to maintain control over the execution flow.

Suggested change
# DO NOT let the user specify the status
status='pending',

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❌ Changes requested. Incremental review on b615e08 in 50 seconds

More details
  • Looked at 172 lines of code in 4 files
  • Skipped 0 files when reviewing.
  • Skipped posting 0 drafted comments based on config settings.

Workflow ID: wflow_yxfW4Jb56voS0Hf8


Want Ellipsis to fix these issues? Tag @ellipsis-dev in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

x_developer_id: Annotated[UUID4, Depends(get_developer_id)],
) -> ResourceCreatedResponse:
# TODO: Do thorough validation of the input against task input schema
resp = create_execution_query(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The status for a new execution should be set to 'pending' by default and not be influenced by user input as per the PR description. This ensures consistency and prevents misuse.

Suggested change
resp = create_execution_query(
status='pending',

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❌ Changes requested. Incremental review on 0a20b95 in 1 minute and 10 seconds

More details
  • Looked at 736 lines of code in 7 files
  • Skipped 0 files when reviewing.
  • Skipped posting 0 drafted comments based on config settings.

Workflow ID: wflow_TPdzLVLkpipRyNj8


Want Ellipsis to fix these issues? Tag @ellipsis-dev in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

task_id: UUID,
execution_id: UUID,
session_id: UUID | None = None,
status: Literal[
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new execution status pending introduced here is not reflected in the OpenAPI schema (openapi.yaml). This can lead to inconsistencies and should be updated in the OpenAPI documentation to include pending as a valid status.

Suggested change
status: Literal[
- pending

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❌ Changes requested. Incremental review on aac036a in 58 seconds

More details
  • Looked at 99 lines of code in 2 files
  • Skipped 0 files when reviewing.
  • Skipped posting 0 drafted comments based on config settings.

Workflow ID: wflow_WUA7hlJvgAiMPjn8


Want Ellipsis to fix these issues? Tag @ellipsis-dev in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.


await client.execute_workflow(
"TaskExecutionWorkflow",
args=[execution_input, start, previous_inputs],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ensure that ExecutionInput is JSON-serializable or convert it to a JSON-serializable format before passing it to execute_workflow. This is crucial to prevent runtime serialization errors.

Suggested change
args=[execution_input, start, previous_inputs],
args=[execution_input.json(), start, previous_inputs],


# TODO: how to get previous_inputs?
# TODO: how to get `start` tuple
background_task.add_task(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The variables start and previous_inputs are used but not defined or initialized in this scope. Define these variables before using them, or modify the function signature to include these as parameters if they are supposed to be passed into the function.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❌ Changes requested. Incremental review on fc44946 in 53 seconds

More details
  • Looked at 116 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 0 drafted comments based on config settings.

Workflow ID: wflow_IyLYmwwMQi0oMV3c


Want Ellipsis to fix these issues? Tag @ellipsis-dev in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

).iterrows()
][0]

validate(request.arguments, task["input_schema"])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider adding a check to ensure task['input_schema'] is not None before attempting to validate the request arguments. If the input schema is missing, you should return an appropriate error response.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Looks good to me! Incremental review on 6276f74 in 1 minute and 16 seconds

More details
  • Looked at 45 lines of code in 2 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. agents-api/agents_api/autogen/openapi_model.py:891
  • Draft comment:
    The removal of the status field from the CreateExecution model could lead to issues with tracking and updating the status of executions, which is critical for managing the state and workflow of tasks. Please ensure there is a mechanism in place to handle the statuses of executions appropriately.
  • Reason this comment was not posted:
    Confidence of 0% on close inspection, compared to threshold of 50%.

Workflow ID: wflow_LW7PAM7Vxrj7HY0H


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

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.

None yet

3 participants