Paul Gauthier
bde80e4577
aider: Handle the case where the ~/.gitconfig
file is missing or does not contain the user.name
entry.
...
# Aider chat conversation:
USER: https://github.com/paul-gauthier/aider/issues/662
https://github.com/paul-gauthier/aider/issues/662 :
[Skip to content](#start-of-content)
## Navigation Menu
Toggle navigation
[](https://github.com/ )
[Sign
in](/login?return_to=https%3A%2F%2Fgithub.com%2Fpaul-gauthier%2Faider%2Fissues%2F662)
- Product
- [](https://github.com/features/actions )
Actions
Automate any workflow
- [](https://github.com/features/packages )
Packages
Host and manage packages
- [](https://github.com/features/security )
Security
Find and fix vulnerabilities
- [](https://github.com/features/codespaces )
Codespaces
Instant dev environments
- [](https://github.com/features/copilot )
GitHub Copilot
Write better code with AI
- [](https://github.com/features/code-review )
Code review
Manage code changes
- [](https://github.com/features/issues )
Issues
Plan and track work
- [](https://github.com/features/discussions )
Discussions
Collaborate outside of code
Explore
- [All features](https://github.com/features )
- [Documentation](https://docs.github.com )
- [GitHub Skills](https://skills.github.com )
- [Blog](https://github.blog )
- Solutions
For
- [Enterprise](https://github.com/enterprise )
- [Teams](https://github.com/team )
- [Startups](https://github.com/enterprise/startups )
- [Education](https://education.github.com )
By Solution
- [CI/CD & Automation](https://github.com/solutions/ci-cd )
- [DevOps](https://github.com/solutions/devops )
- [DevSecOps](https://resources.github.com/devops/fundamentals/devsecops )
Resources
- [Learning Pathways](https://resources.github.com/learn/pathways )
- [White papers, Ebooks, Webinars](https://resources.github.com )
- [Customer Stories](https://github.com/customer-stories )
- [Partners](https://partner.github.com )
- Open Source
- [](/sponsors)
GitHub Sponsors
Fund open source developers
- [](https://github.com/readme )
The ReadME Project
GitHub community articles
Repositories
- [Topics](https://github.com/topics )
- [Trending](https://github.com/trending )
- [Collections](https://github.com/collections )
- Enterprise
- [](/enterprise)
Enterprise platform
AI-powered developer platform
Available add-ons
- [](https://github.com/enterprise/advanced-security )
Advanced Security
Enterprise-grade security features
- [](/features/copilot#enterprise)
GitHub Copilot
Enterprise-grade AI features
- [](/premium-support)
Premium Support
Enterprise-grade 24/7 support
- [Pricing](https://github.com/pricing )
Search or jump to\...
# Search code, repositories, users, issues, pull requests\...
Search
Clear
[Search syntax
tips](https://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax )
# Provide feedback
We read every piece of feedback, and take your input very seriously.
Include my email address so I can be contacted
Cancel
Submit feedback
# Saved searches
## Use saved searches to filter your results more quickly
Name
Query
To see all available qualifiers, see our
[documentation](https://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax ).
Cancel
Create saved search
[Sign
in](/login?return_to=https%3A%2F%2Fgithub.com%2Fpaul-gauthier%2Faider%2Fissues%2F662)
[Sign
up](/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=paul-gauthier%2Faider)
You signed in with another tab or window. [Reload]() to refresh your
session. You signed out in another tab or window. [Reload]() to refresh
your session. You switched accounts on another tab or window. [Reload]()
to refresh your session.
Dismiss alert
{{ message }}
::: {role="main"}
[paul-gauthier](/paul-gauthier) / **[aider](/paul-gauthier/aider)**
Public
- [Notifications](/login?return_to=%2Fpaul-gauthier%2Faider) You must
be signed in to change notification settings
- [Fork 1.1k](/login?return_to=%2Fpaul-gauthier%2Faider)
-
[ Star 11.3k](/login?return_to=%2Fpaul-gauthier%2Faider)
- [Code ](/paul-gauthier/aider)
- [Issues 59](/paul-gauthier/aider/issues)
- [Pull requests 14](/paul-gauthier/aider/pulls)
- [Actions ](/paul-gauthier/aider/actions)
- [Projects 0](/paul-gauthier/aider/projects)
- [Security](/paul-gauthier/aider/security)
- [Insights ](/paul-gauthier/aider/pulse)
Additional navigation options
- [ Code ](/paul-gauthier/aider)
- [ Issues ](/paul-gauthier/aider/issues)
- [ Pull requests ](/paul-gauthier/aider/pulls)
- [ Actions ](/paul-gauthier/aider/actions)
- [ Projects ](/paul-gauthier/aider/projects)
- [ Security ](/paul-gauthier/aider/security)
- [ Insights ](/paul-gauthier/aider/pulse)
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.
[Sign up for
GitHub](/signup?return_to=%2Fpaul-gauthier%2Faider%2Fissues%2Fnew%2Fchoose)
By clicking "Sign up for GitHub", you agree to our [terms of
service](https://docs.github.com/terms ) and [privacy
statement](https://docs.github.com/privacy ). We'll occasionally send you
account related emails.
Already on GitHub? [Sign
in](/login?return_to=%2Fpaul-gauthier%2Faider%2Fissues%2Fnew%2Fchoose)
to your account
[Jump to bottom](#issue-comment-box)
# Ugly crash during startup when `~/.gitconfig` is missing \[user\] #662
Open
[Megamannen](/Megamannen) opened this issue Jun 10, 2024 · 1 comment
Open
# [Ugly crash during startup when `~/.gitconfig` is missing \[user\]](#top) #662
[Megamannen](/Megamannen) opened this issue Jun 10, 2024 · 1 comment
## Comments
[](/Megamannen)
Copy link
###
**[Megamannen](/Megamannen)** commented [Jun 10,
2024](#issue-2343705266)
+-----------------------------------------------------------------------+
| ### Issue |
| |
| This is my `~/.gitconfig` |
| |
| |
| |
| [safe] |
| directory = /home/mega/Projects |
| |
| |
| |
| |
| |
| |
| |
| This is the output: |
| |
| |
| |
| aider |
| Traceback (most recent call last): |
| File "/usr/lib/python3.12/configparser.py", line 767, in get |
| value = d[option] |
| ~^^^^^^^^ |
| File "/u |
| sr/lib/python3.12/collections/__init__.py", line 1015, in __getitem__ |
| return self.__m |
| issing__(key) # support subclasses that define __missing__ |
| ^^^^^^^^^^^^^^^^^^^^^ |
| File "/u |
| sr/lib/python3.12/collections/__init__.py", line 1007, in __missing__ |
| raise KeyError(key) |
| KeyError: 'name' |
| |
| |
| During handling of the above exception, another exception occurred: |
| |
| Traceback (most recent call last): |
| File "/home/mega/.local/bin/aider", line 8, in <module> |
| sys.exit(main()) |
| ^^^^^^ |
| File "/home/mega/.local/share/pipx/venvs/aide |
| r-chat/lib/python3.12/site-packages/aider/main.py", line 306, in main |
| git_root = setup_git(git_root, io) |
| ^^^^^^^^^^^^^^^^^^^^^^^ |
| File "/home/mega/.local/share/pipx/venvs/aider-ch |
| at/lib/python3.12/site-packages/aider/main.py", line 68, in setup_git |
| user_name = config.get_value("user", "name", None) |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| File "/home/mega/.local/share/pipx/venvs/aider-cha |
| t/lib/python3.12/site-packages/git/config.py", line 793, in get_value |
| valuestr = self.get(section, option) |
| ^^^^^^^^^^^^^^^^^^^^^^^^^ |
| File "/home/mega/.local/share/pipx/venvs/aider-chat/lib/pyth |
| on3.12/site-packages/git/config.py", line 114, in assure_data_present |
| return func(self, *args, **kwargs) |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| File "/usr/lib/python3.12/configparser.py", line 770, in get |
| raise NoOptionError(option, section) |
| configparser.NoOptionError: No option 'name' in section: 'user' |
| |
| |
| |
| |
| |
| |
| |
| I added my user info to .gitconfig and it works |
| |
| ### Version and model info |
| |
| Aider: v0.37.0 |
+-----------------------------------------------------------------------+
| |
| |
| The text was updated successfully, but these errors were encountered: |
| |
| |
+-----------------------------------------------------------------------+
All reactions
Copy link
Owner
###
**[paul-gauthier](/paul-gauthier)** commented [Jun 10,
2024](#issuecomment-2159441132)
+-----------------------------------------------------------------------+
| Thanks for trying aider and filing this issue. |
| |
| I am unable to reproduce this issue. I made my `~/.gitconfig` the |
| same as yours and aider does the expected thing: |
| |
| |
| |
| $ git init |
| |
| $ aider |
| Update git name with: git config user.name "Your Name" |
| Update git email with: git config user.email "you@example.com" |
| ... |
| |
| |
| |
| |
| |
| |
| |
| Can you describe more clearly how to reproduce? |
+-----------------------------------------------------------------------+
All reactions
Sorry, something went wrong.
[Sign up for free](/join?source=comment-repo) **to join this
conversation on GitHub**. Already have an account? [Sign in to
comment](/login?return_to=https%3A%2F%2Fgithub.com%2Fpaul-gauthier%2Faider%2Fissues%2F662)
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development
No branches or pull requests
2 participants
:::
## Footer
[](https://github.com ) © 2024 GitHub, Inc.
### Footer navigation
- [Terms](https://docs.github.com/site-policy/github-terms/github-terms-of-service )
- [Privacy](https://docs.github.com/site-policy/privacy-policies/github-privacy-statement )
- [Security](https://github.com/security )
- [Status](https://www.githubstatus.com/ )
- [Docs](https://docs.github.com/ )
- [Contact](https://support.github.com?tags=dotcom-footer )
- Manage cookies
- Do not share my personal information
You can't perform that action at this time.
ASSISTANT: To address the issue described in https://github.com/paul-gauthier/aider/issues/662 , we need to handle the case where the `~/.gitconfig` file is missing or does not contain the `user.name` entry. The most likely file to need changes is:
- `aider/main.py`
Please add `aider/main.py` to the chat so I can propose the necessary changes.
USER: I added these files to the chat: aider/main.py.
If you need to propose edits to other existing files not already added to the chat, you *MUST* tell the me their full path names and ask me to *add the files to the chat*. End your reply and wait for my approval. You can keep asking if you then decide you need to edit more files.
ASSISTANT: To handle the case where the `~/.gitconfig` file is missing or does not contain the `user.name` entry, we need to catch the `configparser.NoOptionError` exception and handle it gracefully.
Here are the changes needed:
1. Modify the `setup_git` function to handle the `configparser.NoOptionError` exception.
aider/main.py
```python
<<<<<<< SEARCH
except configparser.NoSectionError:
=======
except (configparser.NoSectionError, configparser.NoOptionError):
>>>>>>> REPLACE
```
This change will ensure that the code handles the case where the `user.name` or `user.email` is missing in the `~/.gitconfig` file without crashing.
2024-06-10 15:52:57 -07:00
Paul Gauthier
5282e6fc4a
Merge remote-tracking branch 'origin/main'
2024-06-10 15:34:29 -07:00
Paul Gauthier
ce46ea8d62
moved tests/ to aider/tests/
2024-06-10 15:33:49 -07:00
Paul Gauthier
470b8d0251
Show model warnings in normal color, not red/error
2024-06-10 15:23:33 -07:00
develmusa
098944a133
Update help text for specifying the API key to mention Anthropic instead of OpenAI.
2024-06-09 12:35:42 +02:00
Paul Gauthier
4cbeb59bec
browser ver should stop after 3 reflections
2024-06-08 13:38:18 -07:00
Paul Gauthier
8d3a320ab3
log the announcements in the gui too
2024-06-08 13:31:40 -07:00
Paul Gauthier
d2b9eec3e0
fixed bad url; fixed max_reflection logic
2024-06-08 12:57:36 -07:00
Paul Gauthier
1f1da4b1a2
refac all urls into urls.py
2024-06-08 12:53:54 -07:00
Paul Gauthier
09d3d02971
more conservative reflection if
2024-06-08 12:40:35 -07:00
Daniel Vainsencher
e6e360a4ef
Added support for logging LLM history to a specified file.
2024-06-07 10:40:32 -04:00
Daniel Vainsencher
8896909e19
aider: Capitalize the "ASSISTANT" role when logging to the LLM history file.
...
# Aider chat conversation:
USER: When logging to llm history file, capitalize the ASSISTANT role.
ASSISTANT: To capitalize the "ASSISTANT" role when logging to the LLM history file, we need to modify the `send_new_user_message` method in `aider/coders/base_coder.py`.
Here is the *SEARCH/REPLACE* block:
aider/coders/base_coder.py
```python
<<<<<<< SEARCH
with open('.aider.llm.history', 'a') as log_file:
log_file.write(f"LLM RESPONSE {timestamp}\n")
log_file.write(format_content("assistant", content) + "\n")
=======
with open('.aider.llm.history', 'a') as log_file:
log_file.write(f"LLM RESPONSE {timestamp}\n")
log_file.write(format_content("ASSISTANT", content) + "\n")
>>>>>>> REPLACE
```
2024-06-07 09:39:03 -04:00
Daniel Vainsencher
2bd5daf2ad
aider: Add logging of conversation between coder and LLM in .aider.llm.history file using new formatting functions in send_new_user_message
.
...
# Aider chat conversation:
USER: We want to add logging of the conversation between coder and the LLM into a new file called .aider.llm.history. The formatting should be done using the new format_messages and format_content. Modify only the `send_new_user_message` function in base_coder, formatting and logging `messages` as soon as it is defined, and logging `content` before `tool_output`. Precede them by a single line saying "TO LLM {timestamp}" and "LLM RESPONSE {timestamp}" where the timestamp is uses ISO date format and has second precision.
ASSISTANT: To implement the logging of the conversation between the coder and the LLM, we will:
1. Format and log `messages` as soon as it is defined in `send_new_user_message`.
2. Log `content` before `tool_output`.
3. Precede the logs with a timestamp in ISO date format with second precision.
Here are the *SEARCH/REPLACE* blocks:
aider/coders/base_coder.py
```python
<<<<<<< SEARCH
messages = self.format_messages()
=======
import datetime
from aider.utils import format_messages, format_content
messages = self.format_messages()
timestamp = datetime.datetime.now().isoformat(timespec='seconds')
with open('.aider.llm.history', 'a') as log_file:
log_file.write(f"TO LLM {timestamp}\n")
log_file.write(format_messages(messages) + "\n")
>>>>>>> REPLACE
```
aider/coders/base_coder.py
```python
<<<<<<< SEARCH
self.io.tool_output()
=======
self.io.tool_output()
timestamp = datetime.datetime.now().isoformat(timespec='seconds')
with open('.aider.llm.history', 'a') as log_file:
log_file.write(f"LLM RESPONSE {timestamp}\n")
log_file.write(format_content("assistant", content) + "\n")
>>>>>>> REPLACE
```
2024-06-07 09:39:03 -04:00
Daniel Vainsencher
abf8d5e60d
aider: Refactored format_messages
to use a new function format_content
for line-by-line formatting.
...
# Aider chat conversation:
USER: Now refactor format_messages: extract a function that takes a role and content (where content is a string), and returns the line by line formatted string.
ASSISTANT: To refactor `format_messages`, we will:
1. Create a new function `format_content` that takes a role and content (where content is a string) and returns the line-by-line formatted string.
2. Update `format_messages` to use `format_content`.
Here are the *SEARCH/REPLACE* blocks:
aider/utils.py
```python
<<<<<<< SEARCH
def format_messages(messages, title=None):
=======
def format_content(role, content):
formatted_lines = []
for line in content.splitlines():
formatted_lines.append(f"{role} {line}")
return "\n".join(formatted_lines)
>>>>>>> REPLACE
```
aider/utils.py
```python
<<<<<<< SEARCH
elif isinstance(content, str): # Handle string content
for line in content.splitlines():
output.append(f"{role} {line}")
=======
elif isinstance(content, str): # Handle string content
output.append(format_content(role, content))
>>>>>>> REPLACE
```
USER:
# Fix any errors below, if possible.
## Running: flake8 --select=E9,F821,F823,F831,F406,F407,F701,F702,F704,F706 --show-source --isolated aider/utils.py
aider/utils.py:94:8: F821 undefined name 'title'
if title:
^
aider/utils.py:95:26: F821 undefined name 'title'
output.append(f"{title.upper()} {'*' * 50}")
^
aider/utils.py:97:16: F821 undefined name 'messages'
for msg in messages:
^
aider/utils.py:115:24: F821 undefined name 'format_messages'
formatted_output = format_messages(messages, title)
^
## See relevant lines below marked with █.
aider/utils.py:
...⋮...
87│def format_content(role, content):
88│ formatted_lines = []
...⋮...
91│ return "\n".join(formatted_lines)
92│
93│ output = []
94█ if title:
95█ output.append(f"{title.upper()} {'*' * 50}")
96│
97█ for msg in messages:
98│ output.append("")
99│ role = msg["role"].upper()
100│ content = msg.get("content")
...⋮...
112│
113│
114│def show_messages(messages, title=None, functions=None):
115█ formatted_output = format_messages(messages, title)
116│ print(formatted_output)
117│
118│ if functions:
...⋮...
ASSISTANT: To fix the errors, we need to ensure that the `format_messages` function is properly defined and that the misplaced code is correctly organized. Here are the corrected *SEARCH/REPLACE* blocks:
aider/utils.py
```python
<<<<<<< SEARCH
return "\n".join(formatted_lines)
output = []
if title:
output.append(f"{title.upper()} {'*' * 50}")
for msg in messages:
output.append("")
role = msg["role"].upper()
content = msg.get("content")
if isinstance(content, list): # Handle list content (e.g., image messages)
for item in content:
if isinstance(item, dict) and "image_url" in item:
output.append(f"{role} Image URL: {item['image_url']['url']}")
elif isinstance(content, str): # Handle string content
output.append(format_content(role, content))
content = msg.get("function_call")
if content:
output.append(f"{role} {content}")
return "\n".join(output)
=======
return "\n".join(formatted_lines)
def format_messages(messages, title=None):
output = []
if title:
output.append(f"{title.upper()} {'*' * 50}")
for msg in messages:
output.append("")
role = msg["role"].upper()
content = msg.get("content")
if isinstance(content, list): # Handle list content (e.g., image messages)
for item in content:
if isinstance(item, dict) and "image_url" in item:
output.append(f"{role} Image URL: {item['image_url']['url']}")
elif isinstance(content, str): # Handle string content
output.append(format_content(role, content))
content = msg.get("function_call")
if content:
output.append(f"{role} {content}")
return "\n".join(output)
>>>>>>> REPLACE
```
2024-06-07 09:39:03 -04:00
Daniel Vainsencher
a0b279f105
Refactored format_messages to use format_content for string content handling.
2024-06-07 09:39:03 -04:00
Daniel Vainsencher
69c27d6cd1
aider: Refactored show_messages
to call format_messages
for formatting title and messages.
...
# Aider chat conversation:
USER: Refactor show_messages in utils, so that the formatting of title and messages is done in a separate function which returns a string. show_messages should call it and print its output.
ASSISTANT: To refactor the `show_messages` function, we will:
1. Create a new function `format_messages` that formats the title and messages and returns a string.
2. Update `show_messages` to call `format_messages` and print its output.
Here are the *SEARCH/REPLACE* blocks:
aider/utils.py
```python
<<<<<<< SEARCH
def show_messages(messages, title=None, functions=None):
if title:
print(title.upper(), "*" * 50)
for msg in messages:
print()
role = msg["role"].upper()
content = msg.get("content")
if isinstance(content, list): # Handle list content (e.g., image messages)
for item in content:
if isinstance(item, dict) and "image_url" in item:
print(role, "Image URL:", item["image_url"]["url"])
elif isinstance(content, str): # Handle string content
for line in content.splitlines():
print(role, line)
content = msg.get("function_call")
if content:
print(role, content)
if functions:
dump(functions)
=======
def format_messages(messages, title=None):
output = []
if title:
output.append(f"{title.upper()} {'*' * 50}")
for msg in messages:
output.append("")
role = msg["role"].upper()
content = msg.get("content")
if isinstance(content, list): # Handle list content (e.g., image messages)
for item in content:
if isinstance(item, dict) and "image_url" in item:
output.append(f"{role} Image URL: {item['image_url']['url']}")
elif isinstance(content, str): # Handle string content
for line in content.splitlines():
output.append(f"{role} {line}")
content = msg.get("function_call")
if content:
output.append(f"{role} {content}")
return "\n".join(output)
def show_messages(messages, title=None, functions=None):
formatted_output = format_messages(messages, title)
print(formatted_output)
if functions:
dump(functions)
>>>>>>> REPLACE
```
2024-06-07 09:39:03 -04:00
Paul Gauthier
30f4a905c1
renamed config/options and get_md_help()
2024-06-06 14:00:14 -07:00
Paul Gauthier
53deb04e75
use dashed-names not underscore_names in yaml
2024-06-06 13:46:32 -07:00
Paul Gauthier
65c9a7866a
improved handling of defaults
2024-06-06 13:40:16 -07:00
Paul Gauthier
645ace1d0e
fix defaults in sample yml
2024-06-06 12:46:07 -07:00
Paul Gauthier
2d62e3fb1f
add sample aider.conf.yml
2024-06-06 12:40:25 -07:00
Paul Gauthier
caca261587
output nice md usage
2024-06-06 12:26:06 -07:00
Paul Gauthier
8e9cbcc014
Refactored MarkdownHelpFormatter to improve formatting and display additional information about actions.
2024-06-06 12:14:20 -07:00
Paul Gauthier
e7aafd9590
aider: Add argument formatter to print arguments in a specified format.
...
# Aider chat conversation:
USER: Add an args formatter that prints out args like this:
## Output Settings:
### --dark-mode
Use colors suitable for a dark terminal background
Default: False
### --light-mode
Use colors suitable for a light terminal background
Default: False
...
ASSISTANT: To add an argument formatter that prints out arguments in the specified format, we need to:
1. Create a new formatter class.
2. Update the `get_help` function to use this new formatter.
Here are the changes:
1. Create a new file `aider/args_formatter.py` with the custom formatter class.
2. Update `aider/args.py` to use this new formatter.
Let's start with the new file:
aider/args_formatter.py
```python
<<<<<<< SEARCH
=======
import argparse
class CustomHelpFormatter(argparse.HelpFormatter):
def start_section(self, heading):
super().start_section(f"## {heading}:")
def _format_action(self, action):
parts = []
if action.help:
parts.append(f"### --{action.dest}")
parts.append(action.help)
if action.default is not argparse.SUPPRESS:
parts.append(f"Default: {action.default}")
return "\n".join(parts)
def _format_action_invocation(self, action):
return ""
def _format_args(self, action, default_metavar):
return ""
>>>>>>> REPLACE
```
Next, update `aider/args.py` to use this new formatter:
aider/args.py
```python
<<<<<<< SEARCH
from aider import __version__, models
=======
from aider import __version__, models
from aider.args_formatter import CustomHelpFormatter
>>>>>>> REPLACE
```
aider/args.py
```python
<<<<<<< SEARCH
description="aider is GPT powered coding in your terminal",
=======
description="aider is GPT powered coding in your terminal",
formatter_class=CustomHelpFormatter,
>>>>>>> REPLACE
```
aider/args.py
```python
<<<<<<< SEARCH
parser = get_parser([], None)
=======
parser = get_parser([], None)
parser.formatter_class = CustomHelpFormatter
>>>>>>> REPLACE
```
2024-06-06 11:38:45 -07:00
Paul Gauthier
0e5342fdb8
copy
2024-06-06 11:01:27 -07:00
Paul Gauthier
9437fb28c4
removed configargparse.YAMLConfigFileParser
2024-06-05 21:14:54 -07:00
Paul Gauthier
0d9150c77b
coq for languages.md
2024-06-05 20:24:19 -07:00
Paul Gauthier
e3cc69d0c8
coq for in-chat commands
2024-06-05 20:10:48 -07:00
Paul Gauthier
6f9e0ce37f
cog to update usage.md
2024-06-05 19:43:24 -07:00
Paul Gauthier
a857cbb7d1
added cmd line args
2024-06-05 16:59:30 -07:00
Paul Gauthier
f481fba1ca
set version to 0.37.1-dev
2024-06-04 10:31:28 -07:00
Paul Gauthier
45c8e82228
version bump to 0.37.0
2024-06-04 10:30:49 -07:00
Paul Gauthier
73c6af8851
aider: Implemented a more flexible approach to handle different microphone sample rates in aider/voice.py.
...
# Aider chat conversation:
USER: https://github.com/paul-gauthier/aider/issues/612
https://github.com/paul-gauthier/aider/issues/612 :
[Skip to content](#start-of-content)
## Navigation Menu
Toggle navigation
[](https://github.com/ )
[Sign
in](/login?return_to=https%3A%2F%2Fgithub.com%2Fpaul-gauthier%2Faider%2Fissues%2F612)
- Product
- [](https://github.com/features/actions )
Actions
Automate any workflow
- [](https://github.com/features/packages )
Packages
Host and manage packages
- [](https://github.com/features/security )
Security
Find and fix vulnerabilities
- [](https://github.com/features/codespaces )
Codespaces
Instant dev environments
- [](https://github.com/features/copilot )
GitHub Copilot
Write better code with AI
- [](https://github.com/features/code-review )
Code review
Manage code changes
- [](https://github.com/features/issues )
Issues
Plan and track work
- [](https://github.com/features/discussions )
Discussions
Collaborate outside of code
Explore
- [All features](https://github.com/features )
- [Documentation](https://docs.github.com )
- [GitHub Skills](https://skills.github.com )
- [Blog](https://github.blog )
- Solutions
For
- [Enterprise](https://github.com/enterprise )
- [Teams](https://github.com/team )
- [Startups](https://github.com/enterprise/startups )
- [Education](https://education.github.com )
By Solution
- [CI/CD & Automation](https://github.com/solutions/ci-cd )
- [DevOps](https://github.com/solutions/devops )
- [DevSecOps](https://resources.github.com/devops/fundamentals/devsecops )
Resources
- [Learning Pathways](https://resources.github.com/learn/pathways )
- [White papers, Ebooks, Webinars](https://resources.github.com )
- [Customer Stories](https://github.com/customer-stories )
- [Partners](https://partner.github.com )
- Open Source
- [](/sponsors)
GitHub Sponsors
Fund open source developers
- [](https://github.com/readme )
The ReadME Project
GitHub community articles
Repositories
- [Topics](https://github.com/topics )
- [Trending](https://github.com/trending )
- [Collections](https://github.com/collections )
- Enterprise
- [](/enterprise)
Enterprise platform
AI-powered developer platform
Available add-ons
- [](https://github.com/enterprise/advanced-security )
Advanced Security
Enterprise-grade security features
- [](/features/copilot#enterprise)
GitHub Copilot
Enterprise-grade AI features
- [](/premium-support)
Premium Support
Enterprise-grade 24/7 support
- [Pricing](https://github.com/pricing )
Search or jump to\...
# Search code, repositories, users, issues, pull requests\...
Search
Clear
[Search syntax
tips](https://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax )
# Provide feedback
We read every piece of feedback, and take your input very seriously.
Include my email address so I can be contacted
Cancel
Submit feedback
# Saved searches
## Use saved searches to filter your results more quickly
Name
Query
To see all available qualifiers, see our
[documentation](https://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax ).
Cancel
Create saved search
[Sign
in](/login?return_to=https%3A%2F%2Fgithub.com%2Fpaul-gauthier%2Faider%2Fissues%2F612)
[Sign
up](/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=paul-gauthier%2Faider)
You signed in with another tab or window. [Reload]() to refresh your
session. You signed out in another tab or window. [Reload]() to refresh
your session. You switched accounts on another tab or window. [Reload]()
to refresh your session.
Dismiss alert
{{ message }}
::: {role="main"}
[paul-gauthier](/paul-gauthier) / **[aider](/paul-gauthier/aider)**
Public
- [Notifications](/login?return_to=%2Fpaul-gauthier%2Faider) You must
be signed in to change notification settings
- [Fork 1k](/login?return_to=%2Fpaul-gauthier%2Faider)
-
[ Star 10.5k](/login?return_to=%2Fpaul-gauthier%2Faider)
- [Code ](/paul-gauthier/aider)
- [Issues 57](/paul-gauthier/aider/issues)
- [Pull requests 14](/paul-gauthier/aider/pulls)
- [Actions ](/paul-gauthier/aider/actions)
- [Projects 0](/paul-gauthier/aider/projects)
- [Security](/paul-gauthier/aider/security)
- [Insights ](/paul-gauthier/aider/pulse)
Additional navigation options
- [ Code ](/paul-gauthier/aider)
- [ Issues ](/paul-gauthier/aider/issues)
- [ Pull requests ](/paul-gauthier/aider/pulls)
- [ Actions ](/paul-gauthier/aider/actions)
- [ Projects ](/paul-gauthier/aider/projects)
- [ Security ](/paul-gauthier/aider/security)
- [ Insights ](/paul-gauthier/aider/pulse)
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.
[Sign up for
GitHub](/signup?return_to=%2Fpaul-gauthier%2Faider%2Fissues%2Fnew%2Fchoose)
By clicking "Sign up for GitHub", you agree to our [terms of
service](https://docs.github.com/terms ) and [privacy
statement](https://docs.github.com/privacy ). We'll occasionally send you
account related emails.
Already on GitHub? [Sign
in](/login?return_to=%2Fpaul-gauthier%2Faider%2Fissues%2Fnew%2Fchoose)
to your account
[Jump to bottom](#issue-comment-box)
# Unsupported Audio Sample Rate #612
Open
[aaronson2012](/aaronson2012) opened this issue May 24, 2024 · 0
comments
Open
# [Unsupported Audio Sample Rate](#top) #612
[aaronson2012](/aaronson2012) opened this issue May 24, 2024 · 0
comments
Labels
[enhancement](/paul-gauthier/aider/labels/enhancement) New feature or
request
## Comments
[](/aaronson2012)
Copy link
###
**[aaronson2012](/aaronson2012)** commented [May 24,
2024](#issue-2314049815)
+-----------------------------------------------------------------------+
| ### Issue |
| |
| aider was crashing when i ran the /voice command and I realized that |
| my computers microphone did not support a sample rate of 16kHz. It |
| was an easy fix for me i just changed the sample_rate variable to one |
| my mic supported but this isn\'t a very elegant solution. Could there |
| be a better way so all mics are supported? |
| |
| ### Version and model info |
| |
| Latest verision |
+-----------------------------------------------------------------------+
| |
| |
| The text was updated successfully, but these errors were encountered: |
| |
| |
+-----------------------------------------------------------------------+
All reactions
[paul-gauthier](/paul-gauthier) added the
[enhancement](/paul-gauthier/aider/labels/enhancement) New feature or
request label [Jun 4, 2024](#event-13039727805)
[Sign up for free](/join?source=comment-repo) **to join this
conversation on GitHub**. Already have an account? [Sign in to
comment](/login?return_to=https%3A%2F%2Fgithub.com%2Fpaul-gauthier%2Faider%2Fissues%2F612)
Assignees
No one assigned
Labels
[enhancement](/paul-gauthier/aider/labels/enhancement) New feature or
request
Projects
None yet
Milestone
No milestone
Development
No branches or pull requests
2 participants
:::
## Footer
[](https://github.com ) © 2024 GitHub, Inc.
### Footer navigation
- [Terms](https://docs.github.com/site-policy/github-terms/github-terms-of-service )
- [Privacy](https://docs.github.com/site-policy/privacy-policies/github-privacy-statement )
- [Security](https://github.com/security )
- [Status](https://www.githubstatus.com/ )
- [Docs](https://docs.github.com/ )
- [Contact](https://support.github.com?tags=dotcom-footer )
- Manage cookies
- Do not share my personal information
You can't perform that action at this time.
ASSISTANT: Based on the issue description, I believe the following file is most likely to need changes to support different microphone sample rates:
aider/voice.py
This file contains the Voice class which handles recording and transcribing audio. The sample_rate variable is hardcoded in this file.
To make the suggested change, we would need to modify how the sample rate is determined in aider/voice.py.
Please add aider/voice.py to the chat so I can propose the specific code changes needed. Let me know if you would like me to explain my reasoning further or if you have any other questions!
USER: I added these files to the chat: aider/voice.py.
If you need to propose edits to other existing files not already added to the chat, you *MUST* tell the me their full path names and ask me to *add the files to the chat*. End your reply and wait for my approval. You can keep asking if you then decide you need to edit more files.
ASSISTANT: Here are the proposed changes to aider/voice.py to support different microphone sample rates:
aider/voice.py
```python
<<<<<<< SEARCH
sample_rate = 16000 # 16kHz
=======
try:
sample_rate = int(self.sd.query_devices(None, 'input')['default_samplerate'])
except (TypeError, ValueError):
sample_rate = 16000 # fallback to 16kHz if unable to query device
>>>>>>> REPLACE
```
This change:
1. Attempts to query the default sample rate of the input device using sounddevice's `query_devices()` function.
2. If successful, it uses that sample rate.
3. If it fails to get a valid sample rate, it falls back to the original 16kHz.
This should allow aider to automatically adapt to the microphone's supported sample rate in most cases, while still having a reasonable fallback.
Let me know if you would like me to explain or modify the changes further.
2024-06-04 10:27:22 -07:00
youknow
80f1a868ff
remove unnecessary return
2024-05-31 03:02:07 +09:00
Paul Gauthier
ad2312ad7b
handle missing end_lineno attr #619
2024-05-29 15:55:55 -07:00
Paul Gauthier
0da01dacb6
ssh
2024-05-29 15:51:29 -07:00
Paul Gauthier
17dcfd94f7
+Only include the files
2024-05-25 18:58:37 -07:00
Paul Gauthier
0e71d262e3
change error message
2024-05-24 13:34:51 -07:00
Paul Gauthier
d48edfcd00
fix missing env
2024-05-24 12:59:48 -07:00
Paul Gauthier
d41bf592a0
Set GIT_EDITOR environment variable only if it is not already set.
2024-05-24 12:43:53 -07:00
Aleksandr Bobrov
231fa46125
Update cmd_commit method signature to accept an optional args parameter.
2024-05-24 14:57:42 +04:00
Aleksandr Bobrov
311ae04314
aider: Fix issue in cmd_commit
to set commit_message
to None
if args
does not exist.
...
# Aider chat conversation:
USER: I did `git reset --hard HEAD~1` to discard the last edits. Please wait for further instructions before attempting that change again. Feel free to ask relevant questions about why the changes were reverted.
ASSISTANT: Understood. If you have any specific instructions or changes you would like to make, please let me know!
USER: in `cmd_commit` issue if args not exist please fix, as leave commit_message as None
ASSISTANT: To fix the issue in `cmd_commit` when `args` does not exist, we need to ensure that `commit_message` is set to `None` if `args` is not provided. Here are the changes:
1. Check if `args` is provided and set `commit_message` to `None` if it is not.
Here is the *SEARCH/REPLACE* block:
aider/commands.py
<source>python
<<<<<<< SEARCH
commit_message = args.strip()
=======
commit_message = args.strip() if args else None
>>>>>>> REPLACE
</source>
2024-05-24 14:52:40 +04:00
Paul Gauthier
52ac35fcd2
restore --show-diffs functionality #607
2024-05-23 14:07:20 -07:00
Paul Gauthier
2ed5e45677
fixed #603
2024-05-23 14:01:45 -07:00
Paul Gauthier
a395d9bb5c
fix double lines for confirm_ask
2024-05-23 13:55:53 -07:00
Paul Gauthier
cda9565cae
aider: Handle IsADirectoryError when trying to create a file where a directory exists.
...
# Aider chat conversation:
USER: https://github.com/paul-gauthier/aider/issues/606
https://github.com/paul-gauthier/aider/issues/606 :
[Skip to content](#start-of-content)
## Navigation Menu
Toggle navigation
[](https://github.com/ )
[Sign
in](/login?return_to=https%3A%2F%2Fgithub.com%2Fpaul-gauthier%2Faider%2Fissues%2F606)
- Product
- [](https://github.com/features/actions )
Actions
Automate any workflow
- [](https://github.com/features/packages )
Packages
Host and manage packages
- [](https://github.com/features/security )
Security
Find and fix vulnerabilities
- [](https://github.com/features/codespaces )
Codespaces
Instant dev environments
- [](https://github.com/features/copilot )
Copilot
Write better code with AI
- [](https://github.com/features/code-review )
Code review
Manage code changes
- [](https://github.com/features/issues )
Issues
Plan and track work
- [](https://github.com/features/discussions )
Discussions
Collaborate outside of code
Explore
- [All features](https://github.com/features )
- [Documentation](https://docs.github.com )
- [GitHub Skills](https://skills.github.com )
- [Blog](https://github.blog )
- Solutions
For
- [Enterprise](https://github.com/enterprise )
- [Teams](https://github.com/team )
- [Startups](https://github.com/enterprise/startups )
- [Education](https://education.github.com )
By Solution
- [CI/CD & Automation](https://github.com/solutions/ci-cd )
- [DevOps](https://github.com/solutions/devops )
- [DevSecOps](https://resources.github.com/devops/fundamentals/devsecops )
Resources
- [Learning Pathways](https://resources.github.com/learn/pathways )
- [White papers, Ebooks, Webinars](https://resources.github.com )
- [Customer Stories](https://github.com/customer-stories )
- [Partners](https://partner.github.com )
- Open Source
- [](https://github.com/sponsors )
GitHub Sponsors
Fund open source developers
- [](https://github.com/readme )
The ReadME Project
GitHub community articles
Repositories
- [Topics](https://github.com/topics )
- [Trending](https://github.com/trending )
- [Collections](https://github.com/collections )
- [Pricing](https://github.com/pricing )
Search or jump to\...
# Search code, repositories, users, issues, pull requests\...
Search
Clear
[Search syntax
tips](https://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax )
# Provide feedback
We read every piece of feedback, and take your input very seriously.
Include my email address so I can be contacted
Cancel
Submit feedback
# Saved searches
## Use saved searches to filter your results more quickly
Name
Query
To see all available qualifiers, see our
[documentation](https://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax ).
Cancel
Create saved search
[Sign
in](/login?return_to=https%3A%2F%2Fgithub.com%2Fpaul-gauthier%2Faider%2Fissues%2F606)
[Sign
up](/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=paul-gauthier%2Faider)
You signed in with another tab or window. [Reload]() to refresh your
session. You signed out in another tab or window. [Reload]() to refresh
your session. You switched accounts on another tab or window. [Reload]()
to refresh your session.
Dismiss alert
{{ message }}
::: {role="main"}
[paul-gauthier](/paul-gauthier) / **[aider](/paul-gauthier/aider)**
Public
- [Notifications](/login?return_to=%2Fpaul-gauthier%2Faider)
- [Fork 1k](/login?return_to=%2Fpaul-gauthier%2Faider)
-
[ Star 10.2k](/login?return_to=%2Fpaul-gauthier%2Faider)
- [Code ](/paul-gauthier/aider)
- [Issues 55](/paul-gauthier/aider/issues)
- [Pull requests 8](/paul-gauthier/aider/pulls)
- [Actions ](/paul-gauthier/aider/actions)
- [Projects 0](/paul-gauthier/aider/projects)
- [Security](/paul-gauthier/aider/security)
- [Insights ](/paul-gauthier/aider/pulse)
Additional navigation options
- [ Code ](/paul-gauthier/aider)
- [ Issues ](/paul-gauthier/aider/issues)
- [ Pull requests ](/paul-gauthier/aider/pulls)
- [ Actions ](/paul-gauthier/aider/actions)
- [ Projects ](/paul-gauthier/aider/projects)
- [ Security ](/paul-gauthier/aider/security)
- [ Insights ](/paul-gauthier/aider/pulse)
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.
[Sign up for
GitHub](/signup?return_to=%2Fpaul-gauthier%2Faider%2Fissues%2Fnew%2Fchoose)
By clicking "Sign up for GitHub", you agree to our [terms of
service](https://docs.github.com/terms ) and [privacy
statement](https://docs.github.com/privacy ). We'll occasionally send you
account related emails.
Already on GitHub? [Sign
in](/login?return_to=%2Fpaul-gauthier%2Faider%2Fissues%2Fnew%2Fchoose)
to your account
[Jump to bottom](#issue-comment-box)
# Trying to create a file where a directory exists causes IsADirectoryError and aider to exit #606
Open
[harleypig](/harleypig) opened this issue May 18, 2024 · 0 comments
Open
# [Trying to create a file where a directory exists causes IsADirectoryError and aider to exit](#top) #606
[harleypig](/harleypig) opened this issue May 18, 2024 · 0 comments
Labels
[bug](/paul-gauthier/aider/labels/bug) Something isn\'t working
## Comments
[](/harleypig)
Copy link
###
**[harleypig](/harleypig)** commented [May 18, 2024](#issue-2304113184)
•
edited
+-----------------------------------------------------------------------+
| ### Issue |
| |
| I wasn\'t thinking and asked aider to create a file with the same |
| name as a directory and got unexpectedly dumped back to the command |
| line. |
| |
| |
| |
| $ mkdir -p testoops/oops |
| $ cd testoops |
| $ aider |
| Aider v0.35.0 |
| |
| Models: openai/gpt-4o with diff edit format, weak model gpt- |
| 3.5-turbo |
| Git repo: .git with 0 files |
| |
| Repo-map: using 2048 tokens |
| |
| Use /help to see in-chat commands, run with --help to see cm |
| d line args |
| ──────────────────────────────────────────────────────────── |
| ───────────────────────────────────────────────────────────────────── |
| > Create a text file named './oops' that has 'this wont work |
| ' |
| |
| Here is the SEARCH/REPLACE block to create the file ./oops w |
| ith the content this wont work: |
| |
| ./oops |
| |
| |
| |
| <<<<<<< SEARCH |
| |
| ======= |
| |
| this wont work |
| |
| >>>>>>> REPLACE |
| |
| |
| |
| |
| |
| Allow edits to ./oops which was not previously added to chat? y |
| Committing ./oops before applying edits. |
| Cmd('git') failed due to: exit code(1) |
| cmdline: git commit -m Add |
| ed ./oops file. --no-verify -- /home/harleypig/projects/testoops/oops |
| stderr: 'error: pathspec '/home/harl |
| eypig/projects/testoops/oops' did not match any file(s) known to git' |
| ──────────────────────────────────────────────────────────── |
| ───────────────────────────────────────────────────────────────────── |
| Traceback (most recent call last): |
| File "/usr/local/bin/aider", line 8, in <module> |
| sys.exit(main()) |
| File "/home/harleypig/.local/share/ |
| python/lib/python3.10/site-packages/aider/main.py", line 408, in main |
| coder.run() |
| File "/home/harleypig/.local/share/python/lib/p |
| ython3.10/site-packages/aider/coders/base_coder.py", line 496, in run |
| new_user_message = self.run_loop() |
| File "/home/harleypig/.local/share/python/lib/python |
| 3.10/site-packages/aider/coders/base_coder.py", line 512, in run_loop |
| inp = self.io.get_input( |
| File "/home/harleypig/.local/share/pyt |
| hon/lib/python3.10/site-packages/aider/io.py", line 210, in get_input |
| completer_instance = AutoCompleter( |
| File "/home/harleypig/.local/share/p |
| ython/lib/python3.10/site-packages/aider/io.py", line 47, in __init__ |
| with open(fname, "r", encoding=self.encoding) as f: |
| IsADirectoryError |
| : [Errno 21] Is a directory: '/home/harleypig/projects/testoops/oops' |
| |
| |
| |
| |
| |
| |
| |
| ### Version and model info |
| |
| In example above. |
+-----------------------------------------------------------------------+
| |
| |
| The text was updated successfully, but these errors were encountered: |
| |
| |
+-----------------------------------------------------------------------+
All reactions
[paul-gauthier](/paul-gauthier) added the
[bug](/paul-gauthier/aider/labels/bug) Something isn\'t working label
[May 20, 2024](#event-12868798902)
[Sign up for free](/join?source=comment-repo) **to join this
conversation on GitHub**. Already have an account? [Sign in to
comment](/login?return_to=https%3A%2F%2Fgithub.com%2Fpaul-gauthier%2Faider%2Fissues%2F606)
Assignees
No one assigned
Labels
[bug](/paul-gauthier/aider/labels/bug) Something isn\'t working
Projects
None yet
Milestone
No milestone
Development
No branches or pull requests
2 participants
:::
## Footer
[](https://github.com ) © 2024 GitHub, Inc.
### Footer navigation
- [Terms](https://docs.github.com/site-policy/github-terms/github-terms-of-service )
- [Privacy](https://docs.github.com/site-policy/privacy-policies/github-privacy-statement )
- [Security](https://github.com/security )
- [Status](https://www.githubstatus.com/ )
- [Docs](https://docs.github.com/ )
- [Contact](https://support.github.com?tags=dotcom-footer )
- Manage cookies
- Do not share my personal information
You can't perform that action at this time.
ASSISTANT: To address the issue of `IsADirectoryError` when trying to create a file where a directory exists, we need to handle this exception in the relevant part of the code. The most likely file to need changes is `aider/io.py`.
Please add `aider/io.py` to the chat so I can propose the necessary changes.
USER: I added these files to the chat: aider/io.py.
If you need to propose edits to other existing files not already added to the chat, you *MUST* tell the me their full path names and ask me to *add the files to the chat*. End your reply and wait for my approval. You can keep asking if you then decide you need to edit more files.
ASSISTANT: To handle the `IsADirectoryError` when trying to create a file where a directory exists, we need to catch this exception and handle it appropriately in the `get_input` method of the `InputOutput` class in `aider/io.py`.
Here are the changes:
aider/io.py
```python
<<<<<<< SEARCH
try:
with open(fname, "r", encoding=self.encoding) as f:
content = f.read()
except (FileNotFoundError, UnicodeDecodeError):
continue
=======
try:
with open(fname, "r", encoding=self.encoding) as f:
content = f.read()
except (FileNotFoundError, UnicodeDecodeError, IsADirectoryError):
continue
>>>>>>> REPLACE
```
This change will ensure that if the code tries to open a directory as if it were a file, it will catch the `IsADirectoryError` and continue without crashing.
2024-05-23 13:48:44 -07:00
Paul Gauthier
a4a6066858
handle missing max_map_tokens/max_context_window
2024-05-23 13:46:08 -07:00
Paul Gauthier
6345cd3734
cleanup
2024-05-23 13:43:35 -07:00
Paul Gauthier
fb76895eb1
Merge branch 'main' into swe-bench
2024-05-23 13:36:23 -07:00
Paul Gauthier
a405defcff
ask for confirmation
2024-05-22 21:27:59 -07:00