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

Add CodeActSWEAgent to remove browsing & github + improvements on agentskills #2105

Merged
merged 28 commits into from
May 30, 2024
Merged
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
e9d7889
update swe_bench prompt;
xingyaoww May 27, 2024
8ec58d2
upgrade agentskills and update testcases
xingyaoww May 27, 2024
1e58a12
update infer prompt
xingyaoww May 27, 2024
80c0a33
fix cwd
xingyaoww May 27, 2024
4aeb002
add icl for swebench
xingyaoww May 27, 2024
4f853e7
also log in_context_example to run infer
xingyaoww May 27, 2024
2a1cc9a
remove extra print
xingyaoww May 27, 2024
deef10b
change prompt to abs path
xingyaoww May 27, 2024
7783c10
update error message to include current file info
xingyaoww May 27, 2024
c2a284f
change cwd for jupyter if needed
xingyaoww May 27, 2024
604c8d9
update edit error message
xingyaoww May 27, 2024
851df73
update prompt
xingyaoww May 28, 2024
6e2736f
improve git get patch
xingyaoww May 28, 2024
a36f6f5
update hint string
xingyaoww May 28, 2024
cb23bdb
default to 50 turns
xingyaoww May 28, 2024
fa97e57
revert changes from codeact agent and create new CodeActSWEAgent
xingyaoww May 28, 2024
a98f15a
revert changes to codeact
xingyaoww May 28, 2024
a9dc3ce
revert instructions for run infer
xingyaoww May 28, 2024
a27b0bb
revert instructions for run infer
xingyaoww May 28, 2024
368f0b9
update README
xingyaoww May 28, 2024
e699f21
update max iter
xingyaoww May 28, 2024
3eaa6fb
add codeact swe agent
xingyaoww May 28, 2024
832a828
fix issue for CodeActSWEAgent
xingyaoww May 28, 2024
95eb048
allow specifying max iter in cmdline script
xingyaoww May 28, 2024
a4af937
stop printing
xingyaoww May 28, 2024
f6a6854
Update agenthub/codeact_swe_agent/README.md
xingyaoww May 28, 2024
fdce0ce
Fix prompt regression in jupyter plugin
li-boxuan May 29, 2024
9b499e5
Merge remote-tracking branch 'upstream/main' into xw/swe-bench-prompt
li-boxuan May 30, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
update edit error message
  • Loading branch information
xingyaoww committed May 27, 2024
commit 604c8d9888e64b98468169a38f0fc12ee7eafe6a
28 changes: 21 additions & 7 deletions opendevin/runtime/plugins/agent_skills/agentskills.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,21 +259,35 @@ def edit_file(start: int, end: int, content: str) -> None:
with open(CURRENT_FILE, 'r') as file:
lines = file.readlines()

ERROR_MSG = f'[Error editing opened file {CURRENT_FILE}. Please confirm the opened file is correct.]'
ERROR_MSG_SUFFIX = (
'Your changes have NOT been applied. Please fix your edit command and try again.\n'
'You either need to 1) Open the correct file and try again or 2) Specify the correct start/end line arguments.\n'
'DO NOT re-run the same failed edit command. Running it again will lead to the same error.'
)
# Check arguments
if not (1 <= start <= len(lines)):
raise ValueError(
f'Error editing opened file {CURRENT_FILE}: Invalid start line number: {start}. Line numbers must be between 1 and {len(lines)} (inclusive).'
print(
f'{ERROR_MSG}\n'
f'Invalid start line number: {start}. Line numbers must be between 1 and {len(lines)} (inclusive).\n'
f'{ERROR_MSG_SUFFIX}'
)
return

if not (1 <= end <= len(lines)):
raise ValueError(
f'Error editing opened file {CURRENT_FILE}: Invalid end line number: {end}. Line numbers must be between 1 and {len(lines)} (inclusive).'
print(
f'{ERROR_MSG}\n'
f'Invalid end line number: {end}. Line numbers must be between 1 and {len(lines)} (inclusive).\n'
f'{ERROR_MSG_SUFFIX}'
)

return
if start > end:
raise ValueError(
f'Error editing opened file {CURRENT_FILE}: Invalid line range: {start}-{end}. Start must be less than or equal to end.'
print(
f'{ERROR_MSG}\n'
f'Invalid line range: {start}-{end}. Start must be less than or equal to end.\n'
f'{ERROR_MSG_SUFFIX}'
)
return

edited_content = content + '\n'
n_edited_lines = len(edited_content.split('\n'))
Expand Down