-
-
Notifications
You must be signed in to change notification settings - Fork 210
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
feat: support auto n
to skip n confirmations
#346
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 c035a16 in 30 seconds
More details
- Looked at
52
lines of code in1
files - Skipped
0
files when reviewing. - Skipped posting
0
drafted comments based on config settings.
Workflow ID: wflow_4fiilZwktGdAXVYS
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.
gptme/util/ask_execute.py
Outdated
if answer == "auto": | ||
return (override_auto := True) | ||
# secret option to skip asking for a number of times | ||
match = re.match(r'(auto)(?: (\d+))?', answer) |
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.
The regex pattern should be anchored to the start of the string to avoid unexpected matches. Use ^
at the beginning of the pattern.
match = re.match(r'(auto)(?: (\d+))?', answer) | |
match = re.match(r'^(auto)(?: (\d+))?', answer) |
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.
Don't think it's necessary really. user might type a space before auto
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.
Also compiled the regex
closes #332 |
gptme/util/ask_execute.py
Outdated
#Compiled regex pattern | ||
pattern = re.compile(r'(auto)(?: (\d+))?') |
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.
Call this something like re_auto
, I don't think we need to compile it, at least not at import-time.
Nice! |
auto n
to skip n confirmations
Forgot to [auto] as an option displayed in confirmation prompt. Guess it
remains secret?
…On Thu, 19 Dec 2024, 15:03 Erik Bjäreholt, ***@***.***> wrote:
Merged #346 <#346> into master.
—
Reply to this email directly, view it on GitHub
<#346 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AO6ENNOYJ7ZUJ4VKOHSZJI32GKYYFAVCNFSM6AAAAABTYHLHXSVHI2DSMVQWIX3LMV45UABCJFZXG5LFIV3GK3TUJZXXI2LGNFRWC5DJN5XDWMJVG4YTMNRTGY3TIMA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
*add
…On Thu, 19 Dec 2024, 15:08 Brayo Vuku, ***@***.***> wrote:
Forgot to [auto] as an option displayed in confirmation prompt. Guess it
remains secret?
On Thu, 19 Dec 2024, 15:03 Erik Bjäreholt, ***@***.***>
wrote:
> Merged #346 <#346> into master.
>
> —
> Reply to this email directly, view it on GitHub
> <#346 (comment)>, or
> unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AO6ENNOYJ7ZUJ4VKOHSZJI32GKYYFAVCNFSM6AAAAABTYHLHXSVHI2DSMVQWIX3LMV45UABCJFZXG5LFIV3GK3TUJZXXI2LGNFRWC5DJN5XDWMJVG4YTMNRTGY3TIMA>
> .
> You are receiving this because you authored the thread.Message ID:
> ***@***.***>
>
|
closes #332
Important
Adds limited confirmation skips to
ask_execute()
usingauto_skip_count
inask_execute.py
.auto_skip_count
inask_execute.py
to limit the number of confirmation skips.ask_execute()
to decrementauto_skip_count
when skipping confirmation.ask_execute()
.re
module inask_execute.py
for regex operations.This description was created by for c035a16. It will automatically update as commits are pushed.