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: init repo custom branch, memories gitignore exclusion dot files … #120

Merged
merged 1 commit into from
Dec 17, 2024

Conversation

snobbee
Copy link
Collaborator

@snobbee snobbee commented Dec 17, 2024

It is currently not in a state to interpret the memories loaded from the files and do an action for example. Consider the files you have memories for and create an issue around ways to improve logging for example (this would be handled by the client work I imagine)

I tested this use case with the following prompt:

You: Create an issue in repository sifchain/stf-nomic-game to define a task to update the ARCHITECTURE.md file to include the CLEAN architecture. Include the current ARCHITECTURE.md content within the issue description.

See resulting issue here Sifchain/stf-nomic-game#37

And indeed the action does not retrieve the memory, I can update the action in order to read the memory to match the memory name in this instance: ARCHITECTURE.md, but I am also curious about how we can design that flow using the github client.

even with most permissible fine grain access token get error when try to create an issue for Sifchain/sa-eliza or ai16z/eliza (repos I don't own) works for monilpat/eliza (could be settings in the two repos preventing issues being created a certain way),

You: Create an issue in repository ai16z/eliza titled 'Bug: Application crashes on startup'

issue created with a new github token (token classic) with only one scope "public_repo" enabled.

issue created: elizaOS#1173 (closed the ticket manually)

 ["ℹ Executing handler for action: CREATE_ISSUE"] 

 ◎ LOGS
   Composing state for message: 
   {"id":"83e7fb39-4f13-0392-b1c5-874483cbfcb2","agentId":"1b200cce-e5b5-0d90-bbf3-f0dce0a8dafd","userId":"12dea96f-ec20-0935-a6ab-75692c994959","roomId":"6f6b9c28-b0e0-0e30-86a3-8154524fbd2b","content":{"text":"You: Create an issue in repository ai16z/eliza titled 'Bug: Application crashes on startup'","attachments":[],"source":"direct"},"createdAt":1734431691738} 

 ["ℹ Creating issue in the repository..."] 

 ["ℹ Created issue successfully! Issue number: 1172"] 

 ["◎ Agent: Creating an issue titled 'Bug: Application crashes on startup' is an important step in addressing critical failures. It’s essential to include detailed logging information in the issue, such as the error codes and any relevant stack traces. Would you like to specify any additional details or labels for this issue to enhance its clarity and traceability?"] 

 ["◎ Agent: Created issue #1172 successfully!"] 

noticed that clone was using only main branch

Following a fix, init repo works with both main and custom branches

You: Initialize the repository sifchain/stf-nomic-game on master branch

repo cloned:

 ["ℹ Executing handler for action: INITIALIZE_REPOSITORY"] 

 ◎ LOGS
   Composing state for message: 
   {"id":"39ff4548-b687-061c-822b-1876b675d485","agentId":"1b200cce-e5b5-0d90-bbf3-f0dce0a8dafd","userId":"12dea96f-ec20-0935-a6ab-75692c994959","roomId":"6f6b9c28-b0e0-0e30-86a3-8154524fbd2b","content":{"text":"Initialize the repository sifchain/stf-nomic-game on master branch","attachments":[],"source":"direct"},"createdAt":1734428253851} 

 ["ℹ Initializing repository sifchain/stf-nomic-game on branch master"] 

 ["ℹ Repository path: /tmp/eliza/agent/.repos/sifchain/stf-nomic-game"] 

 ["ℹ Cloning or pulling repository sifchain/stf-nomic-game... @ branch: master"] 

 ["ℹ URL: https://github.com/sifchain/stf-nomic-game.git @ branch: master"] 

 ["ℹ Checking out branch master in repository /tmp/eliza/agent/.repos/sifchain/stf-nomic-game"] 

 ["ℹ Repository initialized successfully! URL: https://github.com/sifchain/stf-nomic-game @ branch: master"] 

createMemoriesFromFiles fails for some file types, buggy looks like path is required here you probably want to be able to initialize a whole repo (seems like path is required) and exclude certain file types

Following a fix, create memories from files with initialized repo with a custom branch retrieved all files minus the .gitignore and .git files

You: Create memories from files on repository sifchain/stf-nomic-game at path '/'

files retrieved:

 ["ℹ Retrieved Files:
/tmp/eliza/agent/.repos/sifchain/stf-nomic-game/pyproject.toml
/tmp/eliza/agent/.repos/sifchain/stf-nomic-game/pre-commit-config.yaml
/tmp/eliza/agent/.repos/sifchain/stf-nomic-game/poetry.lock
/tmp/eliza/agent/.repos/sifchain/stf-nomic-game/migration.py
/tmp/eliza/agent/.repos/sifchain/stf-nomic-game/entrypoint.sh
/tmp/eliza/agent/.repos/sifchain/stf-nomic-game/docker-compose.yml
/tmp/eliza/agent/.repos/sifchain/stf-nomic-game/alembic.ini
/tmp/eliza/agent/.repos/sifchain/stf-nomic-game/README.md
/tmp/eliza/agent/.repos/sifchain/stf-nomic-game/Makefile
/tmp/eliza/agent/.repos/sifchain/stf-nomic-game/Dockerfile
/tmp/eliza/agent/.repos/sifchain/stf-nomic-game/ARCHITECTURE.md
/tmp/eliza/agent/.repos/sifchain/stf-nomic-game/.gitignore
/tmp/eliza/agent/.repos/sifchain/stf-nomic-game/.env.example
/tmp/eliza/agent/.repos/sifchain/stf-nomic-game/tests/test_websockets.py
/tmp/eliza/agent/.repos/sifchain/stf-nomic-game/tests/test_list_rules.py
/tmp/eliza/agent/.repos/sifchain/stf-nomic-game/tests/test_list_games.py
/tmp/eliza/agent/.repos/sifchain/stf-nomic-game/tests/test_full_game_flow.py
/tmp/eliza/agent/.repos/sifchain/stf-nomic-game/tests/__init__.py
/tmp/eliza/agent/.repos/sifchain/stf-nomic-game/scripts/connect-ws.py
/tmp/eliza/agent/.repos/sifchain/stf-nomic-game/nomic/main.py
/tmp/eliza/agent/.repos/sifchain/stf-nomic-game/nomic/config.py
/tmp/eliza/agent/.repos/sifchain/stf-nomic-game/nomic/__init__.py
/tmp/eliza/agent/.repos/sifchain/stf-nomic-game/alembic/script.py.mako
/tmp/eliza/agent/.repos/sifchain/stf-nomic-game/alembic/env.py
/tmp/eliza/agent/.repos/sifchain/stf-nomic-game/alembic/README
/tmp/eliza/agent/.repos/sifchain/stf-nomic-game/.githooks/pre-commit
/tmp/eliza/agent/.repos/sifchain/stf-nomic-game/nomic/utils/security.py
/tmp/eliza/agent/.repos/sifchain/stf-nomic-game/nomic/utils/roll_dice.py
/tmp/eliza/agent/.repos/sifchain/stf-nomic-game/nomic/utils/jwt_handler.py
/tmp/eliza/agent/.repos/sifchain/stf-nomic-game/nomic/utils/__init__.py
/tmp/eliza/agent/.repos/sifchain/stf-nomic-game/nomic/services/game.py
/tmp/eliza/agent/.repos/sifchain/stf-nomic-game/nomic/services/__init__.py
/tmp/eliza/agent/.repos/sifchain/stf-nomic-game/nomic/routes/ws.py
/tmp/eliza/agent/.repos/sifchain/stf-nomic-game/nomic/routes/vote_rule_proposal.py
/tmp/eliza/agent/.repos/sifchain/stf-nomic-game/nomic/routes/take_action.py
/tmp/eliza/agent/.repos/sifchain/stf-nomic-game/nomic/routes/start_game.py
/tmp/eliza/agent/.repos/sifchain/stf-nomic-game/nomic/routes/register.py
/tmp/eliza/agent/.repos/sifchain/stf-nomic-game/nomic/routes/propose_rule.py
/tmp/eliza/agent/.repos/sifchain/stf-nomic-game/nomic/routes/login.py
/tmp/eliza/agent/.repos/sifchain/stf-nomic-game/nomic/routes/list_rule_proposals.py
/tmp/eliza/agent/.repos/sifchain/stf-nomic-game/nomic/routes/list_games.py
/tmp/eliza/agent/.repos/sifchain/stf-nomic-game/nomic/routes/join_game.py
/tmp/eliza/agent/.repos/sifchain/stf-nomic-game/nomic/routes/home.py
/tmp/eliza/agent/.repos/sifchain/stf-nomic-game/nomic/routes/get_game.py
/tmp/eliza/agent/.repos/sifchain/stf-nomic-game/nomic/routes/end_turn.py
/tmp/eliza/agent/.repos/sifchain/stf-nomic-game/nomic/routes/create_game.py
/tmp/eliza/agent/.repos/sifchain/stf-nomic-game/nomic/routes/__init__.py
/tmp/eliza/agent/.repos/sifchain/stf-nomic-game/nomic/database/schemas.py
/tmp/eliza/agent/.repos/sifchain/stf-nomic-game/nomic/database/crud.py
/tmp/eliza/agent/.repos/sifchain/stf-nomic-game/nomic/database/__init__.py
/tmp/eliza/agent/.repos/sifchain/stf-nomic-game/alembic/versions/50ec82c4ef4d_create_tables.py
/tmp/eliza/agent/.repos/sifchain/stf-nomic-game/nomic/database/models/user.py
/tmp/eliza/agent/.repos/sifchain/stf-nomic-game/nomic/database/models/rule_proposal_vote.py
/tmp/eliza/agent/.repos/sifchain/stf-nomic-game/nomic/database/models/rule_proposal.py
/tmp/eliza/agent/.repos/sifchain/stf-nomic-game/nomic/database/models/rule.py
/tmp/eliza/agent/.repos/sifchain/stf-nomic-game/nomic/database/models/player_action.py
/tmp/eliza/agent/.repos/sifchain/stf-nomic-game/nomic/database/models/game_player.py
/tmp/eliza/agent/.repos/sifchain/stf-nomic-game/nomic/database/models/game.py
/tmp/eliza/agent/.repos/sifchain/stf-nomic-game/nomic/database/models/__init__.py"] 


 ["ℹ Ignore patterns:
**/.git/**
**/.mypy_cache/
**/.pytest_cache/
**/.ruff_cache/
**/__pycache__/
**/.venv/
**/*-skip
**/.env"] 

create commit works for own repo but commits directly on main and creates a dummy change to readme, should add logic to support creating branch,
there is no action to actually make code changes at the moment,

Following a fix, now the create commit action requests the targeted branch as well and push to this specific branch.

The prompt below also successfully requests to create a new file with a specific content.

You: Commit changes to the repository snobbee/test-repo on branch 'patch-548' with the commit message: 'Dummy message' with those new files: path: doc.md content: My new Doc
 ["ℹ Executing handler for action: CREATE_COMMIT"] 

 ◎ LOGS
   Composing state for message: 
   {"id":"6c077c92-1130-03d8-8788-404267f93d04","agentId":"1b200cce-e5b5-0d90-bbf3-f0dce0a8dafd","userId":"12dea96f-ec20-0935-a6ab-75692c994959","roomId":"6f6b9c28-b0e0-0e30-86a3-8154524fbd2b","content":{"text":"Commit changes to the repository snobbee/test-repo on branch 'patch-548' with the commit message: 'Dummy message' with those new files: path: doc.md content: My new Doc","attachments":[],"source":"direct"},"createdAt":1734435681163} 

 ["ℹ Committing changes to the repository snobbee/test-repo on branch patch-548..."] 

 ["ℹ Checking out branch patch-548 in repository /tmp/eliza/agent/.repos/snobbee/test-repo"] 
 [...]
$ git status
On branch patch-548
nothing to commit, working tree clean

$ git log
commit 2546ad7a37dd0be63810b1a16bfa8773f0763893 (HEAD -> patch-548)
Author: Snobbish Bee <[email protected]>
Date:   Tue Dec 17 12:41:26 2024 +0100

    Dummy message

commit 4ad1925628c6b80830756e983197503ab3f9ec87 (origin/main, origin/HEAD, main)
Author: Snobbish Bee <[email protected]>
Date:   Tue Jan 23 16:07:45 2024 +0100

    Initial commit

$ cat doc.md 
My new Doc%                                                      

issue with creating pull request error creating a new branch or checking out an existing branch when creating a pull request,

Following a fix, now the create pull request action requests the files content and commit and push to expected branch.

You: Create a pull request on repository snobbee/test-repo with branch 'fix/something', title 'fix: something' and files 'docs/architecture.md' '# Architecture Documentation'
$ git status
On branch fix/something
nothing to commit, working tree clean

$ git log
commit 946e5925f9849e4a375e9e9f74ed32299e3d22a3 (HEAD -> fix/something)
Author: Snobbish Bee <[email protected]>
Date:   Tue Dec 17 13:03:15 2024 +0100

    fix: something

commit 4ad1925628c6b80830756e983197503ab3f9ec87 (origin/main, origin/HEAD, main)
Author: Snobbish Bee <[email protected]>
Date:   Tue Jan 23 16:07:45 2024 +0100

    Initial commit

$ cat docs/architecture.md 
# Architecture Documentation%                                         

Can't comment on PRs

You: Add a comment to issue #1019 in repository ai16z/eliza: 'Test comment'

Added comment to PR successfully: elizaOS#1019 (comment)

with a github token with the following permissions:

"Issues" repository permissions (write)
"Pull requests" repository permissions (write)
 ["ℹ Executing handler for action: ADD_COMMENT_TO_ISSUE"] 

 ◎ LOGS
   Composing state for message: 
   {"id":"72e26392-d0fb-075e-b623-08b3fcdb9508","agentId":"1b200cce-e5b5-0d90-bbf3-f0dce0a8dafd","userId":"12dea96f-ec20-0935-a6ab-75692c994959","roomId":"6f6b9c28-b0e0-0e30-86a3-8154524fbd2b","content":{"text":"Add a comment to issue #1019 in repository ai16z/eliza: 'Test comment'","attachments":[],"source":"direct"},"createdAt":1734438149442} 

 ["ℹ Adding comment to issue in the repository..."] 

 ["ℹ Added comment to issue #1019 successfully!"] 

…inclusion, create commit custom branch, create PR files and custom branch
@monilpat
Copy link
Collaborator

monilpat commented Dec 17, 2024

Note this doesn't work with the fine grain token: Issue created with a new github token (token classic) with only one scope "public_repo" enabled. Which is what I tested

@monilpat
Copy link
Collaborator

Good to merge these in so can build on top of feel free to address the comments in a subsequent PR

@monilpat monilpat merged commit 39921fe into sif-dev Dec 17, 2024
2 of 4 checks passed
@monilpat monilpat deleted the fix/github-actions branch December 17, 2024 17:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants