Skip to main content
← Back to list
01Issue
BugShippedSwamp CLIPublic
Assigneesstack72

Relationships

#3574 Worker writes drop writeResource/createFileWriter overrides (tags, lifetime, garbageCollection)

Opened by kagarmoe · 10/17/2026· Shipped 10/19/2026

Summary

A method running on a worker loses the options it passes to writeResource and createFileWriter (tags, lifetime, garbageCollection, and for files contentType). The data is saved with the spec's defaults instead, and nothing reports it. The same method keeps the options when it runs locally.

Where (origin/main ab2d51aa)

  • src/worker/remote_method_context.ts, createRemoteWriters:
    • writeResource(specName, name, data, _overrides) ignores _overrides and calls client.writeResource({ specName, name, data }).
    • createFileWriter(specName, name, _overrides) also ignores its options and calls client.openWriter({ specName, name }).
  • src/worker/data_plane_client.ts: the POST /data/resource body type is { specName, name, data }.
  • src/serve/data_plane.ts, #writeResource: reads only { specName, name, data } and calls writeResource(body.specName, body.name, body.data) with no overrides.

The local writer (createResourceWriter in src/domain/models/data_writer.ts) takes overrides?: ResourceWriteOverrides (lifetime, garbageCollection, tags, from src/domain/models/model.ts).

Observed

@swamp/agent-runner's run writes runResult with tags provider, exitCode and model. On three agent-dispatch runs executed on workers (swamp worker connect, Linux and WSL), the stored records carry only the system tags (type, specName, modelName, source, workflow*, job, step, initiatedBy) plus definition tags. None of the method's tags is there. A workflow that selects or asserts on those tags can't tell which model ran.

Proposed fix

  1. The worker sends the options with the write: POST /data/resource takes { specName, name, data, overrides? }, and openWriter takes the file-writer overrides.
  2. data_plane.ts validates overrides with the same schema used locally (tags as a string record; lifetime and garbageCollection via their existing schemas) and passes them to the writeResource returned by createResourceWriter. That writer already guards reserved tags, so a worker gets no more power than a local run.
  3. It works across versions: an older serve ignores the extra field, and an older worker sends none.
  4. Tests:
    • A remote_method_context test that the overrides reach the request body.
    • A data_plane test that tags and lifetime passed by a worker end up on the saved record.
    • A test that a worker can't set a reserved tag.

Environment

swamp 20261016.021405.0-sha.b46b8895; serve on Linux (WSL Ubuntu), workers on Linux and macOS.

02Bog Flow
✓OPEN✓TRIAGED✓IN PROGRESS✓SHIPPED+ 1 MOREASSIGNED+ 5 MOREREVIEW+ 7 MOREPR_MERGED+ 2 MORESESSION_SUMMARIZED

Shipped

10/19/2026, 4:02:57 PM

Click a lifecycle step above to view its details.

03Sludge Pulse
stack72 assigned stack7210/19/2026, 2:47:13 PM
Editable. Press Enter to edit.

stack72 commented 10/19/2026, 4:03:01 PM

Thanks @kagarmoe for reporting this! We shipped: Worker-run methods lose writeResource/createFileWriter overrides because the worker discards them, the data-plane request bodies have no field for them, and serve never passes them to the writer. Carry an optional overrides field on POST /data/resource and POST /data/writers, validate it at serve before lease bookkeeping with schemas built from the existing lifetime/GC schemas, and pass it to the same createResourceWriter/createFileWriterFactory writers a local run uses, so tag precedence and reserved-tag protection match local runs.. The fix has been merged and a release is on its way. We appreciate your contribution to swamp.

Sign in to post a ripple.