-
-
Notifications
You must be signed in to change notification settings - Fork 225
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
refactor: work on programmatic interface, self-reviewing agent #199
Conversation
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.
❌ Changes requested. Reviewed everything up to 36d1b7f in 1 minute and 29 seconds
More details
- Looked at
857
lines of code in9
files - Skipped
0
files when reviewing. - Skipped posting
3
drafted comments based on config settings.
1. gptme/logmanager.py:6
- Draft comment:
Ensure that thereplace
method is imported fromdataclasses
to avoid potential NameError issues.
from dataclasses import dataclass, field, replace
- Reason this comment was not posted:
Comment did not seem useful.
2. gptme/server/api.py:113
- Draft comment:
Ensuremanager.log
is not empty before accessingmanager.log.messages
to prevent potential AttributeError.
if manager.log:
msgs = prepare_messages(manager.log.messages)
else:
msgs = []
- Reason this comment was not posted:
Comment did not seem useful.
3. scripts/treeofthoughts.py:23
- Draft comment:
Ensure that_step
always yields validMessage
objects to prevent runtime errors when appending tolog
. - Reason this comment was not posted:
Comment did not seem useful.
Workflow ID: wflow_La8vX5FjzlZhjaLR
Want Ellipsis to fix these issues? Tag @ellipsis-dev
in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
Codecov ReportAttention: Patch coverage is
✅ All tests successful. No failed tests found.
Additional details and impacted files@@ Coverage Diff @@
## master #199 +/- ##
==========================================
- Coverage 80.34% 79.88% -0.47%
==========================================
Files 56 56
Lines 3327 3365 +38
==========================================
+ Hits 2673 2688 +15
- Misses 654 677 +23
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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 e63d525 in 33 seconds
More details
- Looked at
295
lines of code in2
files - Skipped
0
files when reviewing. - Skipped posting
7
drafted comments based on config settings.
1. scripts/treeofthoughts.py:25
- Draft comment:
Consider handling exceptions likesubprocess.CalledProcessError
to ensure robustness when running subprocess commands. - Reason this comment was not posted:
Confidence changes required:50%
The use of subprocess.run without handling potential exceptions can lead to unhandled errors if the command fails. It's a good practice to handle exceptions like subprocess.CalledProcessError to ensure robustness.
2. scripts/treeofthoughts.py:31
- Draft comment:
Consider handling exceptions likesubprocess.CalledProcessError
to ensure robustness when running subprocess commands. - Reason this comment was not posted:
Confidence changes required:50%
The use of subprocess.run without handling potential exceptions can lead to unhandled errors if the command fails. It's a good practice to handle exceptions like subprocess.CalledProcessError to ensure robustness.
3. scripts/treeofthoughts.py:39
- Draft comment:
Consider handling exceptions likesubprocess.CalledProcessError
to ensure robustness when running subprocess commands. - Reason this comment was not posted:
Confidence changes required:50%
The use of subprocess.run without handling potential exceptions can lead to unhandled errors if the command fails. It's a good practice to handle exceptions like subprocess.CalledProcessError to ensure robustness.
4. scripts/treeofthoughts.py:97
- Draft comment:
Consider handling exceptions likesubprocess.CalledProcessError
to ensure robustness when running subprocess commands. - Reason this comment was not posted:
Confidence changes required:50%
The use of subprocess.run without handling potential exceptions can lead to unhandled errors if the command fails. It's a good practice to handle exceptions like subprocess.CalledProcessError to ensure robustness.
5. scripts/treeofthoughts.py:126
- Draft comment:
Consider handling exceptions likesubprocess.CalledProcessError
to ensure robustness when running subprocess commands. - Reason this comment was not posted:
Confidence changes required:50%
The use of subprocess.run without handling potential exceptions can lead to unhandled errors if the command fails. It's a good practice to handle exceptions like subprocess.CalledProcessError to ensure robustness.
6. scripts/treeofthoughts.py:187
- Draft comment:
Consider handling exceptions likesubprocess.CalledProcessError
to ensure robustness when running subprocess commands. - Reason this comment was not posted:
Confidence changes required:50%
The use of subprocess.run without handling potential exceptions can lead to unhandled errors if the command fails. It's a good practice to handle exceptions like subprocess.CalledProcessError to ensure robustness.
7. gptme/chat.py:164
- Draft comment:
UseUnion[Log, List[Message]]
for type hinting instead ofLog | list[Message]
for better clarity and compatibility. - Reason this comment was not posted:
Confidence changes required:50%
The current implementation of thestep
function ingptme/chat.py
usesLog | list[Message]
as a type hint for thelog
parameter. This can be improved for clarity and type safety by usingUnion[Log, List[Message]]
.
Workflow ID: wflow_PxtchXuYJyA1Sxt8
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
e63d525
to
76b9abf
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 76b9abf in 48 seconds
More details
- Looked at
295
lines of code in2
files - Skipped
0
files when reviewing. - Skipped posting
5
drafted comments based on config settings.
1. scripts/treeofthoughts.py:47
- Draft comment:
Use triple backticks for code blocks in Python strings.
context += f"
{f}\n"
- **Reason this comment was not posted:**
Comment looked like it was already resolved.
</details>
<details>
<summary>2. <code>scripts/treeofthoughts.py:25</code></summary>
- **Draft comment:**
Consider adding exception handling for subprocess.run to handle potential errors from the git command.
- **Reason this comment was not posted:**
Decided after close inspection that this draft comment was likely wrong and/or not actionable:
The comment is relevant because subprocess.run is used in the new functions, and it can raise exceptions. Adding exception handling could improve the robustness of the code. However, the current usage does not use check=True, so the main concern would be handling FileNotFoundError. The comment is actionable and suggests a clear improvement to the code.
The comment does not specify which exceptions to handle or how to handle them, which might make it less actionable. Additionally, if the subprocess.run calls are expected to always succeed in the given environment, exception handling might be unnecessary.
Even if the environment is controlled, handling potential exceptions can prevent unexpected crashes and improve code robustness. The comment is a general suggestion that can be refined by the developer.
Keep the comment as it suggests a valid improvement to handle potential errors from subprocess.run, which is used in the new code.
</details>
<details>
<summary>3. <code>scripts/treeofthoughts.py:97</code></summary>
- **Draft comment:**
Consider adding exception handling for subprocess.run to handle potential errors from the make command.
- **Reason this comment was not posted:**
Marked as duplicate.
</details>
<details>
<summary>4. <code>scripts/treeofthoughts.py:187</code></summary>
- **Draft comment:**
Consider adding exception handling for subprocess.run to handle potential errors from the git command.
- **Reason this comment was not posted:**
Marked as duplicate.
</details>
<details>
<summary>5. <code>scripts/treeofthoughts.py:204</code></summary>
- **Draft comment:**
Ensure that the Log class supports the pop method or use an appropriate method to remove the last message.
- **Reason this comment was not posted:**
Comment did not seem useful.
</details>
Workflow ID: <workflowid>`wflow_jBkuZtgeBxNvQ5Nc`</workflowid>
</details>
----
You can customize Ellipsis with :+1: / :-1: [feedback](https://docs.ellipsis.dev/review), review rules, user-specific overrides, `quiet` mode, and [more](https://docs.ellipsis.dev/config).
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.
❌ Changes requested. Incremental review on 11df31e in 38 seconds
More details
- Looked at
862
lines of code in13
files - Skipped
0
files when reviewing. - Skipped posting
2
drafted comments based on config settings.
1. gptme/tools/save.py:9
- Draft comment:
Theask_execute
function is no longer used and should be removed to clean up the code. - Reason this comment was not posted:
Confidence changes required:50%
Theask_execute
function is no longer used ingptme/tools/save.py
and should be removed to clean up the code.
2. gptme/tools/save.py:80
- Draft comment:
Theask_execute
function is no longer used and should be removed to clean up the code. - Reason this comment was not posted:
Confidence changes required:50%
Theask_execute
function is no longer used ingptme/tools/save.py
and should be removed to clean up the code.
Workflow ID: wflow_MWodEYP7BDsjI8Z0
Want Ellipsis to fix these issues? Tag @ellipsis-dev
in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
1de2a02
to
8281fdc
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 8281fdc in 19 seconds
More details
- Looked at
32
lines of code in2
files - Skipped
0
files when reviewing. - Skipped posting
1
drafted comments based on config settings.
1. gptme/tools/base.py:23
- Draft comment:
Theask_confirm
function was removed but not replaced. If this function was used elsewhere, it might cause issues. Consider re-adding it or ensuring all references are updated. - Reason this comment was not posted:
Comment did not seem useful.
Workflow ID: wflow_AJLn0lwNXLQphfZ1
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
ec9da6a
to
36dfa95
Compare
…mutable manager and immutable Log dataclass, added wip treeofthought script
…mation and simplifying confirmation support in server
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 36dfa95 in 18 seconds
More details
- Looked at
32
lines of code in2
files - Skipped
0
files when reviewing. - Skipped posting
1
drafted comments based on config settings.
1. gptme/tools/base.py:23
- Draft comment:
The refactoring ofConfirmFunc
from aProtocol
to aTypeAlias
is a good simplification. However, ensure that the removal ofask_confirm
does not affect other parts of the codebase that might rely on it. - Reason this comment was not posted:
Confidence changes required:50%
The refactoring of ConfirmFunc from a Protocol to a TypeAlias is a good change for simplicity, but the removal of the ask_confirm function might affect other parts of the codebase that rely on it.
Workflow ID: wflow_2v0sbAjmPJeNoMu7
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 9850780 in 25 seconds
More details
- Looked at
13
lines of code in1
files - Skipped
0
files when reviewing. - Skipped posting
1
drafted comments based on config settings.
1. gptme/commands.py:127
- Draft comment:
The lambda functionlambda _: True
is redundant since it always returns True. Consider removing it or replacing it with a direct True value if possible. - Reason this comment was not posted:
Confidence changes required:50%
The lambda function in the 'impersonate' case is redundant since it always returns True.
Workflow ID: wflow_whPC4ptbtuzpWjHf
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 696f706 in 28 seconds
More details
- Looked at
35
lines of code in2
files - Skipped
0
files when reviewing. - Skipped posting
1
drafted comments based on config settings.
1. gptme/tools/save.py:9
- Draft comment:
ask_execute
is removed fromutil.py
but still used here. This will cause a runtime error. Consider replacing it withconfirm
or another appropriate function. - Reason this comment was not posted:
Decided after close inspection that this draft comment was likely wrong and/or not actionable:
The comment is accurate as it identifies a potential runtime error due to the removal of 'ask_execute' from the imports. The code change in the diff shows that 'ask_execute' was replaced with 'confirm', which resolves the issue. However, the comment is not needed because the change has already been made in the diff.
I might be missing the fact that the comment is pointing out a potential issue if 'ask_execute' was used elsewhere in the file, but the diff shows that it was replaced with 'confirm', resolving the issue.
The comment is unnecessary because the issue it points out has already been resolved in the diff by replacing 'ask_execute' with 'confirm'.
Delete the comment because the issue it points out has already been resolved in the diff.
Workflow ID: wflow_evGXI1Q1pvdt2X6Q
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 eff6ab1 in 27 seconds
More details
- Looked at
55
lines of code in1
files - Skipped
0
files when reviewing. - Skipped posting
1
drafted comments based on config settings.
1. gptme/chat.py:115
- Draft comment:
set_interruptible()
is called multiple times unnecessarily. It should be called once before the try block to avoid redundancy. This applies to lines 115, 195, and 224. - Reason this comment was not posted:
Decided after close inspection that this draft comment was likely wrong and/or not actionable:
The comment is addressing a change made in the diff, whereset_interruptible()
was moved inside the try block. The suggestion to call it once before the try block seems to be a valid code quality improvement, as it reduces redundancy. The comment is actionable and clear, suggesting a specific refactor to improve code quality.
The comment assumes that callingset_interruptible()
multiple times is unnecessary without considering if there might be a reason for its placement inside the try block. There might be a specific reason for setting it at those points, such as ensuring it is set right before certain operations.
The comment is focused on reducing redundancy, which is generally a good practice unless there is a specific reason for the redundancy. The suggestion is clear and actionable, and if there is no specific reason for the redundancy, it should be addressed.
The comment is valid as it addresses a change made in the diff and suggests a clear and actionable improvement to reduce redundancy in the code. It should be kept.
Workflow ID: wflow_7ySeT37n9LFPNodm
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
TODO
Important
Refactor logging system with new
Log
dataclass and add tree-branching conversation script.Log
dataclass inlogmanager.py
for immutable message handling.LogManager
to useLog
for managing conversation logs.prepare_messages
fromLogManager
, added as standalone function.treeofthoughts.py
for tree-branching conversation evaluation.LogManager
andLog
inchat.py
,cli.py
,commands.py
,server/api.py
, andtools/chats.py
.Conversation
withConversationMeta
incli.py
andlist_user_messages.py
.This description was created by
for eff6ab1. It will automatically update as commits are pushed.