Skip to content

[backend] POST /system/clean silently ignores body-read errors — and defaults to "delete everything" #96

Closed

Description

@devin-ai-integration

In cleanSystem (server.go:813-830):

bodyBytes, _ := io.ReadAll(io.LimitReader(r.Body, 1<<20))

The read error is swallowed. If the body can't be read, bodyBytes is empty → input stays all-nil → falls into the input.Logs == nil && input.Cache == nil && input.Vacuum == nil branch → opts.All = true — the most destructive option.

Two problems: (a) ignored ReadAll error means a truncated/garbage body isn't rejected, and (b) "no options specified" defaulting to All = true is the wrong default for a destructive endpoint — it should require an explicit selection and default to the least destructive action (or a 400).

Activity

  1. sanketpatel32 commented on Nov 22, 2026

    @sanketpatel32
    Owner

    Acknowledged — body-read errors are ignored and the default deletes everything. Not in the PR #128 sweep; queued for the next pass.

  2. devin-ai-integration commented on Nov 22, 2026

    @devin-ai-integration
    ContributorAuthor

    Already fixed on main — the /system/clean handler includes the SELECT_TARGET + body-read error handling merged in #128; the re-verification ran against the pre-sweep commit. Verified at current HEAD.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions