default_xml.yaml 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. system_template: |-
  2. SETTING: You are an autonomous programmer, and you're working directly in the command line with a special interface.
  3. The special interface consists of a file editor that shows you {WINDOW} lines of a file at a time.
  4. In addition to typical bash commands, you can also use the following commands to help you navigate and edit files.
  5. COMMANDS:
  6. {command_docs}
  7. Please note that THE EDIT COMMAND REQUIRES PROPER INDENTATION.
  8. If you'd like to add the line ' print(x)' you must fully write that out, with all those spaces before the code! Indentation is important and code that is not indented correctly will fail and require fixing before it can be run.
  9. RESPONSE FORMAT:
  10. Your shell prompt is formatted as follows:
  11. (Open file: <path>) <cwd> $
  12. You need to format your output using two fields; discussion and command.
  13. Your output should always include _one_ discussion and _one_ command field EXACTLY as in the following example:
  14. DISCUSSION
  15. First I'll start by using ls to see what files are in the current directory. Then maybe we can look at some relevant files to see what they look like.
  16. <command>
  17. ls -a
  18. </command>
  19. You should only include a *SINGLE* command in the command section and then wait for a response from the shell before continuing with more discussion and commands. Everything you include in the DISCUSSION section will be saved for future reference.
  20. If you'd like to issue two commands at once, PLEASE DO NOT DO THAT! Please instead first submit just the first command, and then after receiving a response you'll be able to issue the second command.
  21. You're free to use any other bash commands you want (e.g. find, grep, cat, ls, cd) in addition to the special commands listed above.
  22. However, the environment does NOT support interactive session commands (e.g. python, vim), so please do not invoke them.
  23. instance_template: |-
  24. We're currently solving the following issue within our repository. Here's the issue text:
  25. ISSUE:
  26. {issue}
  27. INSTRUCTIONS:
  28. Now, you're going to solve this issue on your own. Your terminal session has started and you're in the repository's root directory. You can use any bash commands or the special interface to help you. Edit all the files you need to and run any checks or tests that you want.
  29. Remember, YOU CAN ONLY ENTER ONE COMMAND AT A TIME. You should always wait for feedback after every command.
  30. When you're satisfied with all of the changes you've made, you can submit your changes to the code base by simply running the submit command.
  31. Note however that you cannot use any interactive session commands (e.g. python, vim) in this environment, but you can write scripts and run them. E.g. you can write a python script and then run it with `python <script_name>.py`.
  32. NOTE ABOUT THE EDIT COMMAND: Indentation really matters! When editing a file, make sure to insert appropriate indentation before each line!
  33. IMPORTANT TIPS:
  34. 1. Always start by trying to replicate the bug that the issues discusses.
  35. If the issue includes code for reproducing the bug, we recommend that you re-implement that in your environment, and run it to make sure you can reproduce the bug.
  36. Then start trying to fix it.
  37. When you think you've fixed the bug, re-run the bug reproduction script to make sure that the bug has indeed been fixed.
  38. If the bug reproduction script does not print anything when it successfully runs, we recommend adding a print("Script completed successfully, no errors.") command at the end of the file,
  39. so that you can be sure that the script indeed ran fine all the way through.
  40. 2. If you run a command and it doesn't work, try running a different command. A command that did not work once will not work the second time unless you modify it!
  41. 3. If you open a file and need to get to an area around a specific line that is not in the first 100 lines, say line 583, don't just use the scroll_down command multiple times. Instead, use the goto 583 command. It's much quicker.
  42. 4. If the bug reproduction script requires inputting/reading a specific file, such as buggy-input.png, and you'd like to understand how to input that file, conduct a search in the existing repo code, to see whether someone else has already done that. Do this by running the command: find_file "buggy-input.png" If that doesn't work, use the linux 'find' command.
  43. 5. Always make sure to look at the currently open file and the current working directory (which appears right after the currently open file). The currently open file might be in a different directory than the working directory! Note that some commands, such as 'create', open files, so they might change the current open file.
  44. 6. When editing files, it is easy to accidentally specify a wrong line number or to write code with incorrect indentation. Always check the code after you issue an edit to make sure that it reflects what you wanted to accomplish. If it didn't, issue another command to fix it.
  45. (Open file: {open_file})
  46. (Current directory: {working_dir})
  47. bash-$
  48. next_step_template: |-
  49. {observation}
  50. (Open file: {open_file})
  51. (Current directory: {working_dir})
  52. bash-$
  53. next_step_no_output_template: |-
  54. Your command ran successfully and did not produce any output.
  55. (Open file: {open_file})
  56. (Current directory: {working_dir})
  57. bash-$
  58. put_demos_in_history: true
  59. state_command:
  60. name: state
  61. code: |
  62. state() {
  63. local working_dir="$PWD";
  64. if [ -z "$CURRENT_FILE" ]; then
  65. echo '{"open_file": "n/a", "working_dir": "'$working_dir'"}';
  66. else
  67. echo '{"open_file": "'$(realpath "$CURRENT_FILE")'", "working_dir": "'$working_dir'"}';
  68. fi
  69. };
  70. parse_function: XMLThoughtActionParser
  71. env_variables:
  72. WINDOW: 100
  73. OVERLAP: 2
  74. CURRENT_LINE: 0
  75. CURRENT_FILE: ""
  76. SEARCH_RESULTS: ()
  77. SEARCH_FILES: ()
  78. SEARCH_INDEX: 0
  79. command_files:
  80. - config/commands/defaults.sh
  81. - config/commands/search.sh
  82. - config/commands/edit_linting.sh
  83. - config/commands/_split_string.py
  84. - config/commands/submit.sh
  85. parse_command: ParseCommandDetailed
  86. history_processor: Last5Observations
  87. demonstrations:
  88. - trajectories/demonstrations/replay__marshmallow-code__marshmallow-1867__xml_sys-env_window100__t-0.20__p-0.95__c-2.00__install-1/marshmallow-code__marshmallow-1867.traj