Skip to content

[BUG] free-code repeats completed shell tool results #37

Description

@N0zoM1z0

Summary

A deterministic Anthropic-compatible provider can cause free-code to submit duplicate tool results for a completed shell tool-call ID. The linked standalone reproducer builds the public freecodexyz/free-code source snapshot checked on 2026-06-18, starts a local mock provider, and verifies the behavior without requiring this repository or any private fuzzing harness.

Affected target

  • Target: freecodexyz/free-code
  • Affected public source checked with the reproducer: db7d2165a708a9b4904e74bd2e1ab7753bf60901
  • Current public latest checked on 2026-06-18: no GitHub release/tag observed; the commit above was public HEAD
  • Environment: Linux x86_64 Docker, public source build with Bun
  • Provider/model: Anthropic-compatible local mock provider, claude-3-5-sonnet-20241022

Steps to reproduce

Prerequisites: Docker, Python 3, and the GitHub CLI (gh) for the clone command below. The linked reproducer is self-contained and uses only Python standard-library modules plus Docker. It builds the affected public source snapshot, starts a local mock provider, and runs the CLI in an isolated workspace. The Docker run is limited to 2 CPUs and 4 GiB RAM by default.

Complete self-contained reproducer: https://gist.github.com/N0zoM1z0/adb097dd6be467aa0cc1608d0e1dca6b

The Gist contains free-code-repeated-identical-tool-loop.reproduce.py. Download and run:

gh gist clone adb097dd6be467aa0cc1608d0e1dca6b free-code-repeated-identical-tool-loop-reproducer
cd free-code-repeated-identical-tool-loop-reproducer
python3 free-code-repeated-identical-tool-loop.reproduce.py

To reuse an already-built local image:

python3 free-code-repeated-identical-tool-loop.reproduce.py --skip-build

Key output from a local run against the affected source snapshot:

REPRODUCED

Actual behavior

free-code submits more than one tool result for the same provider-issued shell tool-call ID. The reproducer prints REPRODUCED only when the duplicate result is observed.

Expected behavior

free-code should execute and report each provider-issued tool-call ID at most once.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions