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 file operations logger #3489

Merged
merged 10 commits into from
May 1, 2023

Conversation

bobisme
Copy link
Contributor

@bobisme bobisme commented Apr 28, 2023

Background

When trying to get Auto-GPT to write and improve on a script, the existing behavior which prevents writing to the same file more than once got in the way.

Changes

  • Duplication checks now constructs a file store state using a checksum for matching.
  • Writes with different checksums will succeed, but will fail with the same checksum.
  • Added tests, minor refactoring.

Documentation

Docstrings, tests, concise code.

Test Plan

Unit tests and told Auto-GPT to:

  1. write a hello world program
  2. write tests for the program
  • it wrote a hello world that prints to console
  • it wrote tests that tried to import a hello world object that didn't exist
  • it successfully updated the script to have an importable function
  • it tried to write the exact same test code as before, but was blocked

This shows both cases of updated text and non-updated text.

PR Quality Checklist

  • My pull request is atomic and focuses on a single change.
  • I have thoroughly tested my changes with multiple different prompts.
  • I have considered potential risks and mitigations for my changes.
  • I have documented my changes clearly and comprehensively.
  • I have not snuck in any "extra" small tweaks changes

@vercel
Copy link

vercel bot commented Apr 28, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
docs ⬜️ Ignored (Inspect) Visit Preview May 1, 2023 3:32pm

@github-actions
Copy link
Contributor

This PR exceeds the recommended size of 200 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size

@collijk collijk added needs discussion To be discussed among maintainers function: process text labels Apr 28, 2023
@bobisme
Copy link
Contributor Author

bobisme commented Apr 28, 2023

the size of this is mostly due to docstrings and unit tests

@Pwuts Pwuts added function: workspace and removed needs discussion To be discussed among maintainers labels Apr 29, 2023
tests/unit/test_file_operations.py Outdated Show resolved Hide resolved
autogpt/commands/file_operations.py Outdated Show resolved Hide resolved
autogpt/commands/file_operations.py Outdated Show resolved Hide resolved
autogpt/commands/file_operations.py Outdated Show resolved Hide resolved
@Pwuts Pwuts added this to the v0.3.0 release milestone Apr 29, 2023
@Pwuts Pwuts changed the title File log uses constructed state and checksums. Fix file operations logger Apr 29, 2023
@Pwuts Pwuts linked an issue Apr 29, 2023 that may be closed by this pull request
1 task
@github-actions
Copy link
Contributor

This PR exceeds the recommended size of 200 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size

@github-actions github-actions bot added the conflicts Automatically applied to PRs with merge conflicts label Apr 29, 2023
@github-actions
Copy link
Contributor

This pull request has conflicts with the base branch, please resolve those so we can evaluate the pull request.

Co-authored-by: Reinier van der Leer <github@pwuts.nl>
@github-actions
Copy link
Contributor

This PR exceeds the recommended size of 200 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size

@github-actions
Copy link
Contributor

This PR exceeds the recommended size of 200 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size

Copy link
Contributor Author

@bobisme bobisme left a comment

Choose a reason for hiding this comment

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

changed as requested, please take another look @Pwuts

autogpt/commands/file_operations.py Outdated Show resolved Hide resolved
autogpt/commands/file_operations.py Outdated Show resolved Hide resolved
@github-actions github-actions bot removed the conflicts Automatically applied to PRs with merge conflicts label Apr 29, 2023
@github-actions
Copy link
Contributor

Conflicts have been resolved! 🎉 A maintainer will review the pull request shortly.

@github-actions github-actions bot added the conflicts Automatically applied to PRs with merge conflicts label Apr 30, 2023
@github-actions
Copy link
Contributor

This pull request has conflicts with the base branch, please resolve those so we can evaluate the pull request.

autogpt/commands/file_operations.py Outdated Show resolved Hide resolved
autogpt/commands/file_operations.py Outdated Show resolved Hide resolved
@github-actions
Copy link
Contributor

github-actions bot commented May 1, 2023

This PR exceeds the recommended size of 200 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size

@vercel vercel bot temporarily deployed to Preview May 1, 2023 13:22 Inactive
@github-actions
Copy link
Contributor

github-actions bot commented May 1, 2023

This PR exceeds the recommended size of 200 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size

@github-actions
Copy link
Contributor

github-actions bot commented May 1, 2023

Conflicts have been resolved! 🎉 A maintainer will review the pull request shortly.

@github-actions github-actions bot removed the conflicts Automatically applied to PRs with merge conflicts label May 1, 2023
@github-actions
Copy link
Contributor

github-actions bot commented May 1, 2023

This PR exceeds the recommended size of 200 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size

@Pwuts Pwuts force-pushed the state-machine-file-ops branch from 2f986d2 to 6783375 Compare May 1, 2023 15:32
@github-actions
Copy link
Contributor

github-actions bot commented May 1, 2023

This PR exceeds the recommended size of 200 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size

@codecov
Copy link

codecov bot commented May 1, 2023

Codecov Report

Patch coverage: 80.88% and project coverage change: +0.26 🎉

Comparison is base (9c56b1b) 59.99% compared to head (7fdefe6) 60.26%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3489      +/-   ##
==========================================
+ Coverage   59.99%   60.26%   +0.26%     
==========================================
  Files          69       69              
  Lines        3102     3143      +41     
  Branches      513      525      +12     
==========================================
+ Hits         1861     1894      +33     
- Misses       1110     1116       +6     
- Partials      131      133       +2     
Impacted Files Coverage Δ
autogpt/commands/file_operations.py 82.94% <80.88%> (-0.78%) ⬇️

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@Pwuts Pwuts self-requested a review May 1, 2023 15:33
@Pwuts Pwuts merged commit 94ec4a4 into Significant-Gravitas:master May 1, 2023
@bobisme bobisme deleted the state-machine-file-ops branch May 1, 2023 18:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

File Operations logger breaks incremental edits
4 participants