-
Notifications
You must be signed in to change notification settings - Fork 889
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
fix(agents-api): fix unwrap in prompt step #1093
Conversation
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
There was a problem hiding this 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 c0e6c66 in 35 seconds
More details
- Looked at
37
lines of code in2
files - Skipped
0
files when reviewing. - Skipped posting
1
drafted comments based on config settings.
1. agents-api/tests/test_task_execution_workflow.py:510
- Draft comment:
Themessage
should be a dictionary with a 'choices' key, not a string. This is inconsistent with the expected structure in_handle_PromptStep
. - Reason this comment was not posted:
Decided after close inspection that this draft comment was likely wrong and/or not actionable:
The test case is specifically testing the unwrap=True scenario of a prompt step. Looking at the test case, it's verifying that when unwrap is True, the raw message is passed through without any special handling. The test passes with the string message, suggesting that this is actually the intended behavior. The comment seems to be making assumptions about required message structure that don't apply in this unwrap=True case.
I could be wrong about the intended behavior of unwrap=True. Maybe there are requirements about message structure that are documented elsewhere or enforced in the actual implementation.
The test clearly shows that with unwrap=True, the message is passed through directly in the assertion on line 518. If there were requirements about message structure, the test would fail. The fact that this test passes suggests this is working as intended.
The comment should be deleted. The test is specifically for the unwrap=True case where the raw message is passed through, and the string message is valid in this context.
Workflow ID: wflow_2UobB6IFpM0EQY9e
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
CI Feedback 🧐(Feedback updated until commit c0e6c66)A test triggered by this PR failed. Here is an AI-generated analysis of the failure:
|
PR Type
Bug fix, Tests
Description
Fixed logic in
_handle_PromptStep
to handleunwrap
andauto_run_tools
conditions.Updated test case to reflect changes in
_handle_PromptStep
.Improved code readability by refactoring conditional logic.
Changes walkthrough 📝
__init__.py
Refactor `_handle_PromptStep` logic for clarity
agents-api/agents_api/workflows/task_execution/init.py
_handle_PromptStep
.choice
assignment after conditional block.unwrap
andauto_run_tools
checks.test_task_execution_workflow.py
Update test case for `_handle_PromptStep` changes
agents-api/tests/test_task_execution_workflow.py
_handle_PromptStep
changes.Important
Fix condition in
_handle_PromptStep
to correctly handle early return cases and update corresponding test._handle_PromptStep
in__init__.py
to return early withPartialTransition
ifstep.unwrap
is true,step.auto_run_tools
is false, orfinish_reason
is nottool_calls
.test_task_execution_workflow.py
to use a string formessage
instead of a dictionary, aligning with the new logic in_handle_PromptStep
.This description was created by for c0e6c66. It will automatically update as commits are pushed.