#1584

A planned queue hand-off adds "Resuming from unexpected session interruption." to every queued turn, and the notices stack

Openstefanofaopened 11d ago

Summary

With vercel({ leaseMs }), a queue delivery runs the turn by resuming it from the journal. Each such resume adds the user message "Resuming from unexpected session interruption." to the turn's steering, unless the turn yielded. A planned hand-off to the queue isn't a yield, so every queued turn tells the model it was interrupted when nothing failed.

The notices are never collapsed. Each resume appends one more, and they stay in the history, so later turns carry every earlier notice.

We observed this with the local queue. We haven't confirmed it on hosted Vercel Queues yet.

Cause

From reading the source: resumeCheckpoint in src/acp/libfx_journal.zig copies the turn's saved steering and appends one notice when yielded is false (const notices: usize = if (yielded) 0 else 1;). Nothing checks for a notice already in the list. The function is the same in v0.0.14, v0.0.15 and v0.0.16, and main at 98286126 hasn't changed that file since v0.0.16.

Effect on one run

One run with 17 model requests, every request body logged, once without the queue and once through it:

Without the queueThrough the queue
Requests carrying a notice0 of 1712 of 17
Notices per request01, or 2 in a later turn of the same session
Notices in the run015 (690 characters)
  • Tokens. One notice is 46 characters, roughly 10 to 15 input tokens (an estimate), so about 150 to 225 extra input tokens per run.
  • Prompt cache. A notice stays at a stable position once added, so it doesn't break a cached prefix.
  • The message itself is the cost that matters: on every queued turn, the model reads that its session was interrupted.
  • A real crash adds one more notice on top.

Possible fixes

Either is enough, and both are better:

  • Treat a planned hand-off like a yield: no notice when the previous holder released the lease, or when the backstop delivery found no crash.
  • Keep at most one resume notice per turn: drop earlier notices when a resume appends a new one.

Activity

1
dhruvil-codes9d ago

Opened PR #1615 fixing this with unit test coverage in src/acp/libfx_journal.zig ensuring at most one resume notice is kept across queued checkpoint resumes. Ready for review!