1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
name: "In-place file modification (read then write)"
description: >
Verify agent can modify an existing file in-place using read_file + write_file.
apply_patch was removed from the binary; this test covers the read-modify-write
workflow that achieves the same outcome.
sequential: true
setup:
- name: "Prepare workspace"
exec:
container: recursive-e2e
command: |
rm -rf /workspace/test-patch /tmp/rh-patch /tmp/sessions-patch
mkdir -p /workspace/test-patch /tmp/rh-patch /tmp/sessions-patch
echo prepared
cases:
- name: "Create base file for editing"
exec:
container: recursive-e2e
command: |
printf 'line one\nline two\nline three\n' > /workspace/test-patch/patch-me.txt
echo created
expect:
exitCode: 0
output:
contains: "created"
- name: "Agent modifies file using Read then Edit"
exec:
container: recursive-e2e
command: |
unset RECURSIVE_SESSIONS_DIR
RECURSIVE_HOME=/tmp/rh-patch \
recursive --workspace /workspace/test-patch \
--api-base http://aimock:4010/v1 \
--api-key mock-key \
-m mock-chat \
--max-steps 5 \
run "Modify patch-me.txt: change line two to line TWO and save it"
SESSION_DIR=$(find /tmp/rh-patch -name "transcript.jsonl" -exec dirname {} \; 2>/dev/null | head -1)
if [ -n "$SESSION_DIR" ]; then
cp -r "$SESSION_DIR"/. /tmp/sessions-patch/
echo "session copied"
else
echo "WARNING: no session found"
fi
expect:
exitCode: 0
- name: "patch-me.txt contains the edited content"
file:
container: recursive-e2e
path: /workspace/test-patch/patch-me.txt
exists: true
contains: "line TWO"
- name: "Original lines not in the edit are preserved"
exec:
container: recursive-e2e
command: >
grep -c "line one" /workspace/test-patch/patch-me.txt
&& grep -c "line three" /workspace/test-patch/patch-me.txt
expect:
exitCode: 0
- name: "Session records read_file and write_file tool calls"
recursive-session:
container: recursive-e2e
input: /tmp/sessions-patch
status:
hasToolCalls:
minMessages: 3
teardown:
- name: "Clean workspace"
ignoreError: true
exec:
container: recursive-e2e
command: |
rm -rf /workspace/test-patch /tmp/rh-patch /tmp/sessions-patch