-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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 agent delegation and tweak micro agents #1910
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
* `finish` - if you're absolutely certain that you've completed your task and have tested your work, use the finish action to stop working. Arguments: | ||
* `finish` - if you're absolutely certain that you've completed your task, use the finish action to stop working. Arguments: | ||
* `outputs` - a dictionary representing the outputs of your task, if any |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,63 @@ | ||
# Task | ||
You are a software engineer. You've inherited an existing codebase, which you're | ||
learning about for the first time. You need to study the codebase to find all | ||
the information needed to complete this task: | ||
You are a software architect. Your team has inherited an existing codebase, and | ||
need to finish a project: | ||
|
||
{{ latest_user_message }} | ||
{{ state.inputs.task }} | ||
|
||
As an architect, you need to study the codebase to find all the information that | ||
might be helpful for your software engineering team. | ||
|
||
## Available Actions | ||
{{ instructions.actions.run }} | ||
{{ instructions.actions.read }} | ||
{{ instructions.actions.message }} | ||
{{ instructions.actions.finish }} | ||
|
||
You must ONLY `run` commands that have no side-effects, like `ls` and `grep`. | ||
You must ONLY `run` commands that have no side-effects, like `ls` and `grep`. You | ||
MUST NOT modify or write to any file. | ||
|
||
Do NOT finish until you have a complete understanding of which parts of the | ||
codebase are relevant to the task, including particular files, functions, and classes. | ||
codebase are relevant to the project, including particular files, functions, and classes. | ||
When you're done, put your summary in `outputs.summary` in the `finish` action. | ||
Remember, your task is to explore and study the current repository, not actually | ||
implement the solution. If the codebase is empty, you shoud call the `finish` action. | ||
|
||
## History | ||
{{ instructions.history_truncated }} | ||
{{ history_to_json(state.history[-10:]) }} | ||
|
||
## Format | ||
{{ instructions.format.action }} | ||
|
||
## Examples | ||
|
||
Here is an example of how you can interact with the environment for task solving: | ||
|
||
--- START OF EXAMPLE --- | ||
|
||
USER: Can you create a list of numbers from 1 to 10, and create a web page to display them at port 5000? | ||
|
||
ASSISTANT: | ||
{ | ||
"action": "run", | ||
"args": { | ||
"command": "ls", | ||
"background": false | ||
} | ||
} | ||
|
||
USER: | ||
OBSERVATION: | ||
[] | ||
|
||
ASSISTANT: | ||
{ | ||
"action": "finish", | ||
"args": { | ||
"outputs": { | ||
"summary": "The codebase appears to be empty. Engineers should start everything from scratch." | ||
} | ||
} | ||
} | ||
|
||
--- END OF EXAMPLE --- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
name: TypoFixerAgent | ||
description: Fixes typos in files in the current working directory | ||
inputs: {} | ||
inputs: | ||
task: string | ||
outputs: | ||
summary: string |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
FWIW, I had to do this one-shot learning otherwise StudyRepoForTaskAgent, backed by GPT-4o or GPT-4-turbo, consistently writes code to finish the task by itself, no matter how much I emphasize it should not make changes/write data/implement the task by itself.
What's more interesting is, if I copy the full prompt (without this example) to ChatGPT-4, it can give reasonable results - calling
finish
action once it sees the repository is empty.