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

fix: Ensure safe assignment to tool_blocks_map in agent_message handling #5239

Merged
merged 1 commit into from
Dec 12, 2024

Conversation

ogabrielluiz
Copy link
Contributor

This PR adds a safety check to ensure that the assignment to tool_blocks_map is only performed when agent_message.content_blocks and its contents are available. This prevents potential errors when accessing these properties.

@dosubot dosubot bot added size:XS This PR changes 0-9 lines, ignoring generated files. bug Something isn't working labels Dec 12, 2024
@github-actions github-actions bot added bug Something isn't working and removed bug Something isn't working labels Dec 12, 2024
Copy link
Member

@Cristhianzl Cristhianzl left a comment

Choose a reason for hiding this comment

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

lgtm

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Dec 12, 2024
@Cristhianzl Cristhianzl enabled auto-merge (squash) December 12, 2024 20:41
@Cristhianzl Cristhianzl merged commit 222f15d into main Dec 12, 2024
34 of 36 checks passed
@Cristhianzl Cristhianzl deleted the guard-clause-contents branch December 12, 2024 20:45
Copy link

codspeed-hq bot commented Dec 12, 2024

CodSpeed Performance Report

Merging #5239 will improve performances by 85.76%

Comparing guard-clause-contents (81e16f2) with main (c6b1eab)

Summary

⚡ 5 improvements
✅ 10 untouched benchmarks

Benchmarks breakdown

Benchmark main guard-clause-contents Change
test_get_and_cache_all_types_dict 1,097 µs 948.5 µs +15.66%
test_load_flows 2 ms 1.1 ms +85.76%
test_setup_llm_caching 2 ms 1.2 ms +70.48%
test_successful_run_with_input_type_any 254.5 ms 209.4 ms +21.5%
test_successful_run_with_output_type_any 242.2 ms 200.6 ms +20.71%

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working lgtm This PR has been approved by a maintainer size:XS This PR changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants