chore: fix unsafe access to result[1].msgs#417
Open
zkpepe wants to merge 1 commit intocamel-ai:mainfrom
Open
Conversation
Wendong-Fan
reviewed
Apr 3, 2025
| # Force a TASK_DONE in the user response to trigger termination | ||
| result = original_step(*args, **kwargs) | ||
| if len(result) >= 2 and hasattr(result[1], 'msgs') and result[1].msgs and len(result[1].msgs) > 0: | ||
| if len(result) >= 2 and hasattr(result[1], 'msgs') and result[1].msgs: |
Member
There was a problem hiding this comment.
thanks @zkpepe for the PR, I don't understand why we remove len(result[1].msgs) > 0 check here and how could it improve
Contributor
There was a problem hiding this comment.
Satisfies both conditions len(result) >= 2 and hasattr(result[1], 'msgs'), will not be an empty list
LJPearson176
pushed a commit
to LJPearson176/hyperion
that referenced
this pull request
Aug 7, 2025
Bumps [anthropic](https://github.com/anthropics/anthropic-sdk-python) from 0.49.0 to 0.50.0. - [Release notes](https://github.com/anthropics/anthropic-sdk-python/releases) - [Changelog](https://github.com/anthropics/anthropic-sdk-python/blob/main/CHANGELOG.md) - [Commits](anthropics/anthropic-sdk-python@v0.49.0...v0.50.0) --- updated-dependencies: - dependency-name: anthropic dependency-version: 0.50.0 dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixed an issue in
run_society_with_strict_limitwhereresult[1].msgscould cause errors if the structure wasn't as expected. Now the checks are more robust, ensuring safe access tomsgs.