Skip to content

feat(session): provisional-record protocol for aborted turns#39

Open
nightlessbaron wants to merge 1 commit into
prodfrom
feat/linear-trajectory-provisional-record
Open

feat(session): provisional-record protocol for aborted turns#39
nightlessbaron wants to merge 1 commit into
prodfrom
feat/linear-trajectory-provisional-record

Conversation

@nightlessbaron

@nightlessbaron nightlessbaron commented Jun 10, 2026

Copy link
Copy Markdown

Adds the provisional-record mechanism to LinearTrajectory:

  • append_provisional_record(record) — appends a record as the trajectory tail without committing it to token state (num_assistant / token_ids left untouched). Used for an aborted generation (finish_reason == "abort", e.g. an SGLang weight-update pause) so the agent's abort-retry re-issues the same turn from the prior checkpoint.
  • _drop_provisional_records() — discards any trailing record past the committed count.
  • update_pretokenized_state now drops provisional records first, so a successful turn supersedes a prior provisional abort and merge_samples never sees a mid-trajectory ABORTED record.

If retries are exhausted, the provisional remains as the honest final ABORTED turn.

Add append_provisional_record/_drop_provisional_records so an aborted turn is recorded as a tail-only trajectory record without committing token state, superseded by the next committed turn.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.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.

1 participant