-
Notifications
You must be signed in to change notification settings - Fork 900
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 tests #995
Fix tests #995
Conversation
️✅ There are no secrets present in this pull request anymore.If these secrets were true positive and are still valid, we highly recommend you to revoke them. 🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request. |
CI Failure Feedback 🧐(Checks updated until commit 2f90cb3)
✨ CI feedback usage guide:The CI feedback tool (
In addition to being automatically triggered, the tool can also be invoked manually by commenting on a PR:
where Configuration options
See more information about the |
cfa1bef
to
9ef620f
Compare
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 3a44a80 in 1 minute and 26 seconds
More details
- Looked at
3690
lines of code in18
files - Skipped
0
files when reviewing. - Skipped posting
7
drafted comments based on config settings.
1. .github/workflows/lint-agents-api-pr.yml:27
- Draft comment:
The installation of Go migrate is added, but it is not used in this workflow. Consider removing it if it's not needed. - Reason this comment was not posted:
Confidence changes required:50%
The PR adds installation of Go migrate in multiple workflow files. However, the installation is not used anywhere in the workflows. This might be unnecessary unless there's a future plan to use it.
2. .github/workflows/test-agents-api-pr.yml:27
- Draft comment:
The installation of Go migrate is added, but it is not used in this workflow. Consider removing it if it's not needed. - Reason this comment was not posted:
Confidence changes required:50%
The PR adds installation of Go migrate in multiple workflow files. However, the installation is not used anywhere in the workflows. This might be unnecessary unless there's a future plan to use it.
3. .github/workflows/typecheck-agents-api-pr.yml:35
- Draft comment:
The installation of Go migrate is added, but it is not used in this workflow. Consider removing it if it's not needed. - Reason this comment was not posted:
Confidence changes required:50%
The PR adds installation of Go migrate in multiple workflow files. However, the installation is not used anywhere in the workflows. This might be unnecessary unless there's a future plan to use it.
4. agents-api/agents_api/common/protocol/tasks.py:313
- Draft comment:
The use ofor []
is a good change to handle cases wheretools
might beNone
. This makes the code cleaner and more readable. - Reason this comment was not posted:
Confidence changes required:0%
The code inspec_to_task_data
function has been simplified by usingor []
to handle the case wheretools
might beNone
. This is a good change as it makes the code cleaner and more readable.
5. agents-api/agents_api/queries/chat/gather_messages.py:38
- Draft comment:
The addition ofconnection_pool
parameter is a good change for better resource management and performance. - Reason this comment was not posted:
Confidence changes required:0%
Theconnection_pool
parameter is added to multiple function calls. This is a good change as it allows for better resource management and potentially improved performance by reusing connections.
6. agents-api/agents_api/queries/sessions/create_session.py:141
- Draft comment:
The addition ofconnection_pool
parameter is a good change for better resource management and performance. - Reason this comment was not posted:
Confidence changes required:0%
Theconnection_pool
parameter is added to multiple function calls. This is a good change as it allows for better resource management and potentially improved performance by reusing connections.
7. agents-api/agents_api/routers/sessions/chat.py:221
- Draft comment:
The removal ofmark_session_as_updated
parameter might be intentional if it's no longer needed. Ensure that session updates are handled appropriately elsewhere if required. - Reason this comment was not posted:
Confidence changes required:33%
Themark_session_as_updated
parameter is removed from thecreate_entries
function call. This might be intentional if the parameter is no longer needed or handled differently.
Workflow ID: wflow_WkZ2wFOcgmdSF9cs
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
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! Incremental review on 273357d in 33 seconds
More details
- Looked at
92
lines of code in1
files - Skipped
0
files when reviewing. - Skipped posting
1
drafted comments based on config settings.
1. agents-api/tests/test_docs_routes.py:17
- Draft comment:
The@skip
decorator is used extensively in this file, which means many tests are being skipped. Ensure this is intentional and that important tests are not being unintentionally skipped. Consider adding comments to explain why each test is skipped. - Reason this comment was not posted:
Confidence changes required:50%
The use of the@skip
decorator is prevalent throughout the test file, indicating that many tests are being skipped. This could be intentional for tests that are not ready or are known to fail, but it should be documented or reviewed to ensure that important tests are not being unintentionally skipped.
Workflow ID: wflow_oUazTT0gsXPe6oix
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
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! Incremental review on c7a085a in 47 seconds
More details
- Looked at
243
lines of code in2
files - Skipped
0
files when reviewing. - Skipped posting
7
drafted comments based on config settings.
1. agents-api/tests/test_execution_workflow.py:110
- Draft comment:
Missing 'await' keyword before 'create_task'. - Reason this comment was not posted:
Comment was not on a valid diff hunk.
2. agents-api/tests/test_execution_workflow.py:153
- Draft comment:
Missing 'await' keyword before 'create_task'. - Reason this comment was not posted:
Marked as duplicate.
3. agents-api/tests/test_execution_workflow.py:203
- Draft comment:
Missing 'await' keyword before 'create_task'. - Reason this comment was not posted:
Marked as duplicate.
4. agents-api/tests/test_execution_workflow.py:251
- Draft comment:
Missing 'await' keyword before 'create_task'. - Reason this comment was not posted:
Marked as duplicate.
5. agents-api/tests/test_execution_workflow.py:293
- Draft comment:
Missing 'await' keyword before 'create_task'. - Reason this comment was not posted:
Marked as duplicate.
6. agents-api/tests/test_execution_workflow.py:342
- Draft comment:
Missing 'await' keyword before 'create_task'. - Reason this comment was not posted:
Marked as duplicate.
7. agents-api/tests/test_execution_workflow.py:390
- Draft comment:
Missing 'await' keyword before 'create_task'. - Reason this comment was not posted:
Marked as duplicate.
Workflow ID: wflow_TWtheifsTAjLadDo
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
c7a085a
to
fece441
Compare
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! Incremental review on fece441 in 35 seconds
More details
- Looked at
243
lines of code in2
files - Skipped
0
files when reviewing. - Skipped posting
2
drafted comments based on config settings.
1. agents-api/tests/test_docs_routes.py:177
- Draft comment:
Consider usingawait asyncio.sleep(0.5)
instead oftime.sleep(0.5)
to avoid blocking the event loop in an async function. - Reason this comment was not posted:
Comment was on unchanged code.
2. agents-api/tests/test_docs_routes.py:224
- Draft comment:
Consider usingawait asyncio.sleep(0.5)
instead oftime.sleep(0.5)
to avoid blocking the event loop in an async function. - Reason this comment was not posted:
Marked as duplicate.
Workflow ID: wflow_5sPtL8PXfyZHDMg2
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
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! Incremental review on ea37837 in 38 seconds
More details
- Looked at
99
lines of code in3
files - Skipped
0
files when reviewing. - Skipped posting
5
drafted comments based on config settings.
1. agents-api/agents_api/routers/docs/search_docs.py:31
- Draft comment:
The change fromawait search_docs_by_text
tosearch_docs_by_text
is correct here sincesearch_docs_by_text
is not awaited in this context. Ensure that the function is correctly awaited where it is called. - Reason this comment was not posted:
Confidence changes required:20%
The change from 'await search_docs_by_text' to 'search_docs_by_text' in the search_docs.py file is correct because the function is not awaited in the context it is used. However, the call to 'search_fn' in 'search_user_docs' and 'search_agent_docs' should be awaited as it is an async function.
2. agents-api/agents_api/routers/docs/search_docs.py:47
- Draft comment:
The change fromawait search_docs_by_embedding
tosearch_docs_by_embedding
is correct here sincesearch_docs_by_embedding
is not awaited in this context. Ensure that the function is correctly awaited where it is called. - Reason this comment was not posted:
Confidence changes required:20%
The change from 'await search_docs_by_embedding' to 'search_docs_by_embedding' in the search_docs.py file is correct because the function is not awaited in the context it is used. However, the call to 'search_fn' in 'search_user_docs' and 'search_agent_docs' should be awaited as it is an async function.
3. agents-api/agents_api/routers/docs/search_docs.py:63
- Draft comment:
The change fromawait search_docs_hybrid
tosearch_docs_hybrid
is correct here sincesearch_docs_hybrid
is not awaited in this context. Ensure that the function is correctly awaited where it is called. - Reason this comment was not posted:
Confidence changes required:20%
The change from 'await search_docs_hybrid' to 'search_docs_hybrid' in the search_docs.py file is correct because the function is not awaited in the context it is used. However, the call to 'search_fn' in 'search_user_docs' and 'search_agent_docs' should be awaited as it is an async function.
4. agents-api/agents_api/routers/docs/search_docs.py:100
- Draft comment:
The call tosearch_fn
should be awaited here as it is an async function. This ensures proper execution and handling of asynchronous operations. - Reason this comment was not posted:
Comment looked like it was already resolved.
5. agents-api/agents_api/routers/docs/search_docs.py:151
- Draft comment:
The call tosearch_fn
should be awaited here as it is an async function. This ensures proper execution and handling of asynchronous operations. - Reason this comment was not posted:
Marked as duplicate.
Workflow ID: wflow_x0E7DINeyw9GLyR6
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
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! Incremental review on f13ab99 in 27 seconds
More details
- Looked at
24
lines of code in1
files - Skipped
0
files when reviewing. - Skipped posting
0
drafted comments based on config settings.
Workflow ID: wflow_Vjlm0XJsBIGLKKp5
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
Signed-off-by: Diwank Singh Tomer <[email protected]>
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! Incremental review on 505a25d in 39 seconds
More details
- Looked at
739
lines of code in18
files - Skipped
0
files when reviewing. - Skipped posting
1
drafted comments based on config settings.
1. agents-api/agents_api/activities/task_steps/base_evaluate.py:13
- Draft comment:
Remove the unused importtesting
from...env
. - Reason this comment was not posted:
Confidence changes required:50%
The code inagents-api/agents_api/activities/task_steps/base_evaluate.py
has a redundant import oftesting
from...env
which is not used anywhere in the file. Removing unused imports is a good practice to keep the code clean and efficient.
Workflow ID: wflow_Y89x55cCu7YPLlIb
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
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! Incremental review on 30b2a92 in 4 minutes and 21 seconds
More details
- Looked at
13146
lines of code in188
files - Skipped
0
files when reviewing. - Skipped posting
3
drafted comments based on config settings.
1. ruff.toml:54
- Draft comment:
Consider adding the**/autogen/*.py
pattern to theexclude
list to avoid linting generated files. - Reason this comment was not posted:
Confidence changes required:50%
The ruff.toml file is well-structured, but there are a few minor improvements that can be made for clarity and consistency.
2. ruff.toml:57
- Draft comment:
Consider enabling the additional categories (C09, S, B, ARG, PTH, ERA, PLW, FURB) in theselect
list to cover more linting rules. - Reason this comment was not posted:
Confidence changes required:50%
The ruff.toml file is well-structured, but there are a few minor improvements that can be made for clarity and consistency.
3. ruff.toml:65
- Draft comment:
Ensure that the ignored rules (COM812, ISC001) are indeed conflicting and necessary to ignore, as ignoring them might overlook potential issues. - Reason this comment was not posted:
Confidence changes required:50%
The ruff.toml file is well-structured, but there are a few minor improvements that can be made for clarity and consistency.
Workflow ID: wflow_c44kZ90pnn5aqcHC
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
30b2a92
to
2f90cb3
Compare
Signed-off-by: Diwank Singh Tomer <[email protected]>
2f90cb3
to
2a186ba
Compare
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! Incremental review on 2f90cb3 in 4 minutes and 18 seconds
More details
- Looked at
14819
lines of code in229
files - Skipped
0
files when reviewing. - Skipped posting
4
drafted comments based on config settings.
1. integrations-service/integrations/utils/integrations/ffmpeg.py:140
- Draft comment:
Initializetemp_dir
toNone
before the try block to avoid potential issues if an exception occurs beforetemp_dir
is defined.
temp_dir = None
- Reason this comment was not posted:
Confidence changes required:50%
Thebash_cmd
function inffmpeg.py
has a potential issue with thetemp_dir
variable. If an exception occurs beforetemp_dir
is defined, the cleanup code will raise an additional exception. This can be avoided by initializingtemp_dir
toNone
and checking if it is notNone
before attempting to remove it.
2. integrations-service/integrations/routers/integrations/get_integrations.py:6
- Draft comment:
Specify the types of keys and values in the dictionary for better clarity and type checking.
async def get_integrations() -> list[dict[str, Any]]:
- Reason this comment was not posted:
Confidence changes required:30%
Inget_integrations.py
, the functionget_integrations
is returning a list of dictionaries. However, the return type hint islist[dict]
, which is not specific. It would be better to specify the types of keys and values in the dictionary for better clarity and type checking.
3. integrations-service/integrations/autogen/Sessions.py:34
- Draft comment:
Consider extracting the long default string forsystem_template
into a constant or a separate function to improve readability and maintainability. - Reason this comment was not posted:
Confidence changes required:30%
InSessions.py
, thesystem_template
field has a very long default string value. This could be extracted into a constant or a separate function to improve readability and maintainability.
4. ruff.toml:30
- Draft comment:
Ensure that enablingfix
andunsafe-fixes
is intentional and that the team is aware of the potential risks of unexpected changes. - Reason this comment was not posted:
Confidence changes required:20%
Inruff.toml
, thefix
andunsafe-fixes
options are set to true. While this can be useful, it might lead to unexpected changes. It's important to ensure that these settings are intentional and that the team is aware of the potential risks.
Workflow ID: wflow_3iEli6AZFOTnzi8y
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
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! Incremental review on 2a186ba in 4 minutes and 55 seconds
More details
- Looked at
14819
lines of code in229
files - Skipped
0
files when reviewing. - Skipped posting
1
drafted comments based on config settings.
1. integrations-service/integrations/utils/integrations/remote_browser.py:369
- Draft comment:
Consider raising a more specific exception type instead of a genericException
to provide more context about the error. - Reason this comment was not posted:
Confidence changes required:50%
Inintegrations-service/integrations/utils/integrations/remote_browser.py
, theperform_action
function has a try-except block that raises a genericException
with a message. It would be better to raise a more specific exception type if possible.
Workflow ID: wflow_e3v7VS1B9op2Z4lv
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
PR Type
Tests, Bug fix
Description
Bug fixes and test improvements:
Changes walkthrough 📝
tasks.py
Fix tools handling in task data conversion
agents-api/agents_api/common/protocol/tasks.py
prepare_chat_context.py
Improve chat context preparation with timestamps and null checks
agents-api/agents_api/queries/chat/prepare_chat_context.py
gather_messages.py
Add connection pool support to chat messages gathering
agents-api/agents_api/queries/chat/gather_messages.py
test_chat_routes.py
Restore and update chat route tests
agents-api/tests/test_chat_routes.py
test_execution_workflow.py
Update execution workflow tests with connection pool
agents-api/tests/test_execution_workflow.py
Important
Enhance test handling, database connection management, and CI workflows with connection pool support, improved error handling, and updated tests.
tasks.py
to handle empty lists and null values.gather_messages.py
andprepare_chat_context.py
for better database management.prepare_chat_context.py
.test_chat_routes.py
andtest_execution_workflow.py
to work with connection pool.test_execution_workflow.py
.lint-agents-api-pr.yml
,test-agents-api-pr.yml
,typecheck-agents-api-pr.yml
) to include Go migrate installation.ruff.toml
for linting and formatting settings.This description was created by for 2a186ba. It will automatically update as commits are pushed.