Skip to content

Resume sessions#13585

Open
dawoodkhan82 wants to merge 19 commits into
mainfrom
resume-sessions
Open

Resume sessions#13585
dawoodkhan82 wants to merge 19 commits into
mainfrom
resume-sessions

Conversation

@dawoodkhan82

@dawoodkhan82 dawoodkhan82 commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator

Description

Quick summary: an active queued job can now survive a refresh or short connection drop without being submitted again.

  • While a job is running, the UI saves its session and event ID. On reload it reconnects to the same app/session, resumes that event, replays the pending output, then acknowledges it and clears the recovery state.
  • This only applies to an in-flight job. Once the result has been shown, a normal later refresh starts clean and does not restore the user’s last output.
  • Restored sessions are checked against the current app so state cannot leak between different apps on the same origin.
  • The queue stream handoff was tightened so a normal stream close is not treated like a disconnect, and chained events reopen the stream after they join the queue.
  • Existing clients keep the old behavior unless session resume is enabled, and normal load events still run immediately when there is nothing to resume.

Closes: #13584
Closes: #8368

Screen.Recording.2026-07-16.at.3.36.05.PM.mov

AI Disclosure

  • I used AI to help review the issue, implementation, tests, and PR text. I self-reviewed the changes.
  • I did not use AI

Testing and Formatting Your Code

  • Client browser and Node unit tests
  • Queue backend tests
  • Existing functional tests in SSR and non-SSR mode
  • Offline refresh and reconnect demo flow
  • Frontend formatting, type checks, and builds

No Playwright tests were added.

@gradio-pr-bot

gradio-pr-bot commented Jul 13, 2026

Copy link
Copy Markdown
Collaborator

🪼 branch checks and previews

Name Status URL
Spaces ready! Spaces preview
Website ready! Website preview
Storybook ready! Storybook preview
🦄 Changes detected! Details

Install Gradio from this PR

pip install https://huggingface.co/buckets/gradio/pypi-previews/resolve/9df64cc56de2a16b1470e151150181f0d8d1bba5/gradio-6.20.0-py3-none-any.whl

Install Gradio Python Client from this PR

pip install "gradio-client @ git+https://github.com/gradio-app/gradio@9df64cc56de2a16b1470e151150181f0d8d1bba5#subdirectory=client/python"

Import Gradio JS Client from this PR via CDN

import { Client } from "https://huggingface.co/buckets/gradio/npm-previews/resolve/9df64cc56de2a16b1470e151150181f0d8d1bba5/browser.js";

@gradio-pr-bot

gradio-pr-bot commented Jul 13, 2026

Copy link
Copy Markdown
Collaborator

🦄 change detected

This Pull Request includes changes to the following packages.

Package Version
@gradio/client minor
gradio minor

  • Resume queued jobs and restore undelivered output after temporary disconnects or page refreshes

Something isn't right?

  • Maintainers can change the version label to modify the version bump.
  • If the bot has failed to detect any changes, or if this pull request needs to update multiple packages to different versions or requires a more comprehensive changelog entry, maintainers can update the changelog file directly.

@dawoodkhan82
dawoodkhan82 marked this pull request as ready for review July 17, 2026 02:17
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.

Resume long running sessions Long-running tasks require open connection, looking for polling solution

2 participants