Skip to content

stale synthetic continuation rows can overwrite the session model #33044

Closed as not planned

Description

@codeg-dev

Problem

When an interrupted or failed turn leaves behind an internal/synthetic continuation user row, later session resume paths can treat that synthetic row's model as the durable session model. In practice this can make a normal user follow-up continue with a fallback/retry model even though the user did not choose that model and the fallback should have been scoped to the failed retry path.

Related edge cases:

  • provider streams that finish without content can leave ambiguous state instead of a retryable failure
  • retry-advisory errors such as Retry Error: An error occurred while processing your request. You can retry your request... may not be classified as retryable if the SDK marks them non-retryable or omits status metadata
  • Web session model sync can restore a stale/synthetic-only model into local state
  • a stale stored output model can be reused when the UI sends no explicit model on the next turn

Expected

Internal/synthetic continuation rows should not become the durable user-selected model for a normal follow-up turn. If a turn fails before content is produced, recovery should preserve the previous real user-selected model and retry only on verified retryable failures.

Actual

A synthetic/internal continuation row can become the most recent model source, causing later normal user input to reuse a fallback/retry model without a fresh reason.

Notes

I have a small patch that:

  • hides synthetic-only internal continuation users from Web timeline model sync
  • adds authoritative session-model sync for the active session page
  • treats empty provider streams and retry-advisory messages as retryable failures
  • closes blank/interrupted assistant rows without emitting a new error event that can re-trigger fallback
  • recovers stale explicit continuation models back to the previous real user model

Prepared with AI assistance.

Activity

  1. github-actions commented on Jun 20, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

  2. Necmttn commented on Jun 21, 2026

    @Necmttn

    Model provenance needs to be per turn. Separate user_selected, default_resolved, retry_fallback, and synthetic_internal model sources, and only user/default sources should update the durable session model.

    If a provider stream finishes with no content, write a terminal retry/error state rather than a synthetic continuation row that looks like user intent. Regression: failed retry on fallback model, then normal user follow-up, must continue with the previous real selected model.


    Generated with ax.

  3. codeg-dev commented on Jul 22, 2026

    @codeg-dev
    Author

    Status update from the original patch investigation: PR #33045 was intentionally closed after validation showed that repairing fallback-created session model state was the wrong layer.

    The narrower intended direction is to keep provider rate-limit / retry-advisory failures on the original-model retry path and avoid model-replacement fallback for those failures, rather than allowing a fallback model to become durable and repairing session state afterward. The remaining issue is therefore still valid, but #33045 should not be treated as an active fix.

  4. github-actions commented on Sep 21, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

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