Skip to content

download_data only resolves gateway-local references but is described as reading 'the Swarm network' #141

Description

@crtahlin

Symptom

download_data is described as "Download data from the Swarm network using a reference hash", but it only resolves references the provenance gateway itself stored. A reference that the public Swarm gateway serves in 185 ms returns 404 here.

Measured 2026-08-24:

# write via the public Swarm gateway
POST https://api.gateway.ethswarm.org/bzz            -> 201  {"reference":"34be0ab4…dab9"}

# read the same reference back
GET  https://api.gateway.ethswarm.org/bzz/34be0ab4…dab9/   -> 200 in 0.186s  "ax-903-control-probe"
GET  https://provenance-gateway.datafund.io/api/v1/data/34be0ab4…dab9
     -> 404 in 3.338s  {"detail":"Data not found for reference 34be0ab4…dab9"}

The content is demonstrably on Swarm and retrievable. Only this reader cannot see it.

Why an agent gets this wrong

The tool description promises the Swarm network. An agent handed any Swarm reference — from a manifest, a feed, a colleague, or its own earlier upload through a different path — will reasonably call download_data and conclude the data does not exist. "Data not found for reference …" reads as this content is gone, when it means I only index my own uploads.

That is a correctness trap rather than an inconvenience: the agent's next action is usually to re-upload, which spends a stamp to duplicate data already stored.

Suggestion

Either behaviour is defensible; the mismatch between them is not.

  1. Preferred — fall back to a public Swarm gateway on local miss, so download_data means what it says.
  2. Or — narrow the tool description to "data uploaded through this gateway", and change the 404 text to distinguish not stored here from not on Swarm.

Related — error hints that cannot resolve the error

Separately, several unrecoverable errors return _next: health_check. During the 2026-08-21 review, purchase_stamp failed with Insufficient funds … retryable: false and pointed the caller at health_check, which cannot add funds. An agent following _next loops without progress. Hints on terminal errors are more useful pointing at something that can change the outcome, or stating plainly that operator action is required.

Context: gateway-side write failures are tracked in datafund/swarm_connect#250; the AX review finding is ethersphere/DevRel#903.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingpriority-highHigh priority

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions