Skip to content

SWE-agent takes a GitHub issue and tries to automatically fix it, using your LM of choice. It can also be employed for offensive cybersecurity or competitive coding challenges. [NeurIPS 2024]

interactive state updated

Talor Abramovich6599f23d73ad
diff --git a/config/ctf_crypto.yaml b/config/ctf_crypto.yaml
index 46f922aa..4c3714a1 100644
--- a/config/ctf_crypto.yaml
+++ b/config/ctf_crypto.yaml
@@ -68,27 +68,32 @@ instance_template: |-
(Open file: {open_file})
(Current directory: {working_dir})
+ (Interactive session: {interactive_session})
bash-$
next_step_template: |-
{observation}
(Open file: {open_file})
(Current directory: {working_dir})
+ (Interactive session: {interactive_session})
bash-$
next_step_no_output_template: |-
Your command ran successfully and did not produce any output.
(Open file: {open_file})
(Current directory: {working_dir})
+ (Interactive session: {interactive_session})
bash-$
state_command:
name: state
code: |
state() {
local working_dir="$PWD";
- if [ -z $CURRENT_FILE ]; then
- echo '{"open_file": "n/a", "working_dir": "'$working_dir'"}';
- else
- echo '{"open_file": "'$(realpath $CURRENT_FILE)'", "working_dir": "'$working_dir'"}';
+ local open_file="n/a";
+ local interactive_session="${INTERACTIVE_SESSION:-n/a}";
+ if [ ! -z $CURRENT_FILE ]; then
+ open_file=$(realpath $CURRENT_FILE);
fi
+
+ echo '{"open_file": "'$open_file'", "working_dir": "'$working_dir'", "interactive_session": "'$interactive_session'"}'
};
parse_function: ThoughtActionParser
env_variables:
diff --git a/config/ctf_forensics.yaml b/config/ctf_forensics.yaml
index 198e6804..e47e2e69 100644
--- a/config/ctf_forensics.yaml
+++ b/config/ctf_forensics.yaml
@@ -68,27 +68,32 @@ instance_template: |-
(Open file: {open_file})
(Current directory: {working_dir})
+ (Interactive session: {interactive_session})
bash-$
next_step_template: |-
{observation}
(Open file: {open_file})
(Current directory: {working_dir})
+ (Interactive session: {interactive_session})
bash-$
next_step_no_output_template: |-
Your command ran successfully and did not produce any output.
(Open file: {open_file})
(Current directory: {working_dir})
+ (Interactive session: {interactive_session})
bash-$
state_command:
name: state
code: |
state() {
local working_dir="$PWD";
- if [ -z $CURRENT_FILE ]; then
- echo '{"open_file": "n/a", "working_dir": "'$working_dir'"}';
- else
- echo '{"open_file": "'$(realpath $CURRENT_FILE)'", "working_dir": "'$working_dir'"}';
+ local open_file="n/a";
+ local interactive_session="${INTERACTIVE_SESSION:-n/a}";
+ if [ ! -z $CURRENT_FILE ]; then
+ open_file=$(realpath $CURRENT_FILE);
fi
+
+ echo '{"open_file": "'$open_file'", "working_dir": "'$working_dir'", "interactive_session": "'$interactive_session'"}'
};
parse_function: ThoughtActionParser
env_variables:
diff --git a/config/ctf_misc.yaml b/config/ctf_misc.yaml
index d577af07..5ff73a83 100644
--- a/config/ctf_misc.yaml
+++ b/config/ctf_misc.yaml
@@ -68,27 +68,32 @@ instance_template: |-
(Open file: {open_file})
(Current directory: {working_dir})
+ (Interactive session: {interactive_session})
bash-$
next_step_template: |-
{observation}
(Open file: {open_file})
(Current directory: {working_dir})
+ (Interactive session: {interactive_session})
bash-$
next_step_no_output_template: |-
Your command ran successfully and did not produce any output.
(Open file: {open_file})
(Current directory: {working_dir})
+ (Interactive session: {interactive_session})
bash-$
state_command:
name: state
code: |
state() {
local working_dir="$PWD";
- if [ -z $CURRENT_FILE ]; then
- echo '{"open_file": "n/a", "working_dir": "'$working_dir'"}';
- else
- echo '{"open_file": "'$(realpath $CURRENT_FILE)'", "working_dir": "'$working_dir'"}';
+ local open_file="n/a";
+ local interactive_session="${INTERACTIVE_SESSION:-n/a}";
+ if [ ! -z $CURRENT_FILE ]; then
+ open_file=$(realpath $CURRENT_FILE);
fi
+
+ echo '{"open_file": "'$open_file'", "working_dir": "'$working_dir'", "interactive_session": "'$interactive_session'"}'
};
parse_function: ThoughtActionParser
env_variables:
diff --git a/config/ctf_pwn.yaml b/config/ctf_pwn.yaml
index f1ed14f9..2d3a0897 100644
--- a/config/ctf_pwn.yaml
+++ b/config/ctf_pwn.yaml
@@ -68,27 +68,32 @@ instance_template: |-
(Open file: {open_file})
(Current directory: {working_dir})
+ (Interactive session: {interactive_session})
bash-$
next_step_template: |-
{observation}
(Open file: {open_file})
(Current directory: {working_dir})
+ (Interactive session: {interactive_session})
bash-$
next_step_no_output_template: |-
Your command ran successfully and did not produce any output.
(Open file: {open_file})
(Current directory: {working_dir})
+ (Interactive session: {interactive_session})
bash-$
state_command:
name: state
code: |
state() {
local working_dir="$PWD";
- if [ -z $CURRENT_FILE ]; then
- echo '{"open_file": "n/a", "working_dir": "'$working_dir'"}';
- else
- echo '{"open_file": "'$(realpath $CURRENT_FILE)'", "working_dir": "'$working_dir'"}';
+ local open_file="n/a";
+ local interactive_session="${INTERACTIVE_SESSION:-n/a}";
+ if [ ! -z $CURRENT_FILE ]; then
+ open_file=$(realpath $CURRENT_FILE);
fi
+
+ echo '{"open_file": "'$open_file'", "working_dir": "'$working_dir'", "interactive_session": "'$interactive_session'"}'
};
parse_function: ThoughtActionParser
env_variables:
diff --git a/config/ctf_rev.yaml b/config/ctf_rev.yaml
index dde0b3f6..a250accd 100644
--- a/config/ctf_rev.yaml
+++ b/config/ctf_rev.yaml
@@ -68,27 +68,32 @@ instance_template: |-
(Open file: {open_file})
(Current directory: {working_dir})
+ (Interactive session: {interactive_session})
bash-$
next_step_template: |-
{observation}
(Open file: {open_file})
(Current directory: {working_dir})
+ (Interactive session: {interactive_session})
bash-$
next_step_no_output_template: |-
Your command ran successfully and did not produce any output.
(Open file: {open_file})
(Current directory: {working_dir})
+ (Interactive session: {interactive_session})
bash-$
state_command:
name: state
code: |
state() {
local working_dir="$PWD";
- if [ -z $CURRENT_FILE ]; then
- echo '{"open_file": "n/a", "working_dir": "'$working_dir'"}';
- else
- echo '{"open_file": "'$(realpath $CURRENT_FILE)'", "working_dir": "'$working_dir'"}';
+ local open_file="n/a";
+ local interactive_session="${INTERACTIVE_SESSION:-n/a}";
+ if [ ! -z $CURRENT_FILE ]; then
+ open_file=$(realpath $CURRENT_FILE);
fi
+
+ echo '{"open_file": "'$open_file'", "working_dir": "'$working_dir'", "interactive_session": "'$interactive_session'"}'
};
parse_function: ThoughtActionParser
env_variables:
diff --git a/config/ctf_web.yaml b/config/ctf_web.yaml
index 156d460d..33ae928d 100644
--- a/config/ctf_web.yaml
+++ b/config/ctf_web.yaml
@@ -68,27 +68,32 @@ instance_template: |-
(Open file: {open_file})
(Current directory: {working_dir})
+ (Interactive session: {interactive_session})
bash-$
next_step_template: |-
{observation}
(Open file: {open_file})
(Current directory: {working_dir})
+ (Interactive session: {interactive_session})
bash-$
next_step_no_output_template: |-
Your command ran successfully and did not produce any output.
(Open file: {open_file})
(Current directory: {working_dir})
+ (Interactive session: {interactive_session})
bash-$
state_command:
name: state
code: |
state() {
local working_dir="$PWD";
- if [ -z $CURRENT_FILE ]; then
- echo '{"open_file": "n/a", "working_dir": "'$working_dir'"}';
- else
- echo '{"open_file": "'$(realpath $CURRENT_FILE)'", "working_dir": "'$working_dir'"}';
+ local open_file="n/a";
+ local interactive_session="${INTERACTIVE_SESSION:-n/a}";
+ if [ ! -z $CURRENT_FILE ]; then
+ open_file=$(realpath $CURRENT_FILE);
fi
+
+ echo '{"open_file": "'$open_file'", "working_dir": "'$working_dir'", "interactive_session": "'$interactive_session'"}'
};
parse_function: ThoughtActionParser
env_variables: