aidev icon indicating copy to clipboard operation
aidev copied to clipboard

aidev call seems to hang forever

Open oliverswitzer opened this issue 2 years ago • 2 comments

UPDATE:

I was able to bypass the issue where aidev hangs by passing the -p flag instead of using the interactive prompt.

However, two other issues arose. Here's a summary of what I discussed in comments below:

  • aidev complains that the gpt-4 model doesn't exist. I bypassed this by supplying -gpt35 as a flag
  • with the prompt: "Add a development section to test/README.md", aidev creates a README.md.draft file that lists instructions rather than an updated README.md file. (note: I created a test directory because I was running into the token limit when trying to modify the README.md at the root of the project)

=== OLD ISSUE:

Hi! I think this tool has a ton of promise so I really wanted to try it.

However, I am running into an issue trying to build and run the command locally.

To build, I am using Go 1.20, and running from the top level of the project after cloning:

$ go build -o aidev

Which produces an aidev binary.

Then, I create an OPENAI_API_KEY env var and set it via a .env file with my API key (I have direnv installed as well which I have confirmed properly sources the .env file).

running it:

$ ./aidev

My prompt is: "Add the words 'Hello' to the README.md"

❯ ./aidev
12 ignored:
        .aidev
        .env
        .envrc
        .git/
        .gitignore
        LICENSE
        go.mod
        go.sum
        internal/
        modd.conf
        prompt-apply.txt
        prompt.txt
8 files matched:
        README.md
        ignore.go
        ignore_test.go
        load.go
        main.go
        parse.go
        treeconf.go
        util.go
Code tokens: 9000, max for gpt-4: 8192.
Prompt? (end with EOF)
Add "Hello" to the README

It seems to just hang after running this. So far is been running for 10 minutes.

Any thoughts about things I could check to debug what's going on?

oliverswitzer avatar Apr 26 '23 20:04 oliverswitzer

Actually, I did seem to get further by instead using the -p prompt. However, the first error I ran into was:

❯ ./aidev -p "Add the world 'hello' to the README"
12 ignored:
        .aidev
        .env
        .envrc
        .git/
        .gitignore
        LICENSE
        go.mod
        go.sum
        internal/
        modd.conf
        prompt-apply.txt
        prompt.txt
8 files matched:
        README.md
        ignore.go
        ignore_test.go
        load.go
        main.go
        parse.go
        treeconf.go
        util.go
Code tokens: 9000, max for gpt-4: 8192.
Prompt tokens: 9192, with completions: 11240, max for gpt-4: 8192.
WARNING: prompt exceeds gpt-4 capacity.
Talking to gpt-4...
** ERROR: Chat: HTTP 404: invalid_request_error: The model: `gpt-4` does not exist

oliverswitzer avatar Apr 26 '23 21:04 oliverswitzer

So I still don't understand why I am getting that particular error, but I managed to get the -gpt35 flag working and avoiding the max token limit by pointing to a smaller directory called test and making a README.md file in there:

So, create test/README.md that is an empty file.

Then, prompt aidev:

$ ./aidev -p "Add a development section to the README" -d test -gpt35

I see two new files appear in that directory, as per the aidev readme guide:

FILES.draft:

README.md

README.md.draft:


Add development section to the README

1. Open the README file
2. Scroll to the bottom of the file
3. Add a new section titled "Development"
4. Under the "Development" section, add any relevant information about the development process, such as how to contribute to the project, how to set up a development environment, and any coding standards or guidelines that contributors should follow.

These look great! However, the original README.md file is still empty :(

README.md:


So it appears to not actually write to the README.md file for some reason 🤔 . Any thoughts? Apologies, I realize the title of this issue is not exactly accurate any more. Happy to move this to a new issue, or rename this one?

EDIT: Ok I was a bit confused because it appeared that README.md.draft was a set of instructions that aidev was meant to follow and execute on, but according to the aidev readme, it appears that this is meant to be the "updated" version of the README.md that I asked it to modify, and the original README.md is not ever modified by aidev... but I'm still a tad confused as to why the draft README is just a set of instructions and not the actual updated README... Any ideas?

oliverswitzer avatar Apr 26 '23 21:04 oliverswitzer