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(agent): Fix check when loading an existing agent #7026

Conversation

kcze
Copy link
Contributor

@kcze kcze commented Mar 18, 2024

OPEN-185
Now the check also ensures the chosen agent number is within proper range.

Copy link

netlify bot commented Mar 18, 2024

Deploy Preview for auto-gpt-docs canceled.

Name Link
🔨 Latest commit d3ae403
🔍 Latest deploy log https://app.netlify.com/sites/auto-gpt-docs/deploys/65fd894b59e2040009ea504a

@kcze kcze changed the title fix(autogpt/cli): Fix check when loading an existing agent fix(agent): Fix check when loading an existing agent Mar 22, 2024
Copy link

codecov bot commented Mar 22, 2024

Codecov Report

Attention: Patch coverage is 0% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 45.51%. Comparing base (30bc761) to head (d3ae403).

Files Patch % Lines
autogpts/autogpt/autogpt/app/main.py 0.00% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master    #7026   +/-   ##
=======================================
  Coverage   45.51%   45.51%           
=======================================
  Files         139      139           
  Lines        6530     6530           
  Branches      917      917           
=======================================
  Hits         2972     2972           
  Misses       3408     3408           
  Partials      150      150           
Flag Coverage Δ
Linux 45.40% <0.00%> (ø)
Windows 43.64% <0.00%> (ø)
autogpt-agent 45.48% <0.00%> (ø)
macOS 44.85% <0.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Comment on lines +188 to +190
if re.match(r"^\d+$", load_existing_agent.strip()) and 0 < int(
load_existing_agent
) <= len(existing_agents):
Copy link
Member

Choose a reason for hiding this comment

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

Cool! I didn't know Python could do x < y < z comparisons :)

@Pwuts Pwuts merged commit 262771a into Significant-Gravitas:master Mar 22, 2024
17 of 19 checks passed
@kcze kcze deleted the kpczerwinski/open-185-indexerror-list-index-out-of-range branch March 22, 2024 17:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants