Skip to content

fix(eve): degrade missing attachment bytes on resume instead of failing the turn - #325

Closed
serhiizghama wants to merge 2 commits into
vercel:mainfrom
serhiizghama:fix/attachment-resume-missing-bytes
Closed

fix(eve): degrade missing attachment bytes on resume instead of failing the turn#325
serhiizghama wants to merge 2 commits into
vercel:mainfrom
serhiizghama:fix/attachment-resume-missing-bytes

Conversation

@serhiizghama

Copy link
Copy Markdown
Contributor

Fixes #276. Resuming a durable session whose history contains an inbound file attachment fatally fails when the staging sandbox has been torn down between turns — an ephemeral backend means the bytes behind a historical eve-sandbox: ref are gone, and hydrateMessageContent threw on the missing read, so the turn ended in session.failed and the bot never replied.

Hydration now degrades a missing ref to a text part ("Attached file <path> (<type>) is no longer available in this session.") and logs a warning, instead of throwing. The run continues, and the model is told the attachment is unreachable rather than chasing a path that no longer resolves. I gave it a distinct message from the normal non-inlinable text reference on purpose — on resume the path really is gone, so pointing the model at it would just invite a failed read.

This only affects the resume case where the bytes are already missing; a freshly staged attachment in the current turn still hydrates as before.

Tests: rewrote the existing "missing file" case to assert the degrade (the leading text survives, the file ref becomes the unavailability notice, no file part reaches the model) and added a regression that stages an image into one sandbox and hydrates the resulting ref against a fresh one — the same shape as a resume after teardown — and asserts the turn survives. Reverting the fix fails both. Full attachment-staging integration + unit suites green, typecheck/oxlint/oxfmt/guard:invariants clean, changeset (patch).

…ng the turn

Signed-off-by: serhiizghama <zmrser@gmail.com>
…esume

Signed-off-by: serhiizghama <zmrser@gmail.com>
@vercel

vercel Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

@serhiizghama is attempting to deploy a commit to the Vercel Team on Vercel.

A member of the Team first needs to authorize it.

@ruiconti

ruiconti commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Thanks for this — the approach is right and we carried it forward in #507 with both of your commits cherry-picked, authorship and sign-off intact (they needed re-signing to satisfy the repo's signed-commit requirement, which a fork PR can't do).

#507 adds two things on top: a corrected root cause (the sandbox is never torn down — session sandbox names embed the deployment id, so any redeploy points the resumed session at a fresh sandbox; we traced the #276 incident to specific deploys) and a recovery hint in the model-facing text. There's also a follow-up plan in #509 to keep the bytes alive across deploys using sandbox drives.

Closing in favor of #507.

@ruiconti ruiconti closed this Jul 2, 2026
ruiconti added a commit that referenced this pull request Jul 2, 2026
…the notice as an error

The degrade path landed in #325 attributed the missing bytes to
'ephemeral backend teardown'. Tracing a production incident (#276)
showed the real trigger: session sandbox names embed the deployment id,
so any redeploy points a resumed session at a fresh sandbox while the
old one — bytes intact — is simply never looked up again. Update the
comments and changeset to state that.

Shape the degraded text part as a filesystem error
(FileNotFound: Current snapshot may be newer and does not contain
<path>.) so the model interprets it like any other failed read instead
of prose it might paraphrase or second-guess.

Signed-off-by: Rui Conti <ruiconti@gmail.com>
ruiconti added a commit that referenced this pull request Jul 2, 2026
…the notice as an error

The degrade path landed in #325 attributed the missing bytes to
'ephemeral backend teardown'. Tracing a production incident (#276)
showed the real trigger: session sandbox names embed the deployment id,
so any redeploy points a resumed session at a fresh sandbox while the
old one — bytes intact — is simply never looked up again. Update the
comments and changeset to state that.

Shape the degraded text part as a filesystem error
(FileNotFound: Current snapshot may be newer and does not contain
<path>.) so the model interprets it like any other failed read instead
of prose it might paraphrase or second-guess.

Signed-off-by: Rui Conti <ruiconti@gmail.com>
ruiconti added a commit that referenced this pull request Jul 2, 2026
…the notice as an error

The degrade path landed in #325 attributed the missing bytes to
'ephemeral backend teardown'. Tracing a production incident (#276)
showed the real trigger: session sandbox names embed the deployment id,
so any redeploy points a resumed session at a fresh sandbox while the
old one — bytes intact — is simply never looked up again. Update the
comments and changeset to state that.

Shape the degraded text part as a filesystem error
(FileNotFound: Current snapshot may be newer and does not contain
<path>.) so the model interprets it like any other failed read instead
of prose it might paraphrase or second-guess.

Signed-off-by: Rui Conti <ruiconti@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Resuming a session with a prior file attachment fatally fails (Sandbox-ref FilePart references missing file)

2 participants