recursive-agent 0.8.2

A Rust coding-agent platform: kernel, tools, multi-agent orchestration, HTTP API, MCP, and TUI
Documentation
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: ["completed", "success"]
      hasToolCalls: ["read_file", "write_file"]
      minMessages: 3

teardown:
  - name: "Clean workspace"
    ignoreError: true
    exec:
      container: recursive-e2e
      command: |
        rm -rf /workspace/test-patch /tmp/rh-patch /tmp/sessions-patch