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

add cost info to the workflow run repsonse #1456

Merged
merged 4 commits into from
Dec 31, 2024

Conversation

wintonzheng
Copy link
Contributor

@wintonzheng wintonzheng commented Dec 31, 2024

Important

Add cost information to workflow run responses by updating models, services, and routes to calculate and include total steps and cost.

  • Behavior:
    • Adds total_steps and total_cost to WorkflowRunStatusResponse in workflow.py.
    • Updates build_workflow_run_status_response and build_workflow_run_status_response_by_workflow_id in service.py to calculate and include cost information.
    • Modifies get_workflow_run in agent_protocol.py to include cost information in the response.
  • Database:
    • Adds get_steps_by_task_ids method in client.py to retrieve steps for multiple task IDs.
  • Misc:
    • Fixes typo in service.py by changing includ_cost to include_cost.

This description was created by Ellipsis for e94e02d. It will automatically update as commits are pushed.

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. Reviewed everything up to ff2fd41 in 1 minute and 39 seconds

More details
  • Looked at 114 lines of code in 4 files
  • Skipped 0 files when reviewing.
  • Skipped posting 3 drafted comments based on config settings.
1. skyvern/forge/sdk/workflow/service.py:755
  • Draft comment:
    Typo in parameter name 'includ_cost'. It should be 'include_cost'. This typo is present in multiple places in the code.
  • Reason this comment was not posted:
    Marked as duplicate.
2. skyvern/forge/sdk/workflow/service.py:763
  • Draft comment:
    Typo in parameter name 'includ_cost'. It should be 'include_cost'. This typo is present in multiple places in the code.
  • Reason this comment was not posted:
    Marked as duplicate.
3. skyvern/forge/sdk/workflow/service.py:832
  • Draft comment:
    Typo in parameter name 'includ_cost'. It should be 'include_cost'. This typo is present in multiple places in the code.
  • Reason this comment was not posted:
    Marked as duplicate.

Workflow ID: wflow_4RMOQJ8FPvSj2hQn


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.

@@ -741,6 741,7 @@ async def build_workflow_run_status_response_by_workflow_id(
self,
workflow_run_id: str,
organization_id: str,
includ_cost: bool = False,
Copy link
Contributor

Choose a reason for hiding this comment

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

Typo in parameter name 'includ_cost'. It should be 'include_cost'. This typo is present in multiple places in the code.

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 bd0f722 in 31 seconds

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

Workflow ID: wflow_IX8DKbHGBMcZ9JhP


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

@wintonzheng wintonzheng force-pushed the shu/add_cost_info_to_workflow_run branch from bd0f722 to b5cd44e Compare December 31, 2024 10:56
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 19554d9 in 16 seconds

More details
  • Looked at 40 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. skyvern/forge/sdk/workflow/service.py:744
  • Draft comment:
    Typo fix: Corrected 'includ_cost' to 'include_cost'. Ensure this change is consistent across all relevant files and tests.
  • Reason this comment was not posted:
    Confidence changes required: 10%
    The typo fix from 'includ_cost' to 'include_cost' is correct and consistent throughout the file.

Workflow ID: wflow_80SqBlEnYYAZMg9r


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 04c5d93 in 16 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. skyvern/forge/sdk/workflow/service.py:839
  • Draft comment:
    Ensure that StepStatus.completed is the correct status for successful steps in cost calculation. Verify that this aligns with the intended logic for determining successful steps.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The change from StepStatus.success to StepStatus.completed is consistent with the PR description. However, it's important to ensure that StepStatus.completed is the correct status to check for successful steps in the context of cost calculation.

Workflow ID: wflow_bgEfcb8aVaCOOQvL


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

@wintonzheng wintonzheng force-pushed the shu/add_cost_info_to_workflow_run branch from 04c5d93 to e94e02d Compare December 31, 2024 18:45
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 e94e02d in 21 seconds

More details
  • Looked at 15 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. skyvern/forge/sdk/workflow/service.py:839
  • Draft comment:
    Ensure that the status check for StepStatus.completed is consistent across the codebase where similar logic is applied. This change affects the calculation of successful_steps and subsequently the total_cost.
  • Reason this comment was not posted:
    Comment did not seem useful.

Workflow ID: wflow_t7FQkBz2f4pQ3Kqe


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

@wintonzheng wintonzheng merged commit 171aef6 into main Dec 31, 2024
2 checks passed
@wintonzheng wintonzheng deleted the shu/add_cost_info_to_workflow_run branch December 31, 2024 19:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant