Repository navigation
fix(platform): keep task attachment bytes alive and name a gone one - #4085
Merged
Merged
Conversation
A task attachment whose bytes left the object store made every run start fail with `http_502` and a "Try again" hint, for ever, and three automatic retries burned on it. Three root causes: - `/api/sandbox-blob` collapsed the store's 404 into 502, so the daemon could not tell "file gone" from "store down". A missing object now answers 404. - `stageTaskInputs` treated every skipped file as an infra fault. A gone attachment now fails the start by the file's shown name as `input_missing` (never auto-retried, steer restart included) and the task reads "An attachment on this task is no longer in storage"; a gone earlier deliverable leaves the brief instead of failing the run; every other skip stays the generic, listed failure. - No blob-liveness check knew `app.tasks.attachments` / `outputs` hold blob refs, so deleting the file row deleted the task's bytes. One predicate, `tasks/blob-holders.ts#taskHoldsBlobRef`, now sits in the knowledge release seam, `deleteFile`, the abandoned-upload sweep and the task door's own release, which held the only copy before. Locales en/de/fr, unit tests per seam, and two real-Postgres/MinIO lanes: `checkSandboxBlobDoor` asks a signed never-written key for its 404, and `checkTaskHeldBlobOutlivesFileRow` deletes a file row under a task, finds the bytes kept, and sees the release queued once the task lets go.
The task-automation page's table of final failures gains the row for an attachment that is no longer in storage: whoever can change the task removes it or uploads it again, Details names the file. EN, DE and FR.
One automation.md row for the 404 pass-through, the `input_missing` start failure, the dropped deliverable and the task-held blob liveness, naming the unit suites and the two `backend:integration` lanes that own them.
This was referenced Oct 2, 2026
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
A task attachment whose bytes left the object store made every run start fail with
http_502and a "Try again" hint, for ever, and three automatic retries burned on it. Clicking the attachment chip 404'd too. Three root causes, each fixed and locked with a regression test:/api/sandbox-blobnow passes a missing object through as 404, so the in-sandbox daemon reportshttp_404and the task host can tell "file gone" from "store down". Every other store failure stays 502.partitionTaskInputSkipsreads the skips: a gone attachment fails the start by the file's shown name as the newinput_missingfailure code (never auto-retried, steer restart included); the task shows The agent couldn't finish this task with "An attachment on this task is no longer in storage" (en/de/fr, plus the bell/e-mail body); a gone earlier deliverable leaves the brief instead of failing the run; any other skip keeps the generic, listed failure.app.tasks.attachments/outputslist refs with no file row of their own, so deleting the file row (files API, trash purge, a chat thread's file row sharing the ref) deleted the task's bytes. One predicate,domains/tasks/blob-holders.ts#taskHoldsBlobRef, now sits in the knowledge release seam (assessRefLivenessblobLive),deleteFile, both abandoned-upload sweep statements and the task door's own release inretire.ts, which held the only copy before.Docs: the task-automation "When the agent can't finish" table gains the row (EN/DE/FR). Manual layer: one automation.md row naming the owning suites.
Proof
@tale/platformserver vitest, touched areastests/guardstask-agent-run-failure-notice),@tale/docstest (222), tsc, oxlint, oxfmt,lint:manual,lint:linksbackend:integrationfull run on a throwaway Postgres + MinIOReal Postgres caught what the unit doubles could not: the predicate's parameter form failed with
could not determine data type of parameter(jsonb_build_objecttakes "any"); the fragment casts::text, and the file-delete lane plus the two new lanes pass.Out of scope
Recovery for an affected task: remove the attachments, upload them again, Start.